-
-
Notifications
You must be signed in to change notification settings - Fork 287
Open
Description
Hi,
I'm struggling to get disko-install to work.
- I boot a qemu vm with minimal install
- I remount
/nixto have more spacemount -o remount,size=10G,noatime /nix/.rw-store - I copy over my flake (shown below)
- I generate hardware-config for my flake with
nixos-generate-config --no-filesystems --root /tmp/cfgand copy it to my flake - I run
sudo nix --extra-experimental-features 'flakes nix-command' run github:nix-community/disko#disko-install -- --flake '.#nix-playground' --disk main /dev/sda --show-trace - After download and "these 173 derivations will be built" I get
Failed to build NixOS configuration.
When I use sudo nix --extra-experimental-features 'flakes nix-command' run github:nix-community/disko -- --mode disko <path/to/disk-config.nix> and then do the regular flake nixos install all works fine.
Below is my flake.nix (I stripped out anything just to leave basic host config and this below still fails to install):
{
description = "disko test";
inputs = {
# Specify the source of Home Manager and Nixpkgs.
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
{
nixpkgs,
disko,
...
}@inputs:
let
system = "x86_64-linux";
my_overlays = import ./overlays (inputs // { inherit system; });
pkgs = import nixpkgs {
inherit system;
};
hosts = {
nix-playground = {
username = "myuser";
};
server = {
username = "root";
};
};
mkSystem =
hostName: opts:
nixpkgs.lib.nixosSystem {
inherit system;
modules = [
#{ nixpkgs.overlays = nix_overlays; }
./nixos/${hostName}/disk-config.nix
disko.nixosModules.disko
./nixos/${hostName}/configuration.nix
];
};
in
{
nixosConfigurations = builtins.mapAttrs mkSystem hosts;
};
}The nixos/nix-playground/configuration.nix:
{ config, pkgs, ... }:
{
imports = [
./hardware-configuration.nix # generate with nixos-generate-config
];
boot.loader.systemd-boot.enable = true;
networking.hostName = "nix-playground";
services.openssh.enable = true;
environment.systemPackages = with pkgs; [
zsh
git
neovim
];
users.users.myuser = {
isNormalUser = true;
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [
"key here"
];
};
system.stateVersion = "25.11";
}And finally the nixos/nix-playground/disk-config.nix:
{
disko.devices = {
disk = {
main = {
type = "disk";
device = "/dev/disk/by-diskseq/1";
content = {
type = "gpt";
partitions = {
ESP = {
priority = 1;
name = "ESP";
start = "1M";
end = "128M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
root = {
size = "100%";
content = {
type = "btrfs";
extraArgs = [ "-f" ]; # Override existing partition
# Subvolumes must set a mountpoint in order to be mounted,
# unless their parent is mounted
subvolumes = {
# Subvolume name is different from mountpoint
"/rootfs" = {
mountpoint = "/";
};
# Subvolume name is the same as the mountpoint
"/home" = {
mountOptions = [ "compress=zstd" ];
mountpoint = "/home";
};
# Sub(sub)volume doesn't need a mountpoint as its parent is mounted
"/home/myuser" = { };
# Parent is not mounted so the mountpoint must be set
"/nix" = {
mountOptions = [
"compress=zstd"
"noatime"
];
mountpoint = "/nix";
};
};
};
};
};
};
};
};
};
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels