diff --git a/hosts/firefly/disko/default.nix b/hosts/firefly/disko/default.nix index 0118394..9198bf5 100644 --- a/hosts/firefly/disko/default.nix +++ b/hosts/firefly/disko/default.nix @@ -19,7 +19,7 @@ type = "filesystem"; format = "vfat"; mountpoint = "/boot"; - mountOptions = [ "fmask=0022" "dmask=0022" ]; + mountOptions = [ "umask=0077" ]; }; }; luks = { @@ -27,8 +27,7 @@ content = { type = "luks"; name = "crypt-nvme"; - settings.allowDiscards = true; - #passwordFile = "/tmp/secret.key"; + passwordFile = "/tmp/secret.key"; content = { type = "lvm_pv"; vg = "nixos"; @@ -47,32 +46,8 @@ root = { size = "100%"; content = { - type = "btrfs"; - extraArgs = [ "-f" ]; - subvolumes = { - "/@" = { - mountpoint = "/"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; - "/@prev" = { - mountpoint = "/prev"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; - "/@nix" = { - mountpoint = "/nix"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; - - # Impermanence - "/@root" = { - mountpoint = "/persist"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; - "/@jimbo" = { - mountpoint = "/persist/home/jimbo"; - mountOptions = [ "compress=zstd" "noatime" ]; - }; - }; + type = "zfs"; + pool = "zroot"; }; }; swap = { @@ -85,6 +60,41 @@ }; }; }; + + zpool = { + zroot = { + type = "zpool"; + mode = "single"; + options.cachefile = "none"; + datasets = { + root = { + type = "zfs_fs"; + mountpoint = "/"; + options."com.sun:auto-snapshot" = "false"; + }; + prev = { + type = "zfs_fs"; + mountpoint = "/prev"; + options."com.sun:auto-snapshot" = "false"; + }; + nix = { + type = "zfs_fs"; + mountpoint = "/nix"; + options."com.sun:auto-snapshot" = "false"; + }; + + # Impermanence + persist = { + type = "zfs_fs"; + mountpoint = "/persist"; + }; + jimbo = { + type = "zfs_fs"; + mountpoint = "/persist/home/jimbo"; + }; + }; + }; + }; }; # Needed for impermanence diff --git a/modules/system/devices/disks/default.nix b/modules/system/devices/disks/default.nix index 3576248..69ebd0e 100644 --- a/modules/system/devices/disks/default.nix +++ b/modules/system/devices/disks/default.nix @@ -3,6 +3,5 @@ imports = [ ./filesystems ./impermanence - ./snapper ]; } diff --git a/modules/system/devices/disks/snapper/default.nix b/modules/system/devices/disks/snapper/default.nix deleted file mode 100644 index a4291bf..0000000 --- a/modules/system/devices/disks/snapper/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ ... }: -{ - imports = [ - ./root - ./jimbo - ]; - - services.snapper = { - snapshotInterval = "0/6:00:00"; - cleanupInterval = "12:00:00"; - persistentTimer = true; - }; -} diff --git a/modules/system/devices/disks/snapper/jimbo/default.nix b/modules/system/devices/disks/snapper/jimbo/default.nix deleted file mode 100644 index 56e07d5..0000000 --- a/modules/system/devices/disks/snapper/jimbo/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ ... }: -{ - services.snapper.configs.jimbo = { - SUBVOLUME = "/persist/home/jimbo"; - TIMELINE_CREATE = true; - TIMELINE_CLEANUP = true; - TIMELINE_LIMIT_DAILY = 1; - TIMELINE_LIMIT_WEEKLY = 1; - TIMELINE_LIMIT_MONTHLY = 0; - TIMELINE_LIMIT_YEARLY = 0; - }; -} diff --git a/modules/system/devices/disks/snapper/root/default.nix b/modules/system/devices/disks/snapper/root/default.nix deleted file mode 100644 index 92e28cf..0000000 --- a/modules/system/devices/disks/snapper/root/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ ... }: -{ - services.snapper.configs.root = { - SUBVOLUME = "/persist"; - TIMELINE_CREATE = true; - TIMELINE_CLEANUP = true; - TIMELINE_LIMIT_DAILY = 1; - TIMELINE_LIMIT_WEEKLY = 0; - TIMELINE_LIMIT_MONTHLY = 0; - TIMELINE_LIMIT_YEARLY = 0; - }; -}