From 9fe6c75d0a9f895e0ca37b96493f3e2e060f171b Mon Sep 17 00:00:00 2001 From: William Date: Wed, 6 Aug 2025 17:53:49 -0300 Subject: [PATCH] moved disko config out of hardware-config --- hosts/modules/io/default.nix | 1 + hosts/modules/io/disko.nix | 81 +++++++++++++++++++ hosts/modules/io/hardware-configuration.nix | 78 ------------------ hosts/modules/trantor/default.nix | 1 + hosts/modules/trantor/disko.nix | 34 ++++++++ .../trantor/hardware-configuration.nix | 31 ------- 6 files changed, 117 insertions(+), 109 deletions(-) create mode 100644 hosts/modules/io/disko.nix create mode 100644 hosts/modules/trantor/disko.nix diff --git a/hosts/modules/io/default.nix b/hosts/modules/io/default.nix index 5975294..fb244cc 100644 --- a/hosts/modules/io/default.nix +++ b/hosts/modules/io/default.nix @@ -3,6 +3,7 @@ { imports = [ ./boot.nix + ./disko.nix ./hardware-configuration.nix ./programs.nix ./services.nix diff --git a/hosts/modules/io/disko.nix b/hosts/modules/io/disko.nix new file mode 100644 index 0000000..17cdbcd --- /dev/null +++ b/hosts/modules/io/disko.nix @@ -0,0 +1,81 @@ +{ ... }: + +{ + disko.devices = { + disk = { + main = { + type = "disk"; + device = "/dev/disk/by-id/mmc-hDEaP3_0x1041b689"; + content = { + type = "gpt"; + partitions = { + ESP = { + priority = 1; + name = "ESP"; + start = "1MiB"; + end = "1GiB"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot/efi"; + mountOptions = [ + "noatime" + "fmask=0077" + "dmask=0077" + ]; + }; + }; + cryptroot = { + priority = 3; + name = "root"; + size = "100%"; + content = { + type = "luks"; + name = "cryptroot"; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; + subvolumes = { + "@root" = { + mountpoint = "/"; + mountOptions = [ + "noatime" + "compress=zstd" + "subvol=@root" + ]; + }; + "@home" = { + mountpoint = "/home"; + mountOptions = [ + "noatime" + "compress=zstd" + "subvol=@home" + ]; + }; + "@nix" = { + mountpoint = "/nix"; + mountOptions = [ + "noatime" + "compress=zstd" + "subvol=@nix" + ]; + }; + "@persistent" = { + mountpoint = "/persistent"; + mountOptions = [ + "noatime" + "compress=zstd" + "subvol=@persistent" + ]; + }; + }; + }; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/hosts/modules/io/hardware-configuration.nix b/hosts/modules/io/hardware-configuration.nix index 8a71aca..56f0d0d 100644 --- a/hosts/modules/io/hardware-configuration.nix +++ b/hosts/modules/io/hardware-configuration.nix @@ -33,82 +33,4 @@ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - - disko.devices = { - disk = { - main = { - type = "disk"; - device = "/dev/disk/by-id/mmc-hDEaP3_0x1041b689"; - content = { - type = "gpt"; - partitions = { - ESP = { - priority = 1; - name = "ESP"; - start = "1MiB"; - end = "1GiB"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot/efi"; - mountOptions = [ - "noatime" - "fmask=0077" - "dmask=0077" - ]; - }; - }; - cryptroot = { - priority = 3; - name = "root"; - size = "100%"; - content = { - type = "luks"; - name = "cryptroot"; - content = { - type = "btrfs"; - extraArgs = [ "-f" ]; - subvolumes = { - "@root" = { - mountpoint = "/"; - mountOptions = [ - "noatime" - "compress=zstd" - "subvol=@root" - ]; - }; - "@home" = { - mountpoint = "/home"; - mountOptions = [ - "noatime" - "compress=zstd" - "subvol=@home" - ]; - }; - "@nix" = { - mountpoint = "/nix"; - mountOptions = [ - "noatime" - "compress=zstd" - "subvol=@nix" - ]; - }; - "@persistent" = { - mountpoint = "/persistent"; - mountOptions = [ - "noatime" - "compress=zstd" - "subvol=@persistent" - ]; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; } diff --git a/hosts/modules/trantor/default.nix b/hosts/modules/trantor/default.nix index 39a5b9e..9bdb292 100644 --- a/hosts/modules/trantor/default.nix +++ b/hosts/modules/trantor/default.nix @@ -3,6 +3,7 @@ { imports = [ ./boot.nix + ./disko.nix ./hardware-configuration.nix ./networking.nix ]; diff --git a/hosts/modules/trantor/disko.nix b/hosts/modules/trantor/disko.nix new file mode 100644 index 0000000..1b2b66c --- /dev/null +++ b/hosts/modules/trantor/disko.nix @@ -0,0 +1,34 @@ +{ ... }: + +{ + disko.devices = { + disk = { + main = { + type = "disk"; + device = "/dev/sda"; + content = { + type = "gpt"; + partitions = { + boot = { + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + root = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/hosts/modules/trantor/hardware-configuration.nix b/hosts/modules/trantor/hardware-configuration.nix index 6f36ffa..d5cc31f 100644 --- a/hosts/modules/trantor/hardware-configuration.nix +++ b/hosts/modules/trantor/hardware-configuration.nix @@ -24,35 +24,4 @@ networking.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; - - disko.devices = { - disk = { - main = { - type = "disk"; - device = "/dev/sda"; - content = { - type = "gpt"; - partitions = { - boot = { - size = "512M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - }; - }; - root = { - size = "100%"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - }; - }; - }; - }; - }; - }; - }; }