Skip to content

Commit 6762da1

Browse files
committed
fix: set gocryptfs fusermount path [skip ci]
Signed-off-by: Reputable2722 <153411261+Reputable2772@users.noreply.github.com>
1 parent 7766254 commit 6762da1

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

System/HP-Laptop/gocryptfs.nix

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,15 @@
55
programs.fuse.userAllowOther = true;
66

77
security.pam.mount.enable = true;
8-
security.pam.mount.extraVolumes = [
9-
"<volume user=\"vishnu\" fstype=\"fuse\" path=\"${pkgs.gocryptfs}/bin/gocryptfs#/home/.vishnu-cipher\" mountpoint=\"/home/vishnu\" options=\"allow_other,quiet,noprealloc\" />"
10-
];
8+
security.pam.mount.extraVolumes =
9+
let
10+
# This wrapper restores the PATH so gocryptfs can find fusermount
11+
gocryptfsWrapper = pkgs.writeShellScript "gocryptfs-pam-wrapper" ''
12+
export PATH="/run/wrappers/bin:/run/current-system/sw/bin:$PATH"
13+
exec ${pkgs.gocryptfs}/bin/gocryptfs "$@"
14+
'';
15+
in
16+
[
17+
"<volume user=\"vishnu\" fstype=\"fuse\" path=\"${gocryptfsWrapper}#/home/.vishnu-cipher\" mountpoint=\"/home/vishnu\" options=\"allow_other,quiet,noprealloc\" />"
18+
];
1119
}

0 commit comments

Comments
 (0)