From f40f98a732659be090ce6b472e5655c8ccd2fc45 Mon Sep 17 00:00:00 2001 From: B YI Date: Sun, 3 Nov 2019 12:43:01 +0800 Subject: [PATCH] pam_mount: change order of lines in pam_mount.conf Change order of pam_mount.conf.xml so that users can override the preset configs. My use case is to mount a gocryptfs (a fuse program) volume. I can not do that in current order. Because even if I change the `` and `` by add below to extraVolumes ``` ${pkgs.fuse}/bin/mount.fuse %(VOLUME) %(MNTPT) "%(before=\"-o \" OPTIONS)" ${pkgs.fuse}/bin/fusermount -u %(MNTPT) ``` mount.fuse still does not work because it can not find `fusermount`. pam_mount will told stat /bin/fusermount failed. Fine, I can add a `` section to extraVolumes ``` ${pkgs.fuse}/bin:${pkgs.coreutils}/bin:${pkgs.utillinux}/bin ``` but then the `` section is overridden by the hardcoded `${pkgs.utillinux}/bin` below. So it still does not work. --- nixos/modules/security/pam_mount.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nixos/modules/security/pam_mount.nix b/nixos/modules/security/pam_mount.nix index 8b131c54a2a..75f58462d13 100644 --- a/nixos/modules/security/pam_mount.nix +++ b/nixos/modules/security/pam_mount.nix @@ -50,9 +50,6 @@ in - ${concatStrings (map userVolumeEntry (attrValues extraUserVolumes))} - ${concatStringsSep "\n" cfg.extraVolumes} - @@ -64,6 +61,9 @@ in ${pkgs.pam_mount}/bin/mount.crypt %(VOLUME) %(MNTPT) ${pkgs.pam_mount}/bin/umount.crypt %(MNTPT) ${pkgs.pam_mount}/bin/pmvarrun -u %(USER) -o %(OPERATION) + + ${concatStrings (map userVolumeEntry (attrValues extraUserVolumes))} + ${concatStringsSep "\n" cfg.extraVolumes} ''; }];