From fa7a23d0ef0b8bf8918f7f1a241f1b7927db38b2 Mon Sep 17 00:00:00 2001 From: Bert Proesmans Date: Wed, 5 Nov 2025 22:03:07 +0000 Subject: [PATCH] fix(nodev); Set device default to fstype config The value for device is copied into the SOURCE column of findmnt. By default this is "none". The mount and unmount scripts branch on SOURCE=fsType specifically, and the existence of "none" in the SOURCE column causes wrong branches to be executed. For a list of special filesystems, the default value "none" is replaced by the value for fsType. --- lib/types/nodev.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/types/nodev.nix b/lib/types/nodev.nix index f0d3c50..ad72d47 100644 --- a/lib/types/nodev.nix +++ b/lib/types/nodev.nix @@ -6,6 +6,17 @@ rootMountPoint, ... }: +let + # REF; nixos/modules/tasks/filesystems.nix + specialFSTypes = [ + "proc" + "sysfs" + "tmpfs" + "ramfs" + "devtmpfs" + "devpts" + ]; +in { options = { type = lib.mkOption { @@ -86,4 +97,7 @@ description = "Packages"; }; }; + config = { + device = lib.mkIf (lib.elem config.fsType specialFSTypes) (lib.mkDefault config.fsType); + }; }