home-manager: allow dependencies on bind mounts

This commit is contained in:
Louis Bettens 2021-12-27 17:06:33 +01:00
parent df5038f20c
commit 77a0cebfdd

View file

@ -140,7 +140,7 @@ in
++ optional (versionAtLeast pkgs.bindfs.version "1.14.9") "fsname=${targetDir}"
);
bindfsOptionFlag = optionalString (bindfsOptions != "") (" -o " + bindfsOptions);
bindfs = "bindfs -f" + bindfsOptionFlag;
bindfs = "bindfs" + bindfsOptionFlag;
startScript = pkgs.writeShellScript name ''
set -eu
if ! mount | grep -F ${mountPoint}' ' && ! mount | grep -F ${mountPoint}/; then
@ -183,6 +183,7 @@ in
Install.WantedBy = [ "default.target" ];
Service = {
Type = "forking";
ExecStart = "${startScript}";
ExecStop = "${stopScript}";
Environment = "PATH=${makeBinPath [ pkgs.coreutils pkgs.utillinux pkgs.gnugrep pkgs.bindfs ]}:/run/wrappers/bin";