Make root a little more like me

This commit is contained in:
Daniel Flanagan 2024-07-30 17:02:42 -05:00
parent 0009ed8b19
commit 8f09dd06b0
4 changed files with 32 additions and 2 deletions

View file

@ -1315,6 +1315,7 @@
programs.zellij = {
# uses home manager's toKDL generator
enable = true;
# This causes fish to start zellij immediately
# enableFishIntegration = true;
settings = {
pane_frames = false;

View file

@ -21,12 +21,17 @@ function preprocess_pwd
| gawk '{n=split($0,p,"/");for(i=1;i<=n;i++){if(i==n){printf "/%s",p[i]}else{printf "/%.3s",p[i]}}}'
end
function _maybe_sudo_prefix
function _maybe_elevated_access_prefix
if set -q SUDO_USER
set_color -b yellow black
printf " SUDO "
set_color -b normal normal
printf " "
else if test $USER = root
set_color -b red black
printf " ROOT "
set_color -b normal normal
printf " "
end
end
@ -111,7 +116,7 @@ function fish_prompt
set last_cmd_status $status
_prompt_marker
_prompt_prefix
_maybe_sudo_prefix
_maybe_elevated_access_prefix
_user_and_host $last_cmd_status
_cur_work_dir
_maybe_git_summary

View file

@ -783,6 +783,28 @@
# networking.firewall.allowedTCPPortRanges = [ { from = 27036; to = 27037; } ];
};
root = {
pkgs,
lib,
...
}: {
users.users.root = {
home = "/root";
createHome = true;
openssh.authorizedKeys.keys = [pubkey];
shell = lib.mkForce pkgs.fish;
};
home-manager.users.root = {
imports = [homeManagerModules.common];
home = {
username = "root";
homeDirectory = "/root";
stateVersion = pkgs.lib.mkDefault "24.05";
};
};
};
daniel = {pkgs, ...}: let
username = "daniel";
in {
@ -887,6 +909,7 @@
mosh
daniel
root
];
programs.gnupg.agent = {

View file

@ -765,6 +765,7 @@ sudo nix run nixpkgs#ipmitool -- raw 0x30 0x30 0x02 0xff 0x00
"podman"
"nix:docker://git.lyte.dev/lytedev/nix:latest"
"beefcake:host"
"nixos-host:host"
];
tokenFile = config.sops.secrets."forgejo-runner.env".path;
hostPackages = with pkgs; [