diff --git a/machines/persephone.nix b/machines/persephone.nix index 7ab5012..9bd2bad 100644 --- a/machines/persephone.nix +++ b/machines/persephone.nix @@ -5,12 +5,7 @@ modulesPath, ... }: -let - bootUUID = config.machines.fs.bootUUID; - efiUUID = config.machines.fs.efiUUID; - luuksUUID = config.machines.fs.luuksUUID; - cryptrootUUID = config.machines.fs.cryptrootUUID; -in + { imports = [ (modulesPath + "/installer/scan/not-detected.nix") @@ -20,80 +15,6 @@ in ../profiles/desktop.linux.nix ]; - # FILE SYSTEM - - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/${bootUUID}"; - fsType = "ext4"; - }; - - fileSystems."/efi" = { - device = "/dev/disk/by-uuid/${efiUUID}"; - fsType = "vfat"; - options = [ - "fmask=0137" - "dmask=0027" - ]; - }; - - boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/${luuksUUID}"; - - fileSystems."/" = { - device = "/dev/disk/by-uuid/${cryptrootUUID}"; - fsType = "btrfs"; - options = [ "subvol=@root" ]; - }; - - fileSystems."/home" = { - device = "/dev/disk/by-uuid/${cryptrootUUID}"; - fsType = "btrfs"; - options = [ "subvol=@home" ]; - }; - - fileSystems."/nix" = { - device = "/dev/disk/by-uuid/${cryptrootUUID}"; - fsType = "btrfs"; - options = [ "subvol=@nix" ]; - }; - - fileSystems."/var/cache" = { - device = "/dev/disk/by-uuid/${cryptrootUUID}"; - fsType = "btrfs"; - options = [ "subvol=@var_cache" ]; - }; - - fileSystems."/var/log" = { - device = "/dev/disk/by-uuid/${cryptrootUUID}"; - fsType = "btrfs"; - options = [ "subvol=@var_log" ]; - }; - - fileSystems."/var/spool" = { - device = "/dev/disk/by-uuid/${cryptrootUUID}"; - fsType = "btrfs"; - options = [ "subvol=@var_spool" ]; - }; - - fileSystems."/var/tmp" = { - device = "/dev/disk/by-uuid/${cryptrootUUID}"; - fsType = "btrfs"; - options = [ "subvol=@var_tmp" ]; - }; - - fileSystems."/var/lib/machines" = { - device = "/dev/disk/by-uuid/${cryptrootUUID}"; - fsType = "btrfs"; - options = [ "subvol=@var_lib_machines" ]; - }; - - fileSystems."/var/lib/portables" = { - device = "/dev/disk/by-uuid/${cryptrootUUID}"; - fsType = "btrfs"; - options = [ "subvol=@var_lib_portables" ]; - }; - - swapDevices = [ ]; - boot = { extraModulePackages = [ ]; kernelModules = [ "kvm-intel" ]; diff --git a/profiles/minimal.linux.nix b/profiles/minimal.linux.nix index 44721b6..acf51eb 100644 --- a/profiles/minimal.linux.nix +++ b/profiles/minimal.linux.nix @@ -1,5 +1,10 @@ { config, lib, ... }: - +let + bootUUID = config.machines.fs.bootUUID; + efiUUID = config.machines.fs.efiUUID; + luuksUUID = config.machines.fs.luuksUUID; + cryptrootUUID = config.machines.fs.cryptrootUUID; +in { imports = [ ./minimal.nix ]; @@ -24,6 +29,78 @@ xbootldrMountPoint = "/boot"; }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/${bootUUID}"; + fsType = "ext4"; + }; + + fileSystems."/efi" = { + device = "/dev/disk/by-uuid/${efiUUID}"; + fsType = "vfat"; + options = [ + "fmask=0137" + "dmask=0027" + ]; + }; + + boot.initrd.luks.devices."cryptroot".device = "/dev/disk/by-uuid/${luuksUUID}"; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/${cryptrootUUID}"; + fsType = "btrfs"; + options = [ "subvol=@root" ]; + }; + + fileSystems."/home" = { + device = "/dev/disk/by-uuid/${cryptrootUUID}"; + fsType = "btrfs"; + options = [ "subvol=@home" ]; + }; + + fileSystems."/nix" = { + device = "/dev/disk/by-uuid/${cryptrootUUID}"; + fsType = "btrfs"; + options = [ "subvol=@nix" ]; + }; + + fileSystems."/var/cache" = { + device = "/dev/disk/by-uuid/${cryptrootUUID}"; + fsType = "btrfs"; + options = [ "subvol=@var_cache" ]; + }; + + fileSystems."/var/log" = { + device = "/dev/disk/by-uuid/${cryptrootUUID}"; + fsType = "btrfs"; + options = [ "subvol=@var_log" ]; + }; + + fileSystems."/var/spool" = { + device = "/dev/disk/by-uuid/${cryptrootUUID}"; + fsType = "btrfs"; + options = [ "subvol=@var_spool" ]; + }; + + fileSystems."/var/tmp" = { + device = "/dev/disk/by-uuid/${cryptrootUUID}"; + fsType = "btrfs"; + options = [ "subvol=@var_tmp" ]; + }; + + fileSystems."/var/lib/machines" = { + device = "/dev/disk/by-uuid/${cryptrootUUID}"; + fsType = "btrfs"; + options = [ "subvol=@var_lib_machines" ]; + }; + + fileSystems."/var/lib/portables" = { + device = "/dev/disk/by-uuid/${cryptrootUUID}"; + fsType = "btrfs"; + options = [ "subvol=@var_lib_portables" ]; + }; + + swapDevices = [ ]; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";