From fc37d7a802fbea2b2f0f1cdb5c5ad232e0eacc13 Mon Sep 17 00:00:00 2001 From: eyjhb Date: Fri, 14 Mar 2025 16:40:23 +0100 Subject: [PATCH] easy-zfs-mounts: do not rely on fileSystems, so it can be used with impermanence --- shared/modules/easy-zfs-mounts.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/shared/modules/easy-zfs-mounts.nix b/shared/modules/easy-zfs-mounts.nix index ded1b7a..34c3bce 100644 --- a/shared/modules/easy-zfs-mounts.nix +++ b/shared/modules/easy-zfs-mounts.nix @@ -10,9 +10,15 @@ in { default = {}; }; + # config = { + # mine.zfsMounts = let + # zfsFilesystems = lib.filterAttrs (_: v: v.fsType == "zfs") config.fileSystems; + # in lib.mapAttrs' (_: v: lib.nameValuePair v.device v.mountPoint) zfsFilesystems; + # }; + + # TODO: fix this better. We just do this, so we do not rely on fileSystems, otherwise we cannot + # use this with impermanence config = { - mine.zfsMounts = let - zfsFilesystems = lib.filterAttrs (_: v: v.fsType == "zfs") config.fileSystems; - in lib.mapAttrs' (_: v: lib.nameValuePair v.device v.mountPoint) zfsFilesystems; + mine.zfsMounts = lib.mapAttrs' (n: v: lib.nameValuePair ("rpool/" + n) v.mountpoint) config.mine.disks.pools.rpool.datasets; }; }