diff options
author | Jasper Ras <jras@hostnet.nl> | 2025-03-23 20:20:06 +0100 |
---|---|---|
committer | Jasper Ras <jras@hostnet.nl> | 2025-03-23 20:20:06 +0100 |
commit | 2414dc1eeb900b0113bd310fefae8e872f017015 (patch) | |
tree | 66335711c961c73461ddeb1a4a0861d45352617e | |
parent | fa3185e236e0c5192663609eb9e4e449e6c8b6b6 (diff) |
stuff
-rw-r--r-- | modules/snorlax/default.nix | 10 | ||||
-rw-r--r-- | modules/snorlax/disk-config.nix | 21 |
2 files changed, 20 insertions, 11 deletions
diff --git a/modules/snorlax/default.nix b/modules/snorlax/default.nix index a05b1f4..9cf1bfe 100644 --- a/modules/snorlax/default.nix +++ b/modules/snorlax/default.nix @@ -1,4 +1,4 @@ -{ config, ... }: +{ config, lib, ... }: { imports = [ ./disk-config.nix @@ -15,6 +15,9 @@ boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; + boot.initrd.postDeviceCommands = lib.mkAfter '' + zfs rollback -r data/local/root@blank + ''; time.timeZone = "Europe/Amsterdam"; @@ -29,9 +32,6 @@ services.syncoid.enable = true; services.syncoid.sshKey = config.age.secrets.syncoid-key.path; services.syncoid.commands = { - "zroot/persist" = { - source = "zroot/persist"; - target = "ubuntu@185.107.88.38:backup/snorlax"; - }; + "data/safe/persist".target = "ubuntu@185.107.88.38:backup/snorlax"; }; } diff --git a/modules/snorlax/disk-config.nix b/modules/snorlax/disk-config.nix index 2dced50..39a9ccf 100644 --- a/modules/snorlax/disk-config.nix +++ b/modules/snorlax/disk-config.nix @@ -21,7 +21,7 @@ size = "100%"; content = { type = "zfs"; - pool = "zroot"; + pool = "data"; }; }; }; @@ -30,20 +30,29 @@ }; zpool = { - zroot = { + data = { type = "zpool"; + rootFsOptions = { compression = "zstd"; "com.sun:auto-snapshot" = "false"; }; - mountpoint = "/"; - postCreateHook = "zfs list -t snap -H -o name | grep -E '^zroot@blank$' || zfs snapshot zroot@blank"; datasets = { - persist = { + "local/root" = { + type = "zfs_fs"; + mountpoint = "/"; + postCreateHook = "zfs list -t snap -H -o name | grep -E '^data/local/root@blank$' || zfs snapshot data/local/root@blank"; + }; + + "local/nix" = { + type = "zfs_fs"; + mountpoint = "/nix"; + }; + + "safe/persist" = { type = "zfs_fs"; mountpoint = "/persist"; - options."com.sun:auto-snapshot" = "true"; }; }; }; |