added starship to sma user
This commit is contained in:
parent
2a25c42063
commit
2276dd59cd
1 changed files with 46 additions and 27 deletions
|
@ -1,23 +1,25 @@
|
|||
# Admin User Configuration - sma
|
||||
# Named after Diziet Sma, pragmatic Special Circumstances agent
|
||||
# Role: System administration, security oversight, maintenance
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
users.users.sma = {
|
||||
description = "Diziet Sma - System Administrator";
|
||||
isNormalUser = true;
|
||||
uid = 1001; # Fixed UID for consistency across machines
|
||||
group = "sma"; # Primary group
|
||||
uid = 1001; # Fixed UID for consistency across machines
|
||||
group = "sma"; # Primary group
|
||||
|
||||
# Admin privileges
|
||||
extraGroups = [
|
||||
"wheel" # sudo access
|
||||
"wheel" # sudo access
|
||||
"networkmanager" # network management
|
||||
"libvirt" # virtualization management
|
||||
"incus-admin" # container management
|
||||
"podman" # container runtime
|
||||
"docker" # docker compatibility (if needed)
|
||||
"libvirt" # virtualization management
|
||||
"incus-admin" # container management
|
||||
"podman" # container runtime
|
||||
"docker" # docker compatibility (if needed)
|
||||
];
|
||||
|
||||
# Security-focused shell setup
|
||||
|
@ -97,16 +99,33 @@
|
|||
"audit-users" = "cat /etc/passwd | grep -E '/bin/(bash|zsh|fish)'";
|
||||
"audit-sudo" = "cat /etc/sudoers.d/*";
|
||||
};
|
||||
interactiveShellInit = ''
|
||||
# Emacs-style keybindings
|
||||
bindkey -e
|
||||
|
||||
# Disable annoying shell options
|
||||
unsetopt beep nomatch
|
||||
|
||||
# Completion configuration
|
||||
zstyle ':completion:*' completer _expand _complete _ignored
|
||||
zstyle ':completion:*' matcher-list ""
|
||||
autoload -Uz compinit
|
||||
compinit
|
||||
|
||||
# Initialize shell enhancements
|
||||
eval "$(starship init zsh)"
|
||||
eval "$(direnv hook zsh)"
|
||||
'';
|
||||
};
|
||||
|
||||
# Sudo configuration for admin user
|
||||
security.sudo.extraRules = [
|
||||
{
|
||||
users = [ "sma" ];
|
||||
users = ["sma"];
|
||||
commands = [
|
||||
{
|
||||
command = "ALL";
|
||||
options = [ "NOPASSWD" ]; # Allow passwordless sudo for admin tasks
|
||||
options = ["NOPASSWD"]; # Allow passwordless sudo for admin tasks
|
||||
}
|
||||
];
|
||||
}
|
||||
|
@ -120,6 +139,6 @@
|
|||
|
||||
# Create the sma group
|
||||
users.groups.sma = {
|
||||
gid = 992; # Fixed GID for consistency across machines
|
||||
gid = 992; # Fixed GID for consistency across machines
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue