From 29d2d1e7fd5f9362f2ff1d6720be88705911a075 Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Sun, 3 Mar 2024 20:28:07 +0100 Subject: [PATCH] refactor disko on chungus --- .../hardware-configuration/disko-config.nix | 79 +++++++++---------- 1 file changed, 36 insertions(+), 43 deletions(-) diff --git a/nixos/machines/chungus/hardware-configuration/disko-config.nix b/nixos/machines/chungus/hardware-configuration/disko-config.nix index b7db6dc..e54e6ea 100644 --- a/nixos/machines/chungus/hardware-configuration/disko-config.nix +++ b/nixos/machines/chungus/hardware-configuration/disko-config.nix @@ -25,14 +25,11 @@ in type = "disk"; device = "/dev/nvme0n1"; content = { - type = "table"; - format = "gpt"; - partitions = [ - { - name = "ESP"; - start = "0"; - end = "500MiB"; - bootable = true; + type = "gpt"; + partitions = { + boot = { + priority = 1; + size = "500M"; content = { type = "filesystem"; format = "vfat"; @@ -41,11 +38,10 @@ in "defaults" ]; }; - } - { - name = "zfs"; - start = "500MiB"; - end = "100%"; + }; + root = { + priority = 100; + size = "100%"; content = { type = "luks"; name = "root"; @@ -54,8 +50,8 @@ in pool = "zroot"; }; }; - } - ]; + }; + }; }; }; } // builtins.mapAttrs @@ -63,13 +59,10 @@ in type = "disk"; device = device_path; content = { - type = "table"; - format = "gpt"; - partitions = [ - { - name = "zfs"; - start = "0"; - end = "100%"; + type = "gpt"; + partitions = { + zfs = { + size = "100%"; content = { type = "luks"; name = "raid_${name}"; @@ -78,8 +71,8 @@ in pool = "zraid"; }; }; - } - ]; + }; + }; }; } ) @@ -109,7 +102,7 @@ in options = { mountpoint = "legacy"; compression = "lz4"; - "com.sun:auto-snapshot:daily" = true; + "com.sun:auto-snapshot:daily" = toString true; }; }; }; @@ -130,9 +123,9 @@ in options = { mountpoint = "legacy"; compression = "lz4"; - "com.sun:auto-snapshot:daily" = true; - "com.sun:auto-snapshot:weekly" = true; - "com.sun:auto-snapshot:monthly" = true; + "com.sun:auto-snapshot:daily" = toString true; + "com.sun:auto-snapshot:weekly" = toString true; + "com.sun:auto-snapshot:monthly" = toString true; }; }; "legacy" = { @@ -141,7 +134,7 @@ in options = { mountpoint = "legacy"; compression = "lz4"; - "com.sun:auto-snapshot:monthly" = true; + "com.sun:auto-snapshot:monthly" = toString true; }; }; "borg" = { @@ -150,9 +143,9 @@ in options = { mountpoint = "legacy"; compression = "lz4"; - "com.sun:auto-snapshot:daily" = true; - "com.sun:auto-snapshot:weekly" = true; - "com.sun:auto-snapshot:monthly" = true; + "com.sun:auto-snapshot:daily" = toString true; + "com.sun:auto-snapshot:weekly" = toString true; + "com.sun:auto-snapshot:monthly" = toString true; }; }; "syncthing" = { @@ -161,9 +154,9 @@ in options = { mountpoint = "legacy"; compression = "lz4"; - "com.sun:auto-snapshot:daily" = true; - "com.sun:auto-snapshot:weekly" = true; - "com.sun:auto-snapshot:monthly" = true; + "com.sun:auto-snapshot:daily" = toString true; + "com.sun:auto-snapshot:weekly" = toString true; + "com.sun:auto-snapshot:monthly" = toString true; }; }; "mirror" = { @@ -172,9 +165,9 @@ in options = { mountpoint = "legacy"; compression = "lz4"; - "com.sun:auto-snapshot:daily" = true; - "com.sun:auto-snapshot:weekly" = true; - "com.sun:auto-snapshot:montly" = true; + "com.sun:auto-snapshot:daily" = toString true; + "com.sun:auto-snapshot:weekly" = toString true; + "com.sun:auto-snapshot:montly" = toString true; }; }; "services" = { @@ -183,9 +176,9 @@ in options = { mountpoint = "legacy"; compression = "lz4"; - "com.sun:auto-snapshot:daily" = true; - "com.sun:auto-snapshot:weekly" = true; - "com.sun:auto-snapshot:montly" = true; + "com.sun:auto-snapshot:daily" = toString true; + "com.sun:auto-snapshot:weekly" = toString true; + "com.sun:auto-snapshot:montly" = toString true; }; }; "container" = { @@ -203,8 +196,8 @@ in options = { mountpoint = "legacy"; compression = "lz4"; - "com.sun:auto-snapshot:daily" = true; - "com.sun:auto-snapshot:weekly" = true; + "com.sun:auto-snapshot:daily" = toString true; + "com.sun:auto-snapshot:weekly" = toString true; }; }; "robi/media" = {