{ config, lib, pkgs, ... }: with lib; let git-plan = pkgs.buildGoPackage rec { name = "git-plan"; version = "0"; goPackagePath = "gitlab.com/haaksmash/git-plan"; src = pkgs.fetchFromGitLab { owner = "haaksmash"; repo = "git-plan"; rev = "89909ff0f5b59fa2b8104abb03198675e5ccc068"; sha256 = "1viahx5cls59g08ni767qf0zmsimdz1wi6k4723ckkcn0hcwn3mv"; }; goDeps = ./git-plan.nix; }; in { home.packages = with pkgs; [ direnv git-plan htop jq keybase lastpass-cli nox tree ranger ripgrep zsh-autosuggestions zsh-history-substring-search zsh-syntax-highlighting ]; programs.direnv = { enable = true; stdlib = '' layout_postgres() { export PGDATA="$(direnv_layout_dir)/tmp/pgdata" export PGHOST="$PGDATA" if [[ ! -d "$PGDATA" ]]; then initdb --locale=$LANG cat <>"$PGDATA/postgresql.conf" listen_addresses = 'localhost' unix_socket_directories = '$PGHOST' EOF echo "CREATE DATABASE $USER;" | postgres --single -E postgres fi } layout_go() { export GOPATH="$(direnv_layout_dir)/tmp/golibs" if [[ ! -d "$GOPATH" ]]; then mkdir -p $GOPATH fi export PATH="$GOPATH/bin:$PATH" } ''; }; programs.command-not-found.enable = true; programs.git = { enable = true; userName = "Haak Saxberg"; userEmail = "haak.erling@gmail.com"; ignores = [ ".idea/" ".direnv/" ".envrc" ".tools-info" "*~" "*.swp" ]; }; programs.zsh = { enable = true; enableCompletion = true; defaultKeymap = "viins"; initExtra = mkForce ('' export LOCALE_ARCHIVE="/usr/lib/locale/locale-archive" export NIX_PATH=$HOME/.nix-defexpr/channels:$NIX_PATH export EDITOR=vim source $HOME/.nix-profile/etc/profile.d/nix.sh source $HOME/.nix-profile/share/fzf/key-bindings.zsh source $HOME/.nix-profile/share/fzf/completion.zsh source $HOME/.nix-profile/share/zsh-autosuggestions/zsh-autosuggestions.zsh source $HOME/.nix-profile/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh source $HOME/.config/zsh/local.zsh bindkey '^[[A' history-substring-search-up bindkey '^[[B' history-substring-search-down bindkey -M viins 'jj' vi-cmd-mode eval "$(direnv hook zsh)" ''); oh-my-zsh = { enable = true; theme = "bureau"; plugins = [ "vi-mode" "git" "z" "nix-shell" "tmuxinator" ]; }; }; programs.neovim = { enable = true; vimAlias = true; withPython = true; plugins = with pkgs.vimPlugins; [ vim-sensible vim-startify vim-javascript vim-ruby vim-nix vim-elixir alchemist-vim haskell-vim vim-markdown vimtex vim-airline rainbow vim-signify vim-indent-guides vim-surround fugitive easymotion tagbar vinegar undotree vim-test ale fzf-vim fzfWrapper LanguageClient-neovim deoplete-nvim papercolor-theme { elm-vim-syntax = pkgs.vimUtils.buildVimPlugin { name = "elm-vim-syntax"; src = pkgs.fetchFromGitHub { owner = "andys8"; repo = "vim-elm-syntax"; rev = "d614325a037982489574012e4db04d7f8f134c17"; sha256 = "1wjv4z5wikh9kzgklg1b4rwsjwqnmvzppqs4hsqx3pyv8g0khdk1"; }; }; }.elm-vim-syntax ]; extraConfig = '' filetype plugin indent on " ALE let g:ale_fix_on_save = 1 " Easymotion map / (easymotion-sn) omap / (easymotion-tn) map n (easymotion-next) map N (easymotion-prev) let g:EasyMotion_landing_highlight = 0 " Rainbow parentheses let g:rainbow_conf = { \ 'guifgs': ['RoyalBlue3', 'SeaGreen3', 'DarkOrchid3', 'firebrick3', 'RoyalBlue3', 'SeaGreen3', 'DarkOrchid3', 'firebrick3', 'RoyalBlue3', 'DarkOrchid3', 'firebrick3', 'RoyalBlue3', 'SeaGreen3', 'DarkOrchid3', 'firebrick3'], \ 'ctermfgs': ['red', 'brown', 'blue', 'gray', 'green', 'magenta', 'cyan', 'darkred', 'brown', 'darkblue', 'gray', 'darkgreen', 'darkmagenta', 'darkcyan', 'red'], \ 'parentheses': ['start=/(/ end=/)/ fold', 'start=/\[/ end=/\]/ fold', 'start=/{/ end=/}/ fold'] \} let g:rainbow_active = 1 " Vim-Test nmap t :TestNearest nmap T :TestFile nmap a :TestSuite nmap l :TestLast nmap g :TestVisit let test#strategy = "neovim" " Deoplete let g:deoplete#enable_at_startup = 1 " LanguageClient-neovim let g:LanguageClient_serverCommands = { \ 'elm': ['elm-language-server', '--stdio'], \ } let g:LanguageClient_rootMarkers = { \ 'elm': ['elm.json'], \ } let g:LanguageClient_loggingFile = expand('~/.local/share/nvim/LanguageClient.log') " Indent guides let g:indent_guides_enable_on_vim_startup = 1 let g:indent_guides_start_level = 2 " let netrw look like NERDTree let g:netrw_liststyle = 3 let mapleader="," set nobackup set noswapfile set pastetoggle= set nowrap set background=dark colorscheme PaperColor set nocompatible set number relativenumber set numberwidth=1 set cursorline set cursorcolumn set ruler set list set listchars=tab:>-,trail:-,extends:>,precedes:<,nbsp:+,eol:$ set matchpairs+=<:> set ts=2 set shiftwidth=2 set expandtab " Open new split panes to right and bottom, which feels more natural set splitbelow set splitright """ Searching and Patterns set ignorecase set smartcase set smarttab set hlsearch " Add the g flag to search/replace by default set gdefault "recalculate the trailing whitespace warning when idle, and after saving autocmd cursorhold,bufwritepost * unlet! b:statusline_trailing_space_warning " strip trailing whitespace autocmd BufWritePre * :%s/\s\+$//e """ Handy remaps noremap ; : inoremap jj map V :source ~/.config/nvim/init.vim:filetype detect:exe ":echo 'vimrc reloaded'" map \q :q map \w :w noremap Q """ Terminal mode remaps tnoremap nnoremap o :below 10sp term://$SHELLi " Quicker window movement nnoremap j nnoremap k nnoremap h nnoremap l " Don’t reset cursor to start of line when moving around. set nostartofline " minimal number of lines to keep above/below cursorline set scrolloff=10 " Local overrides? if filereadable($HOME . "/.vimrc.local") source ~/.vimrc.local endif ''; }; programs.tmux = { enable = true; tmuxinator = { enable = true; }; }; programs.fzf = { enable = true; enableZshIntegration = true; defaultCommand = "rg --no-ignore --follow --files --hidden --smart-case --glob \\\"!.git/*\\\""; }; # Let Home Manager install and manage itself. programs.home-manager.enable = true; home.file.".tmux.conf" = { source = ./tmux/tmux.conf; }; }