From 140edd2d010452b491dbff09abd163edbcaf9bc1 Mon Sep 17 00:00:00 2001 From: rogarb Date: Mon, 24 Jul 2023 19:22:48 +0200 Subject: [PATCH] fix(btrfs): automatic setting of fileSystems Subvolumes without a mountpoint shouldn't be declared as fileSystems. --- lib/types/btrfs.nix | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/types/btrfs.nix b/lib/types/btrfs.nix index 48af13c..9c78e27 100644 --- a/lib/types/btrfs.nix +++ b/lib/types/btrfs.nix @@ -123,14 +123,8 @@ default = [ (map (subvol: - let - mountpoint = - if (subvol.mountpoint != null) then subvol.mountpoint - else if (config.mountpoint == null) then subvol.name - else null; - in - lib.optional (mountpoint != null) { - fileSystems.${mountpoint} = { + lib.optional (subvol.mountpoint != null) { + fileSystems.${subvol.mountpoint} = { device = config.device; fsType = "btrfs"; options = subvol.mountOptions ++ [ "subvol=${subvol.name}" ];