Make root a little more like me
This commit is contained in:
parent
0009ed8b19
commit
8f09dd06b0
4 changed files with 32 additions and 2 deletions
|
@ -1315,6 +1315,7 @@
|
||||||
programs.zellij = {
|
programs.zellij = {
|
||||||
# uses home manager's toKDL generator
|
# uses home manager's toKDL generator
|
||||||
enable = true;
|
enable = true;
|
||||||
|
# This causes fish to start zellij immediately
|
||||||
# enableFishIntegration = true;
|
# enableFishIntegration = true;
|
||||||
settings = {
|
settings = {
|
||||||
pane_frames = false;
|
pane_frames = false;
|
||||||
|
|
|
@ -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]}}}'
|
| gawk '{n=split($0,p,"/");for(i=1;i<=n;i++){if(i==n){printf "/%s",p[i]}else{printf "/%.3s",p[i]}}}'
|
||||||
end
|
end
|
||||||
|
|
||||||
function _maybe_sudo_prefix
|
function _maybe_elevated_access_prefix
|
||||||
if set -q SUDO_USER
|
if set -q SUDO_USER
|
||||||
set_color -b yellow black
|
set_color -b yellow black
|
||||||
printf " SUDO "
|
printf " SUDO "
|
||||||
set_color -b normal normal
|
set_color -b normal normal
|
||||||
printf " "
|
printf " "
|
||||||
|
else if test $USER = root
|
||||||
|
set_color -b red black
|
||||||
|
printf " ROOT "
|
||||||
|
set_color -b normal normal
|
||||||
|
printf " "
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -111,7 +116,7 @@ function fish_prompt
|
||||||
set last_cmd_status $status
|
set last_cmd_status $status
|
||||||
_prompt_marker
|
_prompt_marker
|
||||||
_prompt_prefix
|
_prompt_prefix
|
||||||
_maybe_sudo_prefix
|
_maybe_elevated_access_prefix
|
||||||
_user_and_host $last_cmd_status
|
_user_and_host $last_cmd_status
|
||||||
_cur_work_dir
|
_cur_work_dir
|
||||||
_maybe_git_summary
|
_maybe_git_summary
|
||||||
|
|
|
@ -783,6 +783,28 @@
|
||||||
# networking.firewall.allowedTCPPortRanges = [ { from = 27036; to = 27037; } ];
|
# 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
|
daniel = {pkgs, ...}: let
|
||||||
username = "daniel";
|
username = "daniel";
|
||||||
in {
|
in {
|
||||||
|
@ -887,6 +909,7 @@
|
||||||
mosh
|
mosh
|
||||||
|
|
||||||
daniel
|
daniel
|
||||||
|
root
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.gnupg.agent = {
|
programs.gnupg.agent = {
|
||||||
|
|
|
@ -765,6 +765,7 @@ sudo nix run nixpkgs#ipmitool -- raw 0x30 0x30 0x02 0xff 0x00
|
||||||
"podman"
|
"podman"
|
||||||
"nix:docker://git.lyte.dev/lytedev/nix:latest"
|
"nix:docker://git.lyte.dev/lytedev/nix:latest"
|
||||||
"beefcake:host"
|
"beefcake:host"
|
||||||
|
"nixos-host:host"
|
||||||
];
|
];
|
||||||
tokenFile = config.sops.secrets."forgejo-runner.env".path;
|
tokenFile = config.sops.secrets."forgejo-runner.env".path;
|
||||||
hostPackages = with pkgs; [
|
hostPackages = with pkgs; [
|
||||||
|
|
Loading…
Reference in a new issue