From 53962e3fd7fb7d5965fd7a09c4336d0244d17c3a Mon Sep 17 00:00:00 2001 From: Trevor Vallender Date: Fri, 17 Feb 2023 11:51:36 +0000 Subject: [PATCH] Lots of changes. Whoops --- bin/update-system.bash | 2 ++ bin/update-user.bash | 2 ++ system/configuration.nix | 2 ++ users/tsv/LESS_TERMCAP | 14 ++++++++++++++ users/tsv/bash_profile | 17 +++++++++++++---- users/tsv/git/config | 3 ++- users/tsv/home.nix | 33 +++++++++++++++++++++------------ users/tsv/nvim/init.vim | 20 +++++++++++--------- 8 files changed, 67 insertions(+), 26 deletions(-) create mode 100644 users/tsv/LESS_TERMCAP diff --git a/bin/update-system.bash b/bin/update-system.bash index d6b2c48..bc0c796 100755 --- a/bin/update-system.bash +++ b/bin/update-system.bash @@ -1,4 +1,6 @@ #!/usr/bin/env bash sudo nix-channel --update +pushd ~/.my_config/bin ./apply-system.bash +popd diff --git a/bin/update-user.bash b/bin/update-user.bash index f29e4fb..1dbeb02 100755 --- a/bin/update-user.bash +++ b/bin/update-user.bash @@ -1,4 +1,6 @@ #!/usr/bin/env bash nix-channel --update +pushd ~/.my_config/bin/ ./apply-users.bash +popd diff --git a/system/configuration.nix b/system/configuration.nix index 764e5cf..c9105e4 100644 --- a/system/configuration.nix +++ b/system/configuration.nix @@ -42,6 +42,8 @@ in initialPassword = "password"; }; + nix.settings.trusted-users = [ "root" "tsv" ]; + services.xserver.enable = true; services.xserver.displayManager.sddm.enable = true; services.xserver.desktopManager.plasma5.enable = true; diff --git a/users/tsv/LESS_TERMCAP b/users/tsv/LESS_TERMCAP new file mode 100644 index 0000000..ae54bd3 --- /dev/null +++ b/users/tsv/LESS_TERMCAP @@ -0,0 +1,14 @@ +export LESS_TERMCAP_mb=$(tput bold; tput setaf 2) # green +export LESS_TERMCAP_md=$(tput bold; tput setaf 6) # cyan +export LESS_TERMCAP_me=$(tput sgr0) +export LESS_TERMCAP_so=$(tput bold; tput setaf 3; tput setab 4) # yellow on blue +export LESS_TERMCAP_se=$(tput rmso; tput sgr0) +export LESS_TERMCAP_us=$(tput smul; tput bold; tput setaf 7) # white +export LESS_TERMCAP_ue=$(tput rmul; tput sgr0) +export LESS_TERMCAP_mr=$(tput rev) +export LESS_TERMCAP_mh=$(tput dim) +export LESS_TERMCAP_ZN=$(tput ssubm) +export LESS_TERMCAP_ZV=$(tput rsubm) +export LESS_TERMCAP_ZO=$(tput ssupm) +export LESS_TERMCAP_ZW=$(tput rsupm) +export GROFF_NO_SGR=1 # For Konsole and Gnome-terminal diff --git a/users/tsv/bash_profile b/users/tsv/bash_profile index 9342fe3..2bb0f2c 100644 --- a/users/tsv/bash_profile +++ b/users/tsv/bash_profile @@ -1,21 +1,30 @@ source ~/.nix-profile/etc/profile.d/hm-session-vars.sh -HISTFILE=$XDG_CACHE_HOME/.bash_history -HISTSIZE=10000 -HISTFILESIZE=20000 PAGER="less -r" EDITOR="nvim" VISUAL="nvim" PATH=$HOME/bin:$HOME/.my_config/bin:$PATH shopt -s checkwinsize +XDG_STATE_HOME=$HOME/.state + +# Sane defaults for history +HISTFILE=$XDG_STATE_HOME/.bash_history +HISTSIZE=10000 +HISTFILESIZE=20000 +HISTCONTROL=ignoredups:erasedups # Ubuntu default is ignoreboth +shopt -s histappend # In Ubuntu this is already set by default +PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r" + shopt -s histappend alias weather="curl wttr.in/~Isle+of+Wight" alias pubip="curl -4 icanhazip.com" alias less="less -r" +[[ -f ~/.LESS_TERMCAP ]] && . ~/.LESS_TERMCAP alias checkport="sudo netstat -tnlp | grep" alias dockerpurge="docker system prune --all --force --volumes" -alias dockerkill="docker stop $(docker ps -a -q)" +alias dockerkill="docker stop `docker ps -a -q`" +alias vi="nvim" # Prompt setup GIT_PS1_SHOWDIRTYSTATE=1 diff --git a/users/tsv/git/config b/users/tsv/git/config index 37aca96..43e88fc 100644 --- a/users/tsv/git/config +++ b/users/tsv/git/config @@ -12,9 +12,10 @@ autocrlf = input safecrlf = true excludesfile = $XDG_CONFIG_HOME/git/gitignore - editor = vim + editor = nvim [alias] aa = add -A + ap = add --patch co = checkout cm = commit st = status diff --git a/users/tsv/home.nix b/users/tsv/home.nix index 56b357a..0798b0a 100644 --- a/users/tsv/home.nix +++ b/users/tsv/home.nix @@ -26,26 +26,35 @@ }; home.packages = with pkgs; [ - vimPlugins.vim-plug - firefox - git-crypt - gnupg + _1password-gui + anki + awsebcli + cachix + calibre delta # Nice diffing pager for Git docker-compose + firefox + fzf + git-crypt + gitflow + gnupg + gimp + heroku + htop + kmail + korganizer + libreoffice + ripgrep ruby_3_1 rubyPackages_3_1.dip rubyPackages_3_1.solargraph - calibre - thunderbird - anki - htop - fzf - gitflow - gimp slack spotify + thunderbird + vimPlugins.vim-plug wine winetricks + zoom-us ]; @@ -56,7 +65,7 @@ xdg.configFile."git/foxsoft_config".source = ./git/config_foxsoft; xdg.configFile."nvim/init.vim".source = ./nvim/init.vim; home.file.".ssh/config".source = ./ssh/config; - + home.file.".LESS_TERMCAP".source = ./LESS_TERMCAP; services.syncthing.enable = true; services.syncthing.tray = { enable = true; diff --git a/users/tsv/nvim/init.vim b/users/tsv/nvim/init.vim index 86a4821..c7da2e0 100644 --- a/users/tsv/nvim/init.vim +++ b/users/tsv/nvim/init.vim @@ -9,15 +9,16 @@ autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)')) \| endif call plug#begin() -Plug 'morhetz/gruvbox' -Plug 'preservim/nerdtree' -Plug 'ryanoasis/vim-devicons' -Plug 'neovim/nvim-lspconfig' -Plug 'hrsh7th/nvim-cmp' -Plug 'nvim-telescope/telescope.nvim' -Plug 'thoughtbot/vim-rspec' -Plug 'tpope/vim-rails' -Plug 'tpope/vim-endwise' + Plug 'nvim-lua/plenary.nvim' + Plug 'morhetz/gruvbox' + Plug 'preservim/nerdtree' + Plug 'ryanoasis/vim-devicons' + Plug 'neovim/nvim-lspconfig' + Plug 'hrsh7th/nvim-cmp' + Plug 'nvim-telescope/telescope.nvim' + Plug 'thoughtbot/vim-rspec' + Plug 'tpope/vim-rails' + Plug 'tpope/vim-endwise' call plug#end() set nocompatible @@ -39,6 +40,7 @@ filetype plugin indent on set clipboard=unnamedplus set cursorline +:autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red colorscheme gruvbox lua << EOF