Added initial homeConfiguration for domain users

This commit is contained in:
Jan-Bulthuis 2025-06-09 12:50:30 +02:00
parent 739e335c28
commit c683809a78

View File

@ -127,9 +127,32 @@ in
# Set up home directory # Set up home directory
security.pam.services.login.makeHomeDir = true; security.pam.services.login.makeHomeDir = true;
security.pam.services.sshd.makeHomeDir = true; security.pam.services.sshd.makeHomeDir = true;
environment.loginShellInit = '' environment.loginShellInit =
echo "TEST" let
groups homeConfiguration = inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
(
{ ... }:
{
home.stateVersion = "24.11";
home.username = "$USER";
home.homeDirectory = "/.$HOME";
home.packages = with pkgs; [
tree
cowsay
];
}
)
] ++ config.home-manager.sharedModules;
};
in
''
# Activate Home Manager configuration for domain users
if id | egrep -o 'groups=.*' | sed 's/,/\n/g' | cut -d'(' -f2 | sed 's/)//' | egrep -o "^domain users$"; then
echo "Setting up environment for domain user"
${homeConfiguration.activationPackage}/activate
fi
''; '';
}; };
} }