moudlar
This commit is contained in:
24
system-modules/users.nix
Normal file
24
system-modules/users.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
{ config, pkgs, lib, system, user, allowed, secrets, ... }:
|
||||
|
||||
{
|
||||
users.defaultUserShell = pkgs.bash; # if interactive, itll switch to fish
|
||||
|
||||
users.users.nx2 = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "networkmanager" "wheel" "audio" "video" "docker" "libvirtd" "uinput" ];
|
||||
useDefaultShell = true;
|
||||
packages = with pkgs; []; # all in home.nix
|
||||
};
|
||||
|
||||
programs = {
|
||||
bash = {
|
||||
interactiveShellInit = ''
|
||||
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
|
||||
then
|
||||
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
|
||||
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
|
||||
fi
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user