42 lines
959 B
Nix
Executable File
42 lines
959 B
Nix
Executable File
{ pkgs, user, ... }:
|
|
|
|
{
|
|
users.defaultUserShell = pkgs.bash; # if interactive, itll switch to fish
|
|
|
|
users.users."${user}" = {
|
|
isNormalUser = true;
|
|
extraGroups = [
|
|
"networkmanager"
|
|
"wheel"
|
|
"audio"
|
|
"video"
|
|
"docker"
|
|
"libvirtd"
|
|
"uinput"
|
|
"input"
|
|
"ydotool"
|
|
"acme"
|
|
"nginx"
|
|
"adbusers"
|
|
"gitea"
|
|
"postgres"
|
|
];
|
|
useDefaultShell = true;
|
|
openssh.authorizedKeys.keys = [
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID1RPCcS8DtIf75a2FEW4d8X6WTVeLlmretoLqppvZlJ" # From [A] GPG Sub Key
|
|
];
|
|
};
|
|
|
|
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
|
|
'';
|
|
};
|
|
};
|
|
}
|