diff options
author | Mark Nipper <nipsy@bitgnome.net> | 2024-04-18 19:28:29 -0700 |
---|---|---|
committer | Mark Nipper <nipsy@bitgnome.net> | 2024-04-18 19:28:29 -0700 |
commit | 0e741291f1ea350c398302e4b212a28f5c77840a (patch) | |
tree | fe86873dcb1168ba3e3644d7e300f6709d5b2503 /home/root | |
parent | 05c88df33274373391b25fc73a1c965a74fb8d80 (diff) | |
download | nix-0e741291f1ea350c398302e4b212a28f5c77840a.tar nix-0e741291f1ea350c398302e4b212a28f5c77840a.tar.gz nix-0e741291f1ea350c398302e4b212a28f5c77840a.tar.bz2 nix-0e741291f1ea350c398302e4b212a28f5c77840a.tar.lz nix-0e741291f1ea350c398302e4b212a28f5c77840a.tar.xz nix-0e741291f1ea350c398302e4b212a28f5c77840a.tar.zst nix-0e741291f1ea350c398302e4b212a28f5c77840a.zip |
Add root to home manager
Diffstat (limited to 'home/root')
-rw-r--r-- | home/root/common/core/bash.nix | 10 | ||||
-rw-r--r-- | home/root/common/core/default.nix | 33 | ||||
-rw-r--r-- | home/root/common/core/git.nix | 6 | ||||
-rw-r--r-- | home/root/common/core/ssh.nix | 5 | ||||
-rw-r--r-- | home/root/common/core/tmux/default.nix | 6 | ||||
-rw-r--r-- | home/root/common/core/tmux/tmux.conf | 34 | ||||
-rw-r--r-- | home/root/common/core/vim/default.nix | 6 | ||||
-rw-r--r-- | home/root/common/core/vim/vimrc | 46 | ||||
-rw-r--r-- | home/root/common/core/zsh/default.nix | 45 | ||||
-rw-r--r-- | home/root/common/core/zsh/zshrc | 110 | ||||
-rw-r--r-- | home/root/ginaz.nix | 6 | ||||
-rw-r--r-- | home/root/richese.nix | 6 |
12 files changed, 313 insertions, 0 deletions
diff --git a/home/root/common/core/bash.nix b/home/root/common/core/bash.nix new file mode 100644 index 0000000..77f0cf4 --- /dev/null +++ b/home/root/common/core/bash.nix @@ -0,0 +1,10 @@ +{ + programs.bash = { + enable = true; + enableCompletion = true; + shellAliases = { + ll = "ls -alF --color=auto"; + la = "ls -aF --color=auto"; + }; + }; +} diff --git a/home/root/common/core/default.nix b/home/root/common/core/default.nix new file mode 100644 index 0000000..2290509 --- /dev/null +++ b/home/root/common/core/default.nix @@ -0,0 +1,33 @@ +{ config, lib, pkgs, outputs, ... }: +{ + imports = [ + ./bash.nix + ./git.nix + ./ssh.nix + ./tmux + ./vim + ./zsh + ]; + + home = { + username = lib.mkDefault "root"; + homeDirectory = lib.mkDefault "/home/${config.home.username}"; + stateVersion = lib.mkDefault "23.11"; + }; + + #home.packages = builtins.attrValues { + # inherit (pkgs) + # wget + # zip; + #}; + + nix = { + package = lib.mkDefault pkgs.nix; + settings = { + experimental-features = [ "nix-command" "flakes" "repl-flake" ]; + warn-dirty = false; + }; + }; + + programs.home-manager.enable = true; +} diff --git a/home/root/common/core/git.nix b/home/root/common/core/git.nix new file mode 100644 index 0000000..49e10df --- /dev/null +++ b/home/root/common/core/git.nix @@ -0,0 +1,6 @@ +{ + programs.git = { + enable = true; + extraConfig.pull.rebase = true; + }; +} diff --git a/home/root/common/core/ssh.nix b/home/root/common/core/ssh.nix new file mode 100644 index 0000000..929cc51 --- /dev/null +++ b/home/root/common/core/ssh.nix @@ -0,0 +1,5 @@ +{ + programs.ssh = { + enable = true; + }; +} diff --git a/home/root/common/core/tmux/default.nix b/home/root/common/core/tmux/default.nix new file mode 100644 index 0000000..e7873f8 --- /dev/null +++ b/home/root/common/core/tmux/default.nix @@ -0,0 +1,6 @@ +{ + programs.tmux = { + enable = true; + extraConfig = (builtins.readFile ./tmux.conf); + }; +} diff --git a/home/root/common/core/tmux/tmux.conf b/home/root/common/core/tmux/tmux.conf new file mode 100644 index 0000000..ae43d03 --- /dev/null +++ b/home/root/common/core/tmux/tmux.conf @@ -0,0 +1,34 @@ +#set-option -ga terminal-overrides ",st-256color:Tc" +set -as terminal-features ",foot*:RGB" +set -as terminal-features ",st-256color:RGB" +set -ga monitor-bell on +set -g history-limit 100000 +set -g bell-action any +#set -g bell-on-alert on + +set -s escape-time 0 + +setw -g aggressive-resize on +setw -g wrap-search off + +bind-key a send-prefix +bind-key k kill-session +bind-key H pipe-pane -o 'cat >> ~/.tmux.log.#h-#S-#I-#P' + +#bind-key m \ +# set -g mouse on \;\ +# display 'Mouse: ON' +#bind M \ +# set -g mouse off \;\ +# display 'Mouse: OFF' + +# vim-like copypaste mode +set-window-option -g mode-keys vi +bind-key -T copy-mode-vi v send -X begin-selection +bind-key -T copy-mode-vi y send -X copy-pipe "xclip -selection clipboard" +bind-key -T copy-mode-vi C-v send -X rectangle-toggle +bind-key P run "tmux set-buffer \"$(xclip -o -selection clipboard)\"; tmux paste-buffer" + +# don't exit copy mode after selection +#set -s mouse on +#bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-selection -x diff --git a/home/root/common/core/vim/default.nix b/home/root/common/core/vim/default.nix new file mode 100644 index 0000000..ea4ed5e --- /dev/null +++ b/home/root/common/core/vim/default.nix @@ -0,0 +1,6 @@ +{ + programs.vim = { + enable = true; + extraConfig = (builtins.readFile ./vimrc); + }; +} diff --git a/home/root/common/core/vim/vimrc b/home/root/common/core/vim/vimrc new file mode 100644 index 0000000..e80231c --- /dev/null +++ b/home/root/common/core/vim/vimrc @@ -0,0 +1,46 @@ +" Handling of big files - William Natter, Tony Mechelynck and others +" fairly certain that BufSizeThreshold is in bytes +let g:SaveUndoLevels = &undolevels +let g:BufSizeThreshold = 5242880 +if has("autocmd") + au VimEnter * let g:SaveUndoLevels = &undolevels + au BufReadPre * if getfsize(expand("%")) >= g:BufSizeThreshold | setlocal noswapfile | endif + au BufEnter * if getfsize(expand("%")) < g:BufSizeThreshold | let &undolevels=g:SaveUndoLevels | else | setlocal undolevels=-1 | endif + au BufEnter * if getfsize(expand("%")) < g:BufSizeThreshold | syntax on | else | syntax off | endif +endif + +set mouse& +set noautoindent " always set autoindenting off + +" enable better 24-bit color support +"let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum" +"let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum" +set termguicolors + +" If using a dark background within the editing area and syntax highlighting +" turn on this option as well +set background=dark + +if has("autocmd") + " Enabled file type detection + " Use the default filetype settings. If you also want to load indent files + " to automatically do language-dependent indenting add 'indent' as well. + filetype plugin on + "filetype indent on +endif " has ("autocmd") + +" The following are commented out as they cause vim to behave a lot +" different from regular vi. They are highly recommended though. +set showcmd " Show (partial) command in status line. +set showmatch " Show matching brackets. +set ignorecase " Do case insensitive matching +set incsearch " Incremental search +"set expandtab " replace tabs with spaces +set smarttab " use shiftwidth instead of tabstop at start of line +set spell spelllang=en_us " turn on the spell check + +set laststatus=2 +set statusline=%<%f%h%m%r%=%{&ff}\ %Y\ %b\ 0x%B\ \ %l,%c%V\ %P + +map <F5> :w<CR><bar>:!clear;go run %<CR> +map <F6> :w<CR><bar>:%! gofmt<CR> diff --git a/home/root/common/core/zsh/default.nix b/home/root/common/core/zsh/default.nix new file mode 100644 index 0000000..77d4b75 --- /dev/null +++ b/home/root/common/core/zsh/default.nix @@ -0,0 +1,45 @@ +{ + programs.zsh = { + enable = true; + envExtra = '' +export PATH=~/bin:''${PATH} + +#export PS1="%B%n%b@%U%m%u/%l:%~> " +export PAGER=less +export EDITOR=vim +export BROWSER=firefox + +export LC_COLLATE="C" +export QUOTING_STYLE="literal" + +export IRCNICK="nipsy" +export IRCNAME="Mark Nipper" + +export NNTPSERVER="news.giganews.com" + +#export COLORTERM=truecolor +export COLORFGBG="green;blue" + +# fix stupid broken Java shit +export _JAVA_AWT_WM_NONREPARENTING=1 + +# enable pass extensions +export PASSWORD_STORE_ENABLE_EXTENSIONS=true + ''; + history = { + save = 100000; + size = 100000; + }; + initExtra = (builtins.readFile ./zshrc); + shellAliases = { + fixkeyboard = "setxkbmap -layout us -option caps:super -option compose:ralt"; + grep = "grep --color=auto"; + ip = "ip -c=auto"; + la = "ls -aFh --color=auto"; + ll = "ls -alF --color=auto"; + lock = "xscreensaver-command -lock"; + steam-no-beta = "steam -clearbeta"; + zgrep = "zgrep --color=auto"; + }; + }; +} diff --git a/home/root/common/core/zsh/zshrc b/home/root/common/core/zsh/zshrc new file mode 100644 index 0000000..cd857e3 --- /dev/null +++ b/home/root/common/core/zsh/zshrc @@ -0,0 +1,110 @@ +umask 022 + +eval $(dircolors) + +# set SWAYSOCK correctly +if pgrep -U nipsy -x sway >/dev/null; then + export SWAYSOCK=/run/user/$(id -u)/sway-ipc.$(id -u).$(pgrep -x sway).sock +fi + +# start sway by default if logging into tty1 +if [[ -z "${DISPLAY}" ]] && [[ $(tty) == "/dev/tty1" ]]; then + + export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) + + # set some Wayland specific variables + export MOZ_ENABLE_WAYLAND=1 + export GDK_BACKEND=wayland + export QT_QPA_PLATFORM=wayland + export SDL_VIDEODRIVER=wayland + export XDG_SESSION_TYPE=wayland + + exec sway > ~/.sway.log + +fi + +# if already in Wayland, update the GPG TTY so ssh-askpass will work correctly +if [[ -n "${WAYLAND_DISPLAY}" ]]; then + gpg-connect-agent updatestartuptty /bye >/dev/null +fi + +# completion options +setopt LIST_PACKED MENU_COMPLETE +# expansion and globbing options +setopt NO_NOMATCH +# history options +setopt SHARE_HISTORY EXTENDED_HISTORY HIST_FCNTL_LOCK HIST_IGNORE_ALL_DUPS HIST_REDUCE_BLANKS HIST_SAVE_NO_DUPS +# input/output options +setopt PRINT_EXIT_VALUE RM_STAR_SILENT +# job control options +setopt LONG_LIST_JOBS NO_HUP +# zle options +setopt NO_BEEP + +zstyle ':completion:*' menu select=5 + +bindkey -v +export KEYTIMEOUT=1 + +autoload -U edit-command-line +zle -N edit-command-line +bindkey -M vicmd v edit-command-line + +# always open tmux if interactive +[[ $- != *i* ]] && return +#[[ -z "$TMUX" ]] && (tmux -2 new-session -t default \; new-window || tmux -2 new-session -s default) +[[ -z "$TMUX" ]] && (tmux -2 attach -t default || tmux -2 new-session -s default) + +# prompt/theme shit +function precmd { + + local RC=${?} + #local RC=${(%)RC-%?} + + print -nP '\n' + + # current user + if [[ ${EUID} -eq 0 ]]; then + print -nP '%{%S%F{red}%}%n%{%f%s%}' + else + print -nP '%{%F{magenta}%}%n%{%f%}' + fi + + print -nP '@' + + # current host + if [[ -n "$SSH_CLIENT" || -n "$SSH2_CLIENT" ]]; then + print -nP '%{%F{yellow}%}%m%{%f%}' + else + print -nP '%{%F{green}%}%m%{%f%}' + fi + + # connected terminal + print -nP '/%{%U%}%l%{%u%} ' + + # cwd + print -nP '%{%F{cyan}%}%~%{%f%} ' + + # job count + JOBCOUNT='%j' + if [[ ${(%)JOBCOUNT} -gt 0 ]]; then + print -nP 'j=%{%F{yellow}%}%j%{%f%} ' + fi + + # previous return code + if [[ ${RC} -ne 0 ]]; then + print -nP 'rc=%{%F{red}%}' + echo -n "${RC}" + print -nP '%{%f%} ' + else + print -nP 'rc=%{%F{green}%}' + echo -n "${RC}" + print -nP '%{%f%} ' + fi + + # time stamp + print -P '%{%F{cyan}%}%D{%FT%T%z}%{%f%}' + +} + +PS1='%# ' diff --git a/home/root/ginaz.nix b/home/root/ginaz.nix new file mode 100644 index 0000000..83c92cd --- /dev/null +++ b/home/root/ginaz.nix @@ -0,0 +1,6 @@ +{ inputs, lib, pkgs, config, outputs, ... }: +{ + imports = [ + common/core + ]; +} diff --git a/home/root/richese.nix b/home/root/richese.nix new file mode 100644 index 0000000..83c92cd --- /dev/null +++ b/home/root/richese.nix @@ -0,0 +1,6 @@ +{ inputs, lib, pkgs, config, outputs, ... }: +{ + imports = [ + common/core + ]; +} |