From 5393154b9176e72d5e21a70912f6e214b21708df Mon Sep 17 00:00:00 2001 From: unexplrd Date: Sat, 3 May 2025 13:29:11 +0300 Subject: [PATCH] hosts/dunamis: break up disko Signed-off-by: unexplrd --- hosts/dunamis/configuration.nix | 4 +- hosts/dunamis/disko.nix | 83 ------------------------------- hosts/dunamis/disko/default.nix | 14 ++++++ hosts/dunamis/disko/disk-main.nix | 70 ++++++++++++++++++++++++++ 4 files changed, 86 insertions(+), 85 deletions(-) delete mode 100644 hosts/dunamis/disko.nix create mode 100644 hosts/dunamis/disko/default.nix create mode 100644 hosts/dunamis/disko/disk-main.nix diff --git a/hosts/dunamis/configuration.nix b/hosts/dunamis/configuration.nix index 51bd485..1257f18 100644 --- a/hosts/dunamis/configuration.nix +++ b/hosts/dunamis/configuration.nix @@ -7,9 +7,9 @@ self.nixosModules.desktop self.nixosModules.system ./boot - ./disko.nix - ./networking.nix + ./disko ./facter + ./networking.nix ./nix ./programs.nix ./services.nix diff --git a/hosts/dunamis/disko.nix b/hosts/dunamis/disko.nix deleted file mode 100644 index ad09002..0000000 --- a/hosts/dunamis/disko.nix +++ /dev/null @@ -1,83 +0,0 @@ -{inputs, ...}: let - disk = "/dev/disk/by-id/nvme-eui.000000000000000100a075244b5d6185"; -in { - imports = with inputs; [ - disko.nixosModules.disko - ]; - disko.devices.nodev = { - "/tmp" = { - fsType = "tmpfs"; - mountOptions = ["rw" "nosuid" "nodev"]; - }; - }; - disko.devices.disk.main = { - type = "disk"; - device = disk; - content = { - type = "gpt"; - partitions = { - ESP = { - size = "2G"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - mountOptions = [ - "umask=0077" - "fmask=0022" - "dmask=0022" - "noexec" - "nosuid" - "nodev" - ]; - }; - }; - luks = { - size = "100%"; - content = { - type = "luks"; - name = "luks-main"; - initrdUnlock = true; - settings.allowDiscards = true; - content = { - type = "btrfs"; - extraArgs = ["-f"]; - subvolumes = { - "@nixos-root" = { - mountpoint = "/"; - mountOptions = [ - "compress=zstd" - "noatime" - "noexec" - ]; - }; - "@home" = { - mountpoint = "/home"; - mountOptions = [ - "compress=zstd" - "noatime" - ]; - }; - "@storage" = { - mountpoint = "/storage"; - mountOptions = [ - "compress=zstd" - "noatime" - ]; - }; - "@nix" = { - mountpoint = "/nix"; - mountOptions = [ - "compress-force=zstd" - "noatime" - ]; - }; - }; - }; - }; - }; - }; - }; - }; -} diff --git a/hosts/dunamis/disko/default.nix b/hosts/dunamis/disko/default.nix new file mode 100644 index 0000000..881ae36 --- /dev/null +++ b/hosts/dunamis/disko/default.nix @@ -0,0 +1,14 @@ +{inputs, ...}: let + disk = "/dev/disk/by-id/nvme-eui.000000000000000100a075244b5d6185"; +in { + imports = with inputs; [ + disko.nixosModules.disko + ]; + disko.devices.nodev = { + "/tmp" = { + fsType = "tmpfs"; + mountOptions = ["rw" "nosuid" "nodev"]; + }; + }; + disko.devices.disk.main = import ./disk-main.nix {inherit disk;}; +} diff --git a/hosts/dunamis/disko/disk-main.nix b/hosts/dunamis/disko/disk-main.nix new file mode 100644 index 0000000..3ee66c5 --- /dev/null +++ b/hosts/dunamis/disko/disk-main.nix @@ -0,0 +1,70 @@ +{disk, ...}: { + type = "disk"; + device = disk; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "2G"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ + "umask=0077" + "fmask=0022" + "dmask=0022" + "noexec" + "nosuid" + "nodev" + ]; + }; + }; + luks = { + size = "100%"; + content = { + type = "luks"; + name = "luks-main"; + initrdUnlock = true; + settings.allowDiscards = true; + content = { + type = "btrfs"; + extraArgs = ["-f"]; + subvolumes = { + "@nixos-root" = { + mountpoint = "/"; + mountOptions = [ + "compress=zstd" + "noatime" + "noexec" + ]; + }; + "@home" = { + mountpoint = "/home"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + "@storage" = { + mountpoint = "/storage"; + mountOptions = [ + "compress=zstd" + "noatime" + ]; + }; + "@nix" = { + mountpoint = "/nix"; + mountOptions = [ + "compress-force=zstd" + "noatime" + ]; + }; + }; + }; + }; + }; + }; + }; +}