From a4f3b3141d59a1c73b56512317b644ae5a5df4d6 Mon Sep 17 00:00:00 2001 From: Leyla Becker Date: Sun, 23 Nov 2025 15:35:26 -0600 Subject: [PATCH] fix: fixed trailing mount path issue --- modules/nixos-modules/storage/impermanence.nix | 10 ++++++++-- modules/nixos-modules/storage/storage.nix | 6 ++++-- .../storage/submodules/impermanenceDataset.nix | 4 ++++ modules/nixos-modules/users.nix | 1 + 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/modules/nixos-modules/storage/impermanence.nix b/modules/nixos-modules/storage/impermanence.nix index 8f6d6d8..9af5681 100644 --- a/modules/nixos-modules/storage/impermanence.nix +++ b/modules/nixos-modules/storage/impermanence.nix @@ -87,7 +87,10 @@ in { neededForBoot = true; } ) - config.storage.impermanence.datasets; + (lib.filterAttrs ( + datasetName: dataset: dataset.impermanence.enable + ) + config.storage.impermanence.datasets); environment.persistence = lib.mapAttrs (datasetName: dataset: { @@ -116,7 +119,10 @@ in { in (enabledDirectories != {}) || (enabledFiles != {}) ) - config.storage.impermanence.datasets); + (lib.filterAttrs ( + datasetName: dataset: dataset.impermanence.enable + ) + config.storage.impermanence.datasets)); } (lib.mkIf config.storage.zfs.enable { storage.zfs.datasets = diff --git a/modules/nixos-modules/storage/storage.nix b/modules/nixos-modules/storage/storage.nix index 6cff4f1..c059733 100644 --- a/modules/nixos-modules/storage/storage.nix +++ b/modules/nixos-modules/storage/storage.nix @@ -43,6 +43,7 @@ in { storage.datasets = { local = { "nix" = { + impermanence.enable = false; type = "zfs_fs"; mount = "/nix"; snapshot = { @@ -54,6 +55,7 @@ in { }; replicate = { "system/var/log" = { + impermanence.enable = false; type = "zfs_fs"; mount = "/var/log"; }; @@ -78,13 +80,13 @@ in { # TODO: can we auto set the mount points on these to just be `"/persist/local/${name}"` local = { "" = { - mount = "/persist/local/"; + mount = "/persist/local"; }; }; # TODO: can we auto set the mount points on these to just be `"/persist/replicate/${name}"` replicate = { "" = { - mount = "/persist/replicate/"; + mount = "/persist/replicate"; }; "system/root" = { mount = "/persist/replicate/system/root"; diff --git a/modules/nixos-modules/storage/submodules/impermanenceDataset.nix b/modules/nixos-modules/storage/submodules/impermanenceDataset.nix index 4090b48..e4d3584 100644 --- a/modules/nixos-modules/storage/submodules/impermanenceDataset.nix +++ b/modules/nixos-modules/storage/submodules/impermanenceDataset.nix @@ -44,6 +44,10 @@ in { type = lib.types.attrsOf (lib.types.submodule pathTypeSubmodule); default = {}; }; + impermanence.enable = lib.mkOption { + type = lib.types.bool; + default = true; + }; }; config = { diff --git a/modules/nixos-modules/users.nix b/modules/nixos-modules/users.nix index f952861..195d8b6 100644 --- a/modules/nixos-modules/users.nix +++ b/modules/nixos-modules/users.nix @@ -407,6 +407,7 @@ in { mount = SOPS_AGE_KEY_DIRECTORY; atime = "off"; relatime = "off"; + impermanence.enable = false; }; } (lib.mkIf (!config.storage.impermanence.enable) {