@jaspermayone.com's dotfiles
at main 235 lines 5.0 kB view raw
1# Home Manager configuration 2# Shared between NixOS and Darwin 3{ 4 config, 5 pkgs, 6 lib, 7 hostname, 8 isDarwin, 9 inputs, 10 ... 11}: 12 13{ 14 imports = [ 15 ../profiles/bore.nix 16 ../modules/shell.nix 17 ../modules/ssh.nix 18 ../modules/git.nix 19 ../modules/configs.nix 20 inputs.try.homeModules.default 21 ]; 22 23 home.stateVersion = "24.05"; 24 25 # Let Home Manager manage itself 26 programs.home-manager.enable = true; 27 28 home.username = "jsp"; 29 home.homeDirectory = lib.mkForce (if isDarwin then "/Users/jsp" else "/home/jsp"); 30 31 # Environment variables 32 home.sessionVariables = { 33 EDITOR = "vim"; 34 VISUAL = "vim"; 35 PAGER = "less"; 36 CLAUDE_CODE_DISABLE_TERMINAL_TITLE = "1"; 37 }; 38 39 # Vim configuration 40 programs.vim = { 41 enable = true; 42 defaultEditor = true; 43 settings = { 44 number = true; 45 relativenumber = true; 46 tabstop = 2; 47 shiftwidth = 2; 48 expandtab = true; 49 }; 50 extraConfig = '' 51 set nocompatible 52 syntax on 53 set encoding=utf-8 54 set autoindent 55 set smartindent 56 set hlsearch 57 set incsearch 58 set ignorecase 59 set smartcase 60 set backspace=indent,eol,start 61 62 " Strip trailing whitespace on save 63 autocmd BufWritePre * :%s/\s\+$//e 64 ''; 65 }; 66 67 # Direnv for per-project environments 68 programs.direnv = { 69 enable = true; 70 enableZshIntegration = true; 71 nix-direnv.enable = true; 72 }; 73 74 # Try - ephemeral workspace manager (local dev machines only) 75 programs.try = { 76 enable = lib.elem hostname [ "remus" "dippet" "horace" ]; 77 path = "~/dev/tries"; 78 }; 79 80 # Alacritty terminal 81 programs.alacritty = { 82 enable = true; 83 settings = { 84 window = { 85 dimensions = { 86 columns = 132; 87 lines = 32; 88 }; 89 padding = { 90 x = 8; 91 y = 8; 92 }; 93 decorations = if isDarwin then "Buttonless" else "Full"; 94 opacity = 1.0; 95 blur = true; 96 }; 97 98 font = { 99 normal = { 100 family = "JetBrainsMono Nerd Font"; 101 style = "Regular"; 102 }; 103 bold = { 104 family = "JetBrainsMono Nerd Font"; 105 style = "Bold"; 106 }; 107 italic = { 108 family = "JetBrainsMono Nerd Font"; 109 style = "Italic"; 110 }; 111 size = 14.0; 112 }; 113 114 colors = { 115 primary = { 116 background = "#292B33"; 117 foreground = "#FFFFFF"; 118 }; 119 normal = { 120 black = "#1D1F28"; 121 red = "#F67E7D"; 122 green = "#00BD9C"; 123 yellow = "#E5C76B"; 124 blue = "#6BB8FF"; 125 magenta = "#DA70D6"; 126 cyan = "#79DCDA"; 127 white = "#FFFFFF"; 128 }; 129 bright = { 130 black = "#535353"; 131 red = "#FF9391"; 132 green = "#98C379"; 133 yellow = "#F9E46B"; 134 blue = "#91DDFF"; 135 magenta = "#DA9EF4"; 136 cyan = "#A3F7F0"; 137 white = "#FEFFFF"; 138 }; 139 }; 140 141 cursor = { 142 style = { 143 shape = "Block"; 144 blinking = "On"; 145 }; 146 blink_interval = 500; 147 }; 148 149 selection.save_to_clipboard = true; 150 151 terminal.shell = { 152 program = "zsh"; 153 args = [ "-l" ]; 154 }; 155 }; 156 }; 157 158 # RC files from ../rc/ directory (each file is linked as-is to ~/) 159 home.file = 160 builtins.listToAttrs ( 161 map (name: { 162 name = name; 163 value = { 164 source = ../rc/${name}; 165 }; 166 }) (builtins.attrNames (builtins.readDir ../rc)) 167 ) 168 // lib.optionalAttrs (!isDarwin) { 169 # Discord settings (skip update nag on NixOS) 170 ".config/discord/settings.json".text = builtins.toJSON { SKIP_HOST_UPDATE = true; }; 171 }; 172 173 home.packages = with pkgs; [ 174 eza 175 ] ++ lib.optionals (hostname == "remus") [ 176 qmd 177 ]; 178 179 # Git configuration 180 jsp.git.enable = true; 181 182 # SSH configuration 183 jsp.ssh = { 184 enable = true; 185 zmx.enable = true; 186 187 hosts = { 188 # Default settings for all hosts 189 "*" = { 190 addKeysToAgent = "yes"; 191 }; 192 193 # Alastor (tunnel server, named after Mad-Eye Moody) 194 alastor = { 195 hostname = "tun.hogwarts.channel"; 196 user = "jsp"; 197 identityFile = "~/.ssh/id_ed25519"; 198 zmx = true; # auto-attach zmx session 199 }; 200 201 # Horace (named after Horace Slughorn) 202 horace = { 203 hostname = "horace"; 204 user = "jsp"; 205 identityFile = "~/.ssh/id_ed25519"; 206 zmx = true; 207 }; 208 209 # Proxmox and VMs 210 pve = { 211 hostname = "10.100.0.222"; 212 user = "root"; 213 zmx = true; 214 }; 215 216 proxy = { 217 hostname = "10.100.0.229"; 218 user = "jasper"; 219 zmx = true; 220 }; 221 222 # GitHub 223 "github.com" = { 224 hostname = "github.com"; 225 user = "git"; 226 identityFile = "~/.ssh/id_ed25519"; 227 identitiesOnly = true; 228 extraOptions = { 229 PubkeyAcceptedAlgorithms = "+ssh-ed25519"; 230 HostkeyAlgorithms = "+ssh-ed25519"; 231 }; 232 }; 233 }; 234 }; 235}