From 029ff0c9a3cddd814dcc1700c5e9ea1a808d017f Mon Sep 17 00:00:00 2001 From: Jan-Bulthuis Date: Tue, 10 Jun 2025 03:04:44 +0200 Subject: [PATCH] Added link creation to activation script --- modules/nixos/domain.nix | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/modules/nixos/domain.nix b/modules/nixos/domain.nix index dabd144..25e61a3 100644 --- a/modules/nixos/domain.nix +++ b/modules/nixos/domain.nix @@ -138,7 +138,7 @@ in inherit pkgs; modules = [ ( - { ... }: + { lib, ... }: { home.stateVersion = "24.11"; home.username = "$USER"; @@ -146,16 +146,17 @@ in modules.profiles.base.enable = true; # Mount the directories from the network share - home.persistence."/network/$USER" = { - directories = [ - "Music" - "Pictures" - "Documents" - "Videos" - ]; - files = [ ]; - allowOther = true; - }; + home.activation.dirMount = lib.hm.dag.entryAfter [ "writeBoundary" ] '' + if klist -s; then + echo "Kerberos ticket found, mounting home directory" + ln -s /network/$USER/Documents $HOME/Documents || true + ln -s /network/$USER/Music $HOME/Music || true + ln -s /network/$USER/Pictures $HOME/Pictures || true + ln -s /network/$USER/Video $HOME/Video || true + else + echo "No kerberos ticket found" + fi + ''; } ) ] ++ config.home-manager.sharedModules;