Litenet-Nix-Infra/modules/users/Rory.nix
2024-07-19 03:31:44 +00:00

191 lines
5.8 KiB
Nix
Executable file

{ config, lib, pkgs, home-manager, ... }:
{
users.users.Rory = {
isNormalUser = true;
extraGroups = [ "wheel" "libvirtd" "ocp" ];
packages = with pkgs; [
lnav
age
git
lsd
duf
btop
htop
kitty.terminfo
tmux
jq
dig
# - zsh
zsh
zsh-powerlevel10k
zsh-nix-shell
zsh-you-should-use
zsh-syntax-highlighting
zsh-completions
];
openssh.authorizedKeys.keys = [
#"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICT+53Hy3wbIlNVIomK2RroaimMWrTlUkndjHt1dFuyh root@pfSense-arcane-home.localdomain"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILF2IuNu//0DP/wKMuDvBgVT3YBS2uULsipbdrhJCTM7 thearcanebrony@tab-linux-desktop"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN/kNkY/E5b6rvCQLMaSbpLQ/xoyywIwVVu9uo2j/B6p Rory@RoryNix"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJPRTuz83dVThuDVXhDz3w3uYBGJ+JPzdZFT6wvhQXQ3 Rory@Rory-wsl" # work laptop
];
useDefaultShell = true;
shell = pkgs.zsh;
};
programs.zsh.enable = true;
environment.shells = with pkgs; [ zsh ];
home-manager.users.Rory = {
programs = {
git = {
enable = true;
userName = "Rory&";
userEmail = "root@rory.gay";
extraConfig = {
safe = {
directory = "/";
};
};
};
zsh = {
enable = true;
enableAutosuggestions = true;
enableVteIntegration = true;
autocd = true;
initExtraFirst = ''
export EDITOR=nvim
export SYSTEMD_EDITOR=$EDITOR
export GIT_EDITOR=$EDITOR
export QT_QPA_PLATFORMTHEME=xdgdesktopportal
export GTK_USE_PORTAL=1
export _JAVA_AWT_WM_NONREPARENTING=1
export WINEDEBUG=-all
export DOTPROFILE_LOADED='yes'
export CHOKIDAR_USEPOLLING=true
export MSBUILDLIVELOGGER=auto
export DOTNET_WATCH_SUPPRESS_LAUNCH_BROWSER=1
export DOTNET_CLI_TELEMETRY_OPTOUT=1
function mkkey() {
echo "Making key for $1"
ssh-keygen -t ed25519 -C "$HOST -> $1" -f ~/.ssh/id_ed25519_$1
(
echo "Host $1"
echo " IdentityFile ~/.ssh/id_ed25519_$1"
) >> ~/.ssh/config
echo 'Done! Public key:'
cat ~/.ssh/id_ed25519_$1.pub
}
export DISABLE_AUTO_UPDATE=true
COMPLETION_WAITING_DOTS="true"
'';
initExtra = ''
alias mv='mv -v'
alias pre='npx prettier -w'
alias git-commit='git commit --signoff --sign'
alias npm='NODE_OPTIONS=--openssl-legacy-provider npm'
alias npx='NODE_OPTIONS=--openssl-legacy-provider npx'
alias yarn='NODE_OPTIONS=--openssl-legacy-provider npx -y yarn --use-yarnrc $XDG_CONFIG_HOME/yarn/config'
alias node='NODE_OPTIONS=--openssl-legacy-provider node'
# - dotnet
alias drun='dotnet watch run --no-hot-reload --property WarningLevel=0'
alias dbuild='dotnet watch build --no-hot-reload --property WarningLevel=0'
alias ls='lsd -lA --color=always --icon=always'
alias transfetch='neofetch --kitty ~/trans_witch.jpg'
alias gc='git-commit'
[ -f "$HOME/.profile" ] && . $HOME/.profile
'';
#alias knconfig='cp .config ../$(date ''+%Y%m%d_%k%M%S\'').config -v; make CC=clang LLVM=1 nconfig'
oh-my-zsh = {
enable = true;
plugins = [
"git"
"sudo"
];
};
plugins = [
{
name = "powerlevel10k";
src = pkgs.zsh-powerlevel10k;
file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
}
{
name = "powerlevel10k-config";
src = lib.cleanSource ./Rory;
file = "p10k.zsh";
}
{
name = "zsh-syntax-highlighting";
src = pkgs.zsh-syntax-highlighting;
file = "share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh";
}
{
name = "zsh-autosuggestions";
src = pkgs.zsh-autosuggestions;
file = "share/zsh-autosuggestions/zsh-autosuggestions.zsh";
}
];
localVariables = {
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS = [
"os_icon"
"dir"
"vcs"
"prompt_char"
];
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS = [
"status"
"command_execution_time"
"background_jobs"
"direnv"
"virtualenv"
"pyenv"
"nodeenv"
"context"
"nix_shell"
"vi_mode"
"load"
"disk_usage"
"ram"
];
POWERLEVEL9K_MODE = "nerdfont-complete";
POWERLEVEL9K_ICON_PADDING = "none";
POWERLEVEL9K_PROMPT_ADD_NEWLINE = "false";
POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR = "\uE0B1";
POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR = "\uE0B3";
POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR = "\uE0B0";
POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR = "\uE0B2";
POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL = "\uE0B0";
POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL = "\uE0B2";
POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE = true;
};
};
neovim = {
defaultEditor = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
coc = {
enable = true;
};
};
};
programs.neovim.plugins = with pkgs.vimPlugins; [
pkgs.vimPlugins.nvim-tree-lua
{
plugin = pkgs.vimPlugins.vim-startify;
config = "let g:startify_change_to_vcs_root = 0";
}
];
home.stateVersion = "22.11";
};
}