Added initial homeConfiguration for domain users
This commit is contained in:
parent
739e335c28
commit
c683809a78
@ -127,9 +127,32 @@ in
|
||||
# Set up home directory
|
||||
security.pam.services.login.makeHomeDir = true;
|
||||
security.pam.services.sshd.makeHomeDir = true;
|
||||
environment.loginShellInit = ''
|
||||
echo "TEST"
|
||||
groups
|
||||
environment.loginShellInit =
|
||||
let
|
||||
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
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user