diff --git a/hosts/eldrid/configuration.nix b/hosts/eldrid/configuration.nix index 01cd7ee..8d952fd 100644 --- a/hosts/eldrid/configuration.nix +++ b/hosts/eldrid/configuration.nix @@ -13,6 +13,7 @@ ./hardware.nix ./programs.nix ./stylix.nix + ./disko.nix ./users.nix ]; diff --git a/hosts/eldrid/disko.nix b/hosts/eldrid/disko.nix new file mode 100644 index 0000000..da551cb --- /dev/null +++ b/hosts/eldrid/disko.nix @@ -0,0 +1,88 @@ +{inputs, ...}: { + imports = with inputs; [ + disko.nixosModules.disko + ]; + disko.devices.disk.main = { + type = "disk"; + device = "/dev/nvme0n1"; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "1G"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ + "umask=0077" + "fmask=0022" + "dmask=0022" + "noexec" + ]; + }; + }; + luks = { + size = "100%"; + content = { + type = "luks"; + name = "lukscrypted"; + initrdUnlock = true; + settings.allowDiscards = true; + content = { + type = "btrfs"; + extraArgs = ["-f"]; + subvolumes = { + "@nixos" = { + mountpoint = "/"; + mountOptions = [ + "compress=zstd" + "noatime" + # "noexec" + ]; + }; + "@home" = { + mountpoint = "/home"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + "@flatpak" = { + mountpoint = "/var/lib/flatpak"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + # "@storage" = { + # mountpoint = "/storage"; + # mountOptions = [ + # "compress=zstd" + # "noatime" + # ]; + # }; + "@swap" = { + mountpoint = "/swap"; + mountOptions = [ + "compress=zstd" + "noatime" + # "noexec" + ]; + }; + # "@nix" = { + # mountpoint = "/nix"; + # mountOptions = [ + # "compress=zstd" + # "noatime" + # ]; + # }; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/hosts/eldrid/hardware.nix b/hosts/eldrid/hardware.nix index b279490..8c27130 100755 --- a/hosts/eldrid/hardware.nix +++ b/hosts/eldrid/hardware.nix @@ -26,36 +26,6 @@ in { boot.kernelModules = ["kvm-intel"]; boot.extraModulePackages = []; - fileSystems."/" = { - device = "/dev/disk/by-uuid/fc3d843d-54c6-4b2f-ac56-77f81600745e"; - fsType = "btrfs"; - options = ["subvol=@nixos,compress=zstd"]; - }; - - boot.initrd.luks.devices."luks".device = "/dev/disk/by-uuid/cbd7d98e-745b-4828-b868-42881bad353d"; - - fileSystems."/home" = { - device = "/dev/disk/by-uuid/fc3d843d-54c6-4b2f-ac56-77f81600745e"; - fsType = "btrfs"; - options = ["subvol=@home,compress=zstd"]; - }; - - fileSystems."/var/lib/flatpak" = { - device = "/dev/disk/by-uuid/fc3d843d-54c6-4b2f-ac56-77f81600745e"; - fsType = "btrfs"; - options = ["subvol=@flatpak,compress=zstd"]; - }; - - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/D38C-AA51"; - fsType = "vfat"; - options = ["fmask=0077" "dmask=0077"]; - }; - fileSystems."/swap" = { - device = "/dev/disk/by-uuid/fc3d843d-54c6-4b2f-ac56-77f81600745e"; - fsType = "btrfs"; - options = ["subvol=@swap,compress=zstd"]; - }; swapDevices = [ { device = "/swap/swapfile";