Personal Nix setup
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Initial Commit

Phil Pluckthun 4af18e78

+931
+17
.editorconfig
··· 1 + # http://editorconfig.org 2 + root = true 3 + 4 + [*] 5 + charset = utf-8 6 + indent_size = 2 7 + end_of_line = lf 8 + indent_style = space 9 + insert_final_newline = true 10 + trim_trailing_whitespace = true 11 + 12 + [*.md] 13 + max_line_length = 100 14 + trim_trailing_whitespace = false 15 + 16 + [COMMIT_EDITMSG] 17 + max_line_length = 0
+17
.gitmodules
··· 1 + [submodule "channels/nixpkgs"] 2 + path = channels/nixpkgs 3 + url = https://github.com/NixOS/nixpkgs-channels.git 4 + branch = nixpkgs-unstable 5 + shallow = true 6 + [submodule "channels/darwin"] 7 + path = channels/darwin 8 + url = https://github.com/LnL7/nix-darwin.git 9 + branch = master 10 + [submodule "channels/home-manager"] 11 + path = channels/home-manager 12 + url = https://github.com/rycee/home-manager.git 13 + branch = master 14 + [submodule "channels/nixpkgs-unstable"] 15 + path = channels/nixpkgs-unstable 16 + url = https://github.com/NixOS/nixpkgs.git 17 + shallow = true
+1
channels/binary-caches/nixpkgs
··· 1 + https://cache.nixos.org
+14
channels/default.nix
··· 1 + rec { 2 + __nixPath = [ 3 + { prefix = "binary-caches"; path = ./binary-caches; } 4 + { prefix = "darwin"; path = ./darwin; } 5 + { prefix = "darwin-config"; path = ../configuration.nix; } 6 + { prefix = "home-manager"; path = ./home-manager; } 7 + { prefix = "nixos"; path = ./nixpkgs; } 8 + { prefix = "nixos-config"; path = ../configuration.nix; } 9 + { prefix = "nixpkgs"; path = ./nixpkgs; } 10 + { prefix = "nixpkgs-unstable"; path = ./nixpkgs-unstable; } 11 + ]; 12 + 13 + nixPath = map ({ prefix, path }: "${prefix}=${__replaceStrings [ "/mnt/" ] [ "/" ] (toString path)}") __nixPath; 14 + }
+17
config/gpg.nix
··· 1 + { lib, pkgs, ... }: 2 + 3 + let 4 + inherit (lib) optionalAttrs mkMerge; 5 + inherit (lib.systems.elaborate { system = builtins.currentSystem; }) isLinux isDarwin; 6 + in { 7 + environment.systemPackages = [ 8 + pkgs.gnupg 9 + ]; 10 + 11 + programs.gnupg = { 12 + agent = { 13 + enable = true; 14 + enableSSHSupport = true; 15 + }; 16 + }; 17 + }
+7
config/home/default.nix
··· 1 + { 2 + imports = [ 3 + ./git.nix 4 + ./zsh.nix 5 + ./tmux.nix 6 + ]; 7 + }
+57
config/home/git.nix
··· 1 + { 2 + programs.git = { 3 + enable = true; 4 + userName = "Phil Pluckthun"; 5 + userEmail = "phil@kitten.sh"; 6 + 7 + signing = { 8 + signByDefault = true; 9 + key = "303B6A9A312AA035"; 10 + }; 11 + 12 + ignores = [ 13 + ".DS_Store" 14 + "*.sw[nop]" 15 + "*.undodir" 16 + ".env" 17 + "*.orig" 18 + ]; 19 + 20 + lfs = { 21 + enable = true; 22 + }; 23 + 24 + aliases = { 25 + s = "status -s"; 26 + last = "log -1"; 27 + lol = "log --oneline"; 28 + recommit = "commit -a --amend --no-edit"; 29 + pushf = "push --force-with-lease"; 30 + glog = "log --oneline --decorate --all --graph"; 31 + }; 32 + 33 + delta = { 34 + enable = true; 35 + options = [ 36 + "--tabs=2" 37 + "--theme=base16" 38 + ]; 39 + }; 40 + 41 + extraConfig = { 42 + status.showUntrackedFiles = "all"; 43 + push.default = "simple"; 44 + color.ui = "auto"; 45 + pull.rebase = true; 46 + fetch.prune = true; 47 + diff.tool = "vimdiff"; 48 + diff.sunmodule = "log"; 49 + diff.compactionHeuristic = true; 50 + merge.ff = "only"; 51 + merge.tool = "vimdiff"; 52 + difftool.prompt = false; 53 + mergetool.prompt = true; 54 + "mergetool \"vimdiff\"".cmd = "nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'"; 55 + }; 56 + }; 57 + }
+80
config/home/tmux.nix
··· 1 + { lib, pkgs, ... }: 2 + 3 + let 4 + inherit (lib.systems.elaborate { system = builtins.currentSystem; }) isLinux; 5 + 6 + defaultActiveColor = "yellow"; 7 + defaultInactiveColor = "colour241"; 8 + defaultFeatureColor = "colour14"; 9 + defaultBorderColor = "colour10"; 10 + in { 11 + programs.tmux = { 12 + enable = true; 13 + aggressiveResize = true; 14 + baseIndex = 1; 15 + escapeTime = 0; 16 + historyLimit = 5000; 17 + keyMode = "vi"; 18 + shortcut = "a"; 19 + terminal = "xterm-256color"; 20 + 21 + secureSocket = isLinux; 22 + 23 + plugins = [ ]; 24 + 25 + extraConfig = '' 26 + set -g mouse on 27 + 28 + set -g status-left-length 32 29 + set -g status-right-length 150 30 + set -g status-interval 5 31 + 32 + set-option -ga terminal-overrides ",xterm-256color*:Tc:smso" 33 + 34 + set-option -g status-style fg=${defaultActiveColor},bg=default 35 + 36 + set-window-option -g window-status-style fg=${defaultInactiveColor},bg=default 37 + 38 + set-window-option -g window-status-current-style fg=${defaultActiveColor},bg=default 39 + set-window-option -g window-status-current-format "#[bold]#I #W" 40 + set-option -g pane-border-style fg=${defaultInactiveColor} 41 + set-option -g pane-active-border-style fg=${defaultBorderColor} 42 + set-option -g message-style fg=${defaultActiveColor},bg=default 43 + set-option -g display-panes-active-colour ${defaultActiveColor} 44 + set-option -g display-panes-colour ${defaultInactiveColor} 45 + 46 + set-window-option -g clock-mode-colour ${defaultActiveColor} 47 + 48 + set -g window-status-format "#I #W" 49 + 50 + set -g status-left "#[fg=${defaultFeatureColor},bold]#S " 51 + set -g status-right "#[fg=${defaultInactiveColor}] %R %d %b" 52 + 53 + set -g pane-border-style fg=colour238,bg=colour238 54 + set -g pane-active-border-style fg=colour238,bg=colour238 55 + 56 + unbind C-p 57 + bind C-p paste-buffer 58 + 59 + bind -n C-h select-pane -L 60 + bind -n C-j select-pane -D 61 + bind -n C-k select-pane -U 62 + bind -n C-l select-pane -R 63 + 64 + bind -r h resize-pane -L 2 65 + bind -r j resize-pane -D 2 66 + bind -r k resize-pane -U 2 67 + bind -r l resize-pane -R 2 68 + 69 + bind b kill-pane 70 + ''; 71 + }; 72 + 73 + programs.zsh.shellAliases = { 74 + ta = "tmux attach -t"; 75 + ts = "tmux new-session -s"; 76 + tl = "tmux list-sessions"; 77 + tksv = "tmux kill-server"; 78 + tkss = "tmux kill-session -t"; 79 + }; 80 + }
+23
config/home/zsh.nix
··· 1 + { 2 + programs.zsh = { 3 + enable = true; 4 + enableAutosuggestions = true; 5 + 6 + shellAliases = { 7 + ls = "ls --color=auto"; 8 + ll = "ls -l"; 9 + }; 10 + }; 11 + 12 + programs.starship = { 13 + enable = true; 14 + enableZshIntegration = true; 15 + 16 + settings = { 17 + add_newline = false; 18 + character.symbol = "➜"; 19 + aws.disabled = true; 20 + cmd_duration.disabled = true; 21 + }; 22 + }; 23 + }
+16
config/nodejs.nix
··· 1 + { cfg, pkgs, pkgs-unstable, ... }: 2 + 3 + { 4 + environment.systemPackages = 5 + (with pkgs-unstable; 6 + let nodejs = nodejs-14_x; 7 + in [ 8 + nodejs 9 + (yarn.override { inherit nodejs; }) 10 + ] 11 + ); 12 + 13 + environment.interactiveShellInit = '' 14 + export PATH=$HOME/.yarn/bin:$PATH 15 + ''; 16 + }
+112
config/nvim/basic.vim
··· 1 + " Set default shell 2 + set shell=/bin/bash 3 + 4 + set hidden 5 + 6 + " Encoding 7 + set encoding=utf8 8 + 9 + " Indentation 10 + filetype plugin indent off 11 + set autoindent 12 + set nosmartindent 13 + set ts=2 14 + set shiftwidth=2 15 + set expandtab 16 + 17 + " Max Width 18 + set textwidth=0 19 + 20 + " Lazy redraw for e.g. macros 21 + set lazyredraw 22 + 23 + " Lower default updatetime 24 + set updatetime=300 25 + 26 + " No wrapping except onmarkdown and html 27 + set nowrap 28 + autocmd FileType markdown setlocal wrap 29 + autocmd FileType html setlocal wrap 30 + 31 + " Make backspace usable 32 + set backspace=indent,eol,start 33 + 34 + " Show matching brackets 35 + set showmatch 36 + 37 + " Searching 38 + set ignorecase 39 + set hlsearch 40 + set incsearch 41 + 42 + " Smartcaps 43 + set smartcase 44 + 45 + " Statusbar 46 + set ruler 47 + set laststatus=2 48 + set statusline=%F%m%r%h%w\ [%l,%c]\ [%L,%p%%] 49 + 50 + " Scrolling 51 + set scrolloff=2 52 + 53 + " No code folding 54 + set nofoldenable 55 + 56 + " No Backup 57 + set nobackup 58 + set nowritebackup 59 + set nowb 60 + set noswapfile 61 + 62 + " Line numbers 63 + set number 64 + 65 + " Open new split panes to right and bottom, which feels more natural 66 + set splitbelow 67 + set splitright 68 + 69 + " Always use vertical diffs 70 + set diffopt+=vertical 71 + 72 + " Italics support 73 + set t_ZH=^[[3m 74 + set t_ZR=^[[23m 75 + 76 + " Fold by indentation 77 + set foldenable 78 + set foldmethod=indent 79 + set foldnestmax=9 80 + set foldlevelstart=3 81 + 82 + set shortmess+=I 83 + set shortmess+=c 84 + 85 + " Persist undo history 86 + if has('persistent_undo') 87 + if !isdirectory($HOME."/.cache/vim") 88 + call mkdir($HOME."/.cache/vim", "", 0770) 89 + endif 90 + 91 + if !isdirectory($HOME."/.cache/vim/undo") 92 + call mkdir($HOME."/.cache/vim/undo", "", 0770) 93 + endif 94 + 95 + set undodir=~/.cache/vim/undo 96 + set undofile 97 + set undolevels=1000 98 + set undoreload=10000 99 + endif 100 + 101 + " Strip Trailing Whitespace on Save 102 + function! TrimWhiteSpace() 103 + %s/\s\+$//e 104 + endfunction 105 + autocmd BufWritePre * :call TrimWhiteSpace() 106 + 107 + " Command livepreview for nvim 108 + if has('nvim') 109 + set inccommand=nosplit 110 + endif 111 + 112 +
+100
config/nvim/default.nix
··· 1 + { pkgs, fetchgit, ... }: 2 + 3 + let 4 + inherit (import <nixpkgs> {}) fetchFromGitHub; 5 + inherit (pkgs.vimUtils) buildVimPluginFrom2Nix; 6 + 7 + plugins.vim-purge-undodir = buildVimPluginFrom2Nix { 8 + pname = "purge_undodir.vim"; 9 + version = "2017-09-11"; 10 + src = fetchFromGitHub { 11 + owner = "jsfaint"; 12 + repo = "purge_undodir.vim"; 13 + rev = "7115b2462b7738dd796e9febecbd24055793789f"; 14 + sha256 = "1c20bk4g3a930pqs6w1wcw34wj7xpcp6zi1wkx7jadxqjjwgcclp"; 15 + }; 16 + meta.homepage = "https://github.com/jsfaint/purge_undodir.vim"; 17 + }; 18 + 19 + plugins.vitality-vim = buildVimPluginFrom2Nix { 20 + pname = "vitality.vim"; 21 + version = "2017-01-30"; 22 + src = fetchFromGitHub { 23 + owner = "sjl"; 24 + repo = "vitality.vim"; 25 + rev = "0f693bff572689ad52b781c012dad4926cd924f6"; 26 + sha256 = "06zjlyp86clv3airxaw45d94kcrznd36m5r4dpj6lfrijwc4xhly"; 27 + }; 28 + meta.homepage = "https://github.com/sjl/vitality.vim"; 29 + }; 30 + 31 + plugins.vim-zipper = buildVimPluginFrom2Nix { 32 + pname = "vim-zipper"; 33 + version = "2016-09-13"; 34 + src = fetchFromGitHub { 35 + owner = "sts10"; 36 + repo = "vim-zipper"; 37 + rev = "5e60e2b39362168598db543f0c99bad930d5966f"; 38 + sha256 = "088m30inpq9rwd0c7pyick7ibji2vdhdf4hzd6iy4c5z1mn9kch1"; 39 + }; 40 + meta.homepage = "https://github.com/sts10/vim-zipper"; 41 + }; 42 + 43 + plugins.vim-golden-ratio = buildVimPluginFrom2Nix { 44 + pname = "vim-golden-ratio"; 45 + version = "2020-04-03"; 46 + src = fetchFromGitHub { 47 + owner = "roman"; 48 + repo = "golden-ratio"; 49 + rev = "8313b6d6723c9e77ef1d3760af2cdd244e8db043"; 50 + sha256 = "03nm1wr0qsrirg4z4171f4nygnqgb6w06ldr6rbbz4a1f7j8j654"; 51 + }; 52 + meta.homepage = "https://github.com/roman/golden-ratio"; 53 + }; 54 + 55 + plugins.vim-listtoggle = buildVimPluginFrom2Nix { 56 + pname = "vim-listtoggle"; 57 + version = "2019-03-13"; 58 + src = fetchFromGitHub { 59 + owner = "Valloric"; 60 + repo = "ListToggle"; 61 + rev = "63fb8acb57d57380b2e30e7a831247140559c95f"; 62 + sha256 = "1fbshc3pjm0d1nnig2wnbj9yf39iagva44k2qhl85zfz1pv7sv57"; 63 + }; 64 + meta.homepage = "https://github.com/Valloric/ListToggle"; 65 + }; 66 + in { 67 + environment.variables = { EDITOR = "vim"; }; 68 + 69 + environment.systemPackages = with pkgs; [ 70 + (neovim.override { 71 + viAlias = true; 72 + vimAlias = true; 73 + 74 + configure = { 75 + customRC = pkgs.callPackage ./vimrc.nix {}; 76 + vam.knownPlugins = pkgs.vimPlugins // plugins; 77 + vam.pluginDictionaries = [ 78 + { name = "palenight-vim"; } 79 + { name = "vim-repeat"; } 80 + { name = "editorconfig-vim"; } 81 + { name = "vim-purge-undodir"; } 82 + { name = "lightline-vim"; } 83 + { name = "vitality-vim"; } 84 + { name = "vim-zipper"; } 85 + { name = "vim-golden-ratio"; } 86 + { name = "goyo-vim"; } 87 + { name = "limelight-vim"; } 88 + { name = "fzf-vim"; } 89 + { name = "vim-dirvish"; } 90 + { name = "vim-fugitive"; } 91 + { name = "vim-listtoggle"; } 92 + { name = "vim-polyglot"; } 93 + { name = "vim-easymotion"; } 94 + { name = "vim-surround"; } 95 + { name = "coc-nvim"; } 96 + ]; 97 + }; 98 + } 99 + )]; 100 + }
+149
config/nvim/keymap.vim
··· 1 + " Set leader to space 2 + let mapleader=" " 3 + nnoremap <Space> <nop> 4 + 5 + " unmap F1 help 6 + nmap <F1> <nop> 7 + imap <F1> <nop> 8 + 9 + " Map <C-w> , to vsp and . to sp 10 + nnoremap <C-w>, :vsp<CR> 11 + nnoremap <C-w>. :sp<CR> 12 + 13 + " Map semicolon to colon 14 + noremap ; : 15 + 16 + " Quick/Location list Toggle 17 + let g:lt_location_list_toggle_map = '<leader>p' 18 + let g:lt_quickfix_list_toggle_map = '<leader>q' 19 + 20 + " fzf 21 + nnoremap <silent> <Leader>o :GFiles<CR> 22 + 23 + " Agerium 24 + function! Agerium() 25 + let params = input('Search files for: ') 26 + execute 'Ag ' . params 27 + endfunction 28 + nnoremap <Leader>f :call Agerium()<CR> 29 + 30 + " Easymotion Shortcuts 31 + map n <Plug>(easymotion-next) 32 + map N <Plug>(easymotion-prev) 33 + 34 + " Gif config 35 + map / <Plug>(easymotion-sn) 36 + omap / <Plug>(easymotion-tn) 37 + 38 + " unmap arrow keys 39 + noremap <Up> <Nop> 40 + noremap <Down> <Nop> 41 + noremap <Left> <Nop> 42 + noremap <Right> <Nop> 43 + 44 + " Remap Arrow keys 45 + map <Up> <Plug>(easymotion-k) 46 + map <Down> <Plug>(easymotion-j) 47 + map <Left> <Plug>(easymotion-linebackward) 48 + map <Right> <Plug>(easymotion-lineforward) 49 + 50 + " Move to previous/next buffer 51 + nnoremap <silent> <leader>h :bprevious<CR> 52 + nnoremap <silent> <leader>l :bnext<CR> 53 + 54 + " Go to last used buffer 55 + nnoremap <leader>j <C-^> 56 + 57 + " Close a buffer 58 + nnoremap <silent> <leader>k :bp <BAR> bd #<CR> 59 + 60 + " List buffers 61 + nnoremap <silent> <leader>b :Buffers<CR> 62 + 63 + " List buffer commits 64 + nnoremap <silent> <leader>c :BCommits<CR> 65 + 66 + " List git status files 67 + nnoremap <silent> <leader>c :GFiles?<CR> 68 + 69 + " Toggle zen mode 70 + nnoremap <silent> <leader>z :Goyo<CR> 71 + 72 + " Blackhole all x commands and make X behave like d 73 + nnoremap X "_d 74 + nnoremap XX "_dd 75 + vnoremap X "_d 76 + vnoremap x "_d 77 + nnoremap x "_x 78 + 79 + " Make the dot command work as expected in visual mode (via 80 + " https://www.reddit.com/r/vim/comments/3y2mgt/do_you_have_any_minor_customizationsmappings_that/cya0x04) 81 + vnoremap . :norm.<CR> 82 + 83 + " Allows you to visually select a section and then hit @ to run a macro on all lines 84 + " https://medium.com/@schtoeffel/you-don-t-need-more-than-one-cursor-in-vim-2c44117d51db#.3dcn9prw6 85 + function! ExecuteMacroOverVisualRange() 86 + echo "@".getcmdline() 87 + execute ":'<,'>normal @".nr2char(getchar()) 88 + endfunction 89 + " Executes a macro for each line in visual selection 90 + xnoremap @ :<C-u>call ExecuteMacroOverVisualRange()<CR> 91 + 92 + " Have the indent commands re-highlight the last visual selection to make 93 + " multiple indentations easier 94 + vnoremap > >gv 95 + vnoremap < <gv 96 + 97 + " Make Ctrl-c behave exactly like Escape (because it matters to completions) 98 + inoremap <c-c> <ESC> 99 + xnoremap <c-c> <ESC> 100 + 101 + " Use tab for trigger completion with characters ahead and navigate. 102 + " Use command ':verbose imap <tab>' to make sure tab is not mapped by other plugin. 103 + inoremap <silent><expr> <TAB> 104 + \ pumvisible() ? "\<C-n>" : 105 + \ <SID>check_back_space() ? "\<TAB>" : 106 + \ coc#refresh() 107 + inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>" 108 + 109 + function! s:check_back_space() abort 110 + let col = col('.') - 1 111 + return !col || getline('.')[col - 1] =~# '\s' 112 + endfunction 113 + 114 + " Use <c-space> to trigger completion. 115 + inoremap <silent><expr> <c-space> coc#refresh() 116 + 117 + " Use <cr> to confirm completion, `<C-g>u` means break undo chain at current position. 118 + inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>" 119 + 120 + " Use `[g` and `]g` to navigate diagnostics 121 + nmap <silent> [g <Plug>(coc-diagnostic-prev) 122 + nmap <silent> ]g <Plug>(coc-diagnostic-next) 123 + 124 + " Remap keys for gotos 125 + nmap <silent> gd <Plug>(coc-definition) 126 + nmap <silent> gy <Plug>(coc-type-definition) 127 + nmap <silent> gi <Plug>(coc-implementation) 128 + nmap <silent> gr <Plug>(coc-references) 129 + nmap <silent> gn <Plug>(coc-rename) 130 + 131 + function! s:show_documentation() 132 + if (index(['vim','help'], &filetype) >= 0) 133 + execute 'h '.expand('<cword>') 134 + else 135 + call CocAction('doHover') 136 + endif 137 + endfunction 138 + 139 + " Use K to show documentation in preview window 140 + nnoremap <silent> K :call <SID>show_documentation()<CR> 141 + 142 + " Highlight symbol under cursor on CursorHold 143 + autocmd CursorHold * silent call CocActionAsync('highlight') 144 + 145 + " Show all diagnostics 146 + nnoremap <silent> <space>a :<C-u>CocList diagnostics<cr> 147 + 148 + " Find symbol of current document 149 + nnoremap <silent> <space>s :<C-u>CocList outline<cr>
+51
config/nvim/plugins.vim
··· 1 + " coc.nvim 2 + let g:coc_global_extensions = [ 'coc-tsserver', 'coc-eslint', 'coc-json' ] 3 + 4 + " Polyglot 5 + let g:javascript_plugin_flow = 1 6 + let g:jsx_ext_required = 0 7 + 8 + " EasyMotion 9 + let g:EasyMotion_do_mapping = 0 10 + let g:EasyMotion_smartcase = 1 11 + let g:EasyMotion_startofline = 0 12 + 13 + " Fugitive 14 + let g:Gitv_OpenHorizontal = 1 15 + let g:Gitv_WipeAllOnClose = 1 16 + let g:Gitv_DoNotMapCtrlKey = 1 17 + 18 + " fzf 19 + let g:fzf_layout = { 'down': '~30%' } 20 + let g:fzf_buffers_jump = 1 21 + 22 + " Vitality 23 + let g:vitality_always_assume_iterm = 1 24 + 25 + " Limelight 26 + let g:limelight_conceal_ctermfg = '#4c5259' 27 + let g:limelight_conceal_guifg = '#4c5259' 28 + 29 + " Goyo 30 + let g:goyo_height = '85%' 31 + let g:goyo_width = '80%' 32 + 33 + " Lightline 34 + set noshowmode 35 + 36 + let g:lightline = { 37 + \ 'colorscheme': 'one', 38 + \ 'active': { 39 + \ 'left': [ [ 'mode', 'paste' ], 40 + \ [ 'readonly', 'filename' ] ], 41 + \ }, 42 + \ 'component_function': { 43 + \ 'filename': 'LightlineFilename', 44 + \ }, 45 + \ } 46 + 47 + function! LightlineFilename() 48 + let filename = @% !=# '' ? @% : '[No Name]' 49 + let modified = &modified ? ' +' : '' 50 + return filename . modified 51 + endfunction
+71
config/nvim/theme.vim
··· 1 + " Enable true color support 2 + if (has("nvim")) 3 + " For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 4 + let $NVIM_TUI_ENABLE_TRUE_COLOR=1 5 + endif 6 + 7 + if (has("termguicolors")) 8 + "For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 9 + set termguicolors 10 + endif 11 + 12 + " Enable cursor shape switching 13 + let $NVIM_TUI_ENABLE_CURSOR_SHAPE=1 14 + 15 + function! ResetTheme() 16 + " Don't reset background colour 17 + let &t_ut='' 18 + 19 + " Better display for messages 20 + set cmdheight=2 21 + 22 + " Always show signcolumns 23 + set signcolumn=yes 24 + 25 + " Disable all bolds 26 + set t_md= 27 + 28 + " Palenight Italics 29 + let g:palenight_terminal_italics=1 30 + 31 + " Syntax highlighting 32 + syntax enable 33 + set background=dark 34 + set cursorline 35 + colorscheme palenight 36 + 37 + " Translucent background 38 + hi LineNr ctermfg=232 ctermbg=232 cterm=bold guifg=#16181c guibg=#16181c gui=bold 39 + hi CursorLine ctermbg=232 guibg=#16181c 40 + hi CursorLineNR ctermfg=235 ctermbg=232 cterm=bold guifg=#404449 guibg=#16181c gui=bold 41 + hi NonText guifg=#404449 guibg=NONE gui=NONE 42 + hi SpecialKey guifg=#404449 guibg=NONE gui=NONE 43 + hi VertSplit ctermfg=235 ctermbg=235 cterm=NONE guifg=#282c34 guibg=#282c34 gui=NONE 44 + hi Normal guifg=#f8f8f2 guibg=NONE gui=NONE 45 + 46 + " Some theming for ALE 47 + hi ALEWarningSign ctermfg=70 ctermbg=NONE cterm=NONE guifg=#4BAE16 guibg=NONE gui=NONE 48 + hi ALEErrorSign ctermfg=166 ctermbg=NONE cterm=NONE guifg=#D3422E guibg=NONE gui=NONE 49 + endfunction 50 + 51 + call ResetTheme() 52 + 53 + " Goyo Hooks 54 + function! s:goyo_enter() 55 + silent !tmux set status off 56 + silent !tmux list-panes -F '\#F' | grep -q Z || tmux resize-pane -Z 57 + set listchars= 58 + set scrolloff=999 59 + Limelight 60 + endfunction 61 + 62 + function! s:goyo_leave() 63 + silent !tmux set status on 64 + silent !tmux list-panes -F '\#F' | grep -q Z && tmux resize-pane -Z 65 + set scrolloff=2 66 + Limelight! 67 + call ResetTheme() 68 + endfunction 69 + 70 + autocmd! User GoyoEnter nested call <SID>goyo_enter() 71 + autocmd! User GoyoLeave nested call <SID>goyo_leave()
+16
config/nvim/vimrc.nix
··· 1 + { stdenv, writeText }: 2 + 3 + let 4 + basic = builtins.readFile ./basic.vim; 5 + theme = builtins.readFile ./theme.vim; 6 + plugins = builtins.readFile ./plugins.vim; 7 + keymap = builtins.readFile ./keymap.vim; 8 + in 9 + 10 + '' 11 + ${basic} 12 + ${theme} 13 + ${plugins} 14 + ${keymap} 15 + '' 16 +
+27
config/shell.nix
··· 1 + { lib, pkgs, ... }: 2 + 3 + let 4 + inherit (lib) mkMerge optionalAttrs; 5 + inherit (lib.systems.elaborate { system = builtins.currentSystem; }) isLinux isDarwin; 6 + in 7 + 8 + mkMerge [ 9 + { 10 + environment.systemPackages = [ pkgs.zsh ]; 11 + environment.pathsToLink = [ "/share/zsh" ]; 12 + 13 + programs.zsh = { 14 + enable = true; 15 + promptInit = lib.mkDefault ""; 16 + }; 17 + } 18 + 19 + (optionalAttrs isDarwin { 20 + environment.shells = [ pkgs.zsh ]; 21 + environment.loginShell = pkgs.zsh; 22 + }) 23 + 24 + (optionalAttrs isLinux { 25 + users.defaultUserShell = pkgs.zsh; 26 + }) 27 + ]
+7
configuration.nix
··· 1 + { 2 + imports = [ 3 + ./nix/nix-path.nix 4 + ./modules 5 + ./profiles/common.nix 6 + ]; 7 + }
+15
modules/darwin.nix
··· 1 + { options, pkgs, ... }: 2 + 3 + let 4 + inherit (import ../channels) __nixPath; 5 + in { 6 + # Create /etc/bashrc that loads the nix-darwin environment. 7 + programs.bash.enable = true; 8 + 9 + # Recreate /run/current-system symlink after boot. 10 + services.activate-system.enable = true; 11 + 12 + # Auto-upgrade and manage nix with nix-darwin 13 + services.nix-daemon.enable = true; 14 + nix.package = pkgs.nix; 15 + }
+11
modules/default.nix
··· 1 + { lib, ... }: 2 + 3 + let 4 + inherit (lib) optional flatten; 5 + inherit (lib.systems.elaborate { system = builtins.currentSystem; }) isLinux isDarwin; 6 + in { 7 + imports = flatten [ 8 + ./home-manager.nix 9 + (optional isDarwin ./darwin.nix) 10 + ]; 11 + }
+12
modules/home-manager.nix
··· 1 + { lib, ... }: 2 + 3 + let 4 + inherit (lib) optional flatten; 5 + inherit (import ../channels) __nixPath; 6 + inherit (lib.systems.elaborate { system = builtins.currentSystem; }) isLinux isDarwin; 7 + in { 8 + imports = flatten [ 9 + (optional isDarwin <home-manager/nix-darwin>) 10 + (optional isLinux <home-manager/nixos>) 11 + ]; 12 + }
+20
nix/hostname.nix
··· 1 + { lib, ... }: 2 + 3 + let 4 + 5 + inherit (lib) maybeEnv fileContents; 6 + inherit (lib.systems.elaborate { system = builtins.currentSystem; }) isLinux isDarwin; 7 + 8 + in 9 + 10 + maybeEnv "HOST" (fileContents ( 11 + if !isDarwin then 12 + /etc/hostname 13 + else 14 + derivation { 15 + name = "hostname"; 16 + system = builtins.currentSystem; 17 + builder = "/bin/sh"; 18 + args = [ "-c" "/usr/sbin/scutil --get LocalHostName > $out" ]; 19 + } 20 + ))
+45
nix/nix-path.nix
··· 1 + { config, lib, ... }: 2 + 3 + let 4 + 5 + inherit (import ../channels) __nixPath nixPath; 6 + inherit (lib) mkForce; 7 + inherit (lib.systems.elaborate { system = builtins.currentSystem; }) isLinux isDarwin; 8 + 9 + in 10 + 11 + rec { 12 + nixpkgs = { 13 + config.allowUnfree = true; 14 + }; 15 + 16 + nix.nixPath = mkForce nixPath; 17 + 18 + _module.args = 19 + let 20 + 21 + pkgsConf = { 22 + inherit (config.nixpkgs) localSystem crossSystem; 23 + config = config.nixpkgs.config // nixpkgs.config; 24 + }; 25 + 26 + in 27 + 28 + rec { 29 + pkgs = import <nixpkgs> ( 30 + if isLinux then { 31 + inherit (pkgsConf) config localSystem crossSystem; 32 + } else { 33 + inherit (pkgsConf) config; 34 + } 35 + ); 36 + 37 + pkgs-unstable = import <nixpkgs-unstable> ( 38 + if isLinux then { 39 + inherit (pkgsConf) config localSystem crossSystem; 40 + } else { 41 + inherit (pkgsConf) config; 42 + } 43 + ); 44 + }; 45 + }
+16
profiles/common.nix
··· 1 + { lib, ... }: 2 + 3 + let 4 + inherit (lib) optional flatten; 5 + inherit (lib.systems.elaborate { system = builtins.currentSystem; }) isLinux isDarwin; 6 + in { 7 + imports = flatten [ 8 + ./users.nix 9 + ../config/shell.nix 10 + ../config/nvim/default.nix 11 + ../config/nodejs.nix 12 + ../config/gpg.nix 13 + 14 + (optional isDarwin ./darwin.nix) 15 + ]; 16 + }
+7
profiles/darwin.nix
··· 1 + { pkgs, ... }: 2 + 3 + { 4 + environment.systemPackages = [ 5 + pkgs.coreutils 6 + ]; 7 + }
+23
profiles/users.nix
··· 1 + { pkgs, lib, ... }: 2 + 3 + let 4 + inherit (lib) optionalAttrs mkMerge mkIf mkDefault; 5 + inherit (lib.systems.elaborate { system = builtins.currentSystem; }) isLinux isDarwin; 6 + 7 + home = import ../config/home/default.nix; 8 + in 9 + 10 + mkMerge [ 11 + { 12 + home-manager.users.phil = home; 13 + users.users.phil.home = mkIf isDarwin "/Users/phil"; 14 + } 15 + 16 + (optionalAttrs isLinux { 17 + users.users.phil = { 18 + isNormalUser = true; 19 + uid = 1000; 20 + home = "/home/phil"; 21 + }; 22 + }) 23 + ]