Moved to bind mounts
This commit is contained in:
parent
5ade637e57
commit
0305b8d33a
@ -146,17 +146,29 @@ in
|
|||||||
modules.profiles.base.enable = true;
|
modules.profiles.base.enable = true;
|
||||||
|
|
||||||
# Mount the directories from the network share
|
# Mount the directories from the network share
|
||||||
home.activation.dirMount = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
home.activation.dirMount =
|
||||||
if ${pkgs.krb5}/bin/klist -s; then
|
let
|
||||||
echo "Kerberos ticket found, mounting home directory"
|
bindScript = dir: ''
|
||||||
ln -s /network/$USER/Documents $HOME/Documents || true
|
mkdir -p /network/$USER/${dir}
|
||||||
ln -s /network/$USER/Music $HOME/Music || true
|
${pkgs.bindfs}/bin/bindfs /network/$USER/${dir} $HOME/${dir}
|
||||||
ln -s /network/$USER/Pictures $HOME/Pictures || true
|
'';
|
||||||
ln -s /network/$USER/Video $HOME/Video || true
|
in
|
||||||
else
|
lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||||
echo "No kerberos ticket found"
|
if ! ${pkgs.krb5}/bin/klist -s; then
|
||||||
fi
|
echo "No kerberos ticket found"
|
||||||
'';
|
${pkgs.krb5}/bin/kinit
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ${pkgs.krb5}/bin/klist -s; then
|
||||||
|
echo "Kerberos ticket found, mounting home directory"
|
||||||
|
${bindScript "Documents"}
|
||||||
|
${bindScript "Music"}
|
||||||
|
${bindScript "Pictures"}
|
||||||
|
${bindScript "Video"}
|
||||||
|
else
|
||||||
|
echo "Still no kerberos ticket found, skipping home directory mount"
|
||||||
|
fi
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
] ++ config.home-manager.sharedModules;
|
] ++ config.home-manager.sharedModules;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user