diff --git a/system/default.nix b/system/default.nix index e5628b4f..906d8ee1 100644 --- a/system/default.nix +++ b/system/default.nix @@ -29,7 +29,7 @@ with mylib.networking; { if headless then "grub" else "systemd-boot"; - systemd-boot.bootDevice = "/boot/efi"; + systemd-boot.bootDevice = "/boot"; grub.bootDevice = "/dev/sda"; }; diff --git a/system/nixinator/default.nix b/system/nixinator/default.nix index 62bcb1cf..40a33ab9 100644 --- a/system/nixinator/default.nix +++ b/system/nixinator/default.nix @@ -8,6 +8,7 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix + ./disks.nix ../modules ]; diff --git a/system/nixinator/disks.nix b/system/nixinator/disks.nix new file mode 100644 index 00000000..7c3474d6 --- /dev/null +++ b/system/nixinator/disks.nix @@ -0,0 +1,102 @@ +{ + disko.devices = { + disk = { + main = { + type = "disk"; + device = "/dev/disk/by-id/nvme-WD_BLACK_SN850X_2000GB_231623801519"; + content = { + type = "gpt"; + partitions = { + ESP = { + label = "EFI"; + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = ["defaults"]; + }; + }; + luks = { + label = "LUKS"; + size = "100%"; + content = { + type = "luks"; + name = "crypted"; + + extraOpenArgs = [ + "--perf-no_read_workqueue" + "--perf-no_write_workqueue" + ]; + + settings = { + allowDiscards = true; + crypttabExtraOpts = ["fido2-device=auto" "token-timeout=10"]; + + # Disable for interactive password entry + # keyFile = "/tmp/secret.key"; + }; + # additionalKeyFiles = ["/tmp/additionalSecret.key"]; + + content = { + type = "btrfs"; + extraArgs = ["-L" "NIXOS" "-f"]; + subvolumes = { + "/root" = { + mountpoint = "/"; + mountOptions = [ + "subvol=root" + "compress=zstd" + "noatime" + ]; + }; + "/home" = { + mountpoint = "/home"; + mountOptions = [ + "subvol=home" + "compress=zstd" + "noatime" + ]; + }; + "/nix" = { + mountpoint = "/nix"; + mountOptions = [ + "subvol=nix" + "compress=zstd" + "noatime" + ]; + }; + "/persist" = { + mountpoint = "/persist"; + mountOptions = [ + "subvol=persist" + "compress=zstd" + "noatime" + ]; + }; + "/log" = { + mountpoint = "/var/log"; + mountOptions = [ + "subvol=log" + "compress=zstd" + "noatime" + ]; + }; + "/swap" = { + mountpoint = "/swap"; + swap.swapfile.size = "16G"; + }; + }; + }; + }; + }; + }; + }; + }; + }; + }; + + fileSystems."/persist".neededForBoot = true; + fileSystems."/var/log".neededForBoot = true; +}