Kieran's opinionated (and probably slightly dumb) nix config
1# This is your home-manager configuration file 2# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix) 3{ 4 inputs, 5 lib, 6 config, 7 pkgs, 8 ... 9}: { 10 # You can import other home-manager modules here 11 imports = [ 12 # If you want to use home-manager modules from other flakes (such as nix-colors): 13 # inputs.nix-colors.homeManagerModule 14 15 # You can also split up your configuration and import pieces of it here: 16 # ./nvim.nix 17 18 # spicetify 19 inputs.spicetify-nix.homeManagerModules.default 20 21 # catpuccin 22 inputs.catppuccin.homeManagerModules.catppuccin 23 24 # inputs.Hyprnix.homeManagerModules.hyprland 25 26 ./hyprland.nix 27 # ./hyprland 28 29 ./waybar.nix 30 ]; 31 32 nixpkgs = { 33 # Configure your nixpkgs instance 34 config = { 35 # Disable if you don't want unfree packages 36 allowUnfree = true; 37 # Workaround for https://github.com/nix-community/home-manager/issues/2942 38 allowUnfreePredicate = _: true; 39 }; 40 }; 41 42 home = { 43 username = "kierank"; 44 homeDirectory = "/home/kierank"; 45 }; 46 47 # Add stuff for your user as you see fit: 48 # programs.neovim.enable = true; 49 # home.packages = with pkgs; [ steam ]; 50 51 # Enable home-manager and git 52 programs.home-manager.enable = true; 53 54 # catppuccin 55 catppuccin = { 56 enable = true; 57 accent = "green"; 58 flavor = "macchiato"; 59 pointerCursor = { 60 enable = true; 61 accent = "blue"; 62 flavor = "macchiato"; 63 }; 64 }; 65 66 dconf.settings = { 67 "org/gnome/desktop/interface" = { 68 color-scheme = "prefer-dark"; 69 }; 70 }; 71 72 xdg.portal = { 73 enable = true; 74 extraPortals = with pkgs; [ xdg-desktop-portal-gtk ]; 75 configPackages = with pkgs; [ xdg-desktop-portal-gtk ]; 76 }; 77 78 gtk = { 79 enable = true; 80 catppuccin = { 81 enable = true; 82 tweaks = [ "normal" ]; 83 }; 84 }; 85 86 87 qt = { 88 style.name = "kvantum"; 89 platformTheme.name = "kvantum"; 90 enable = true; 91 }; 92 93 services.udiskie = { 94 enable = true; 95 settings = { 96 program_options = { 97 udisks_version = 2; 98 tray = false; 99 }; 100 notifications = { 101 device_unmounted = false; 102 device_added = -1; 103 device_removed = -1; 104 device_mounted = -1; 105 }; 106 }; 107 }; 108 109 # git config 110 programs.git = { 111 enable = true; 112 userName = "Kieran Klukas"; 113 userEmail = "92754843+kcoderhtml@users.noreply.github.com"; 114 aliases = { 115 c = "commit"; 116 p = "push"; 117 }; 118 extraConfig = { 119 commit.gpgsign = true; 120 gpg.format = "ssh"; 121 gpg.ssh.allowedSignersFile = "~/.ssh/allowedSigners"; 122 user.signingKey = "~/.ssh/id_rsa.pub"; 123 pull.rebase = true; 124 }; 125 }; 126 127 programs.spicetify = 128 let 129 spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system}; 130 in 131 { 132 enable = true; 133 enabledExtensions = with spicePkgs.extensions; [ 134 adblock 135 hidePodcasts 136 shuffle # shuffle+ (special characters are sanitized out of extension names) 137 ]; 138 theme = spicePkgs.themes.catppuccin; 139 colorScheme = "macchiato"; 140 }; 141 142 programs.starship = { 143 enable = true; 144 enableZshIntegration = true; 145 # Configuration written to ~/.config/starship.toml 146 settings = { 147 add_newline = false; 148 149 # Change command timeout from 500 to 1000 ms 150 command_timeout = 1000; 151 152 format = lib.concatStrings [ 153 "\n" 154 "$env_var" 155 "$all$character" 156 ]; 157 158 character = { 159 success_symbol = "[](bold purple)"; 160 error_symbol = "[](bold red)"; 161 }; 162 163 username = { 164 style_user = "green"; 165 style_root = "red"; 166 format = "[󱄅 $user]($style) "; 167 disabled = false; 168 show_always = true; 169 }; 170 171 hostname = { 172 ssh_only = false; 173 format = "on [$hostname](bold yellow) "; 174 disabled = false; 175 }; 176 177 directory = { 178 truncation_length = 1; 179 truncation_symbol = "/"; 180 home_symbol = " ~"; 181 read_only_style = "197"; 182 read_only = " "; 183 format = "at [$path]($style)[$read_only]($read_only_style) "; 184 }; 185 186 git_branch = { 187 symbol = "󰊢 "; 188 format = "via [$symbol$branch]($style) "; 189 truncation_length = 6; 190 truncation_symbol = "/"; 191 style = "bold green"; 192 }; 193 194 git_status = { 195 format = "[$all_status$ahead_behind]($style) "; 196 style = "bold green"; 197 conflicted = " "; 198 up_to_date = " "; 199 untracked = " "; 200 ahead = "$count "; 201 diverged = "$ahead_count$behind_count "; 202 behind = "$count "; 203 stashed = "󱑿 "; 204 modified = " "; 205 staged = "[++$count ](green)"; 206 renamed = "󱅄 "; 207 deleted = " "; 208 }; 209 210 docker_context = { 211 symbol = " "; 212 disabled = false; 213 }; 214 215 python = { 216 symbol = "󰌠 "; 217 python_binary = "python3"; 218 disabled = false; 219 }; 220 221 nodejs = { 222 symbol = " "; 223 detect_files = ["package.json" ".node-version" "!bunfig.toml" "!bun.lockb"]; 224 disabled = false; 225 }; 226 227 bun = { 228 symbol = "󰟈 "; 229 disabled = false; 230 }; 231 }; 232 }; 233 234 programs.zsh = { 235 enable = true; 236 enableCompletion = true; 237 syntaxHighlighting.enable = true; 238 239 shellAliases = { 240 ll = "ls -l"; 241 la = "ls -la"; 242 update = "sudo nixos-rebuild switch"; 243 gc = "git commit"; 244 gp = "git push"; 245 rr = "rm -Rf"; 246 ghrpc = "gh repo create -c"; 247 }; 248 initExtra = '' 249 #ssh auto reconnect 250 assh() { 251 local host=$1 252 local port=$2 253 while true; do 254 ssh -p $port -o "BatchMode yes" $host || sleep 1 255 done 256 } 257 ''; 258 history = { 259 size = 10000; 260 path = "${config.xdg.dataHome}/zsh/history"; 261 }; 262 263 oh-my-zsh = { 264 enable = true; 265 plugins = [ "git" "sudo" "docker" "git" "command-not-found" "colored-man-pages" ]; 266 }; 267 268 plugins = [ 269 { 270 # will source zsh-autosuggestions.plugin.zsh 271 name = "zsh-autosuggestions"; 272 src = pkgs.fetchFromGitHub { 273 owner = "zsh-users"; 274 repo = "zsh-autosuggestions"; 275 rev = "v0.7.0"; 276 sha256 = "sha256-KLUYpUu4DHRumQZ3w59m9aTW6TBKMCXl2UcKi4uMd7w="; 277 }; 278 } 279 { 280 # will source zsh-sytax-highlighting 281 name = "zsh-sytax-highlighting"; 282 src = pkgs.fetchFromGitHub { 283 owner = "zsh-users"; 284 repo = "zsh-syntax-highlighting"; 285 rev = "0.8.0"; 286 sha256 = "sha256-iJdWopZwHpSyYl5/FQXEW7gl/SrKaYDEtTH9cGP7iPo="; 287 }; 288 } 289 ]; 290 }; 291 292 programs.zoxide = { 293 enable = true; 294 enableZshIntegration = true; 295 }; 296 297 # alacritty 298 programs.alacritty = { 299 enable = true; 300 settings = { 301 live_config_reload = true; 302 cursor = { 303 unfocused_hollow = true; 304 style = { 305 blinking = "On"; 306 }; 307 }; 308 window = { 309 opacity = 0.75; 310 padding = { 311 x = 12; 312 y = 12; 313 }; 314 }; 315 font = { 316 size = 13; 317 normal = { 318 family = "JetBrainsMono Nerd Font"; 319 }; 320 }; 321 colors = { 322 primary = { 323 background = lib.mkForce "#1E2128"; 324 }; 325 }; 326 }; 327 }; 328 329 services.mako = { 330 enable = true; 331 defaultTimeout = 4000; 332 margin = "58,6"; 333 font = "Fira Sans 12"; 334 borderRadius = 5; 335 }; 336 337 programs.tofi = { 338 enable = true; 339 catppuccin.enable = false; 340 settings = { 341 font = "Fira Sans"; 342 font-size = 24; 343 344 prompt-text = ''"> "''; 345 placeholder-text = "search for something"; 346 hide-cursor = true; 347 348 corner-radius = 10; 349 outline-width = 3; 350 border-width = 0; 351 padding-left = "4%"; 352 padding-top = "2%"; 353 padding-right = 0; 354 padding-bottom = 0; 355 356 outline-color = "#1E2030"; 357 text-color = "#cad3f5"; 358 prompt-color = "#ed8796"; 359 placeholder-color = "#8087A2"; 360 selection-color = "#eed49f"; 361 background-color = "#24273a"; 362 363 width = "35%"; 364 height = "15%"; 365 }; 366 }; 367 368 programs.vscode = { 369 enable = true; 370 extensions = with pkgs.vscode-extensions; [ 371 bbenoist.nix 372 golang.go 373 catppuccin.catppuccin-vsc-icons 374 catppuccin.catppuccin-vsc 375 ]; 376 userSettings = { 377 "editor.semanticHighlighting.enabled" = true; 378 "terminal.integrated.minimumContrastRatio" = 1; 379 "window.titleBarStyle" = "custom"; 380 381 "gopls" = { 382 "ui.semanticTokens" = true; 383 }; 384 "workbench.colorTheme" = "Catppuccin Macchiato"; 385 "workbench.iconTheme" = "catppuccin-macchiato"; 386 "catppuccin.accentColor" = "blue"; 387 "editor.fontFamily" = "'FiraCode Nerd Font', 'monospace', monospace"; 388 "git.autofetch" = true; 389 "git.confirmSync" = false; 390 "github.copilot.editor.enableAutoCompletions" = false; 391 }; 392 }; 393 394 programs.obs-studio = { 395 enable = true; 396 plugins = with pkgs.obs-studio-plugins; [ 397 wlrobs 398 obs-backgroundremoval 399 obs-pipewire-audio-capture 400 ]; 401 }; 402 403 404 # Nicely reload system units when changing configs 405 systemd.user.startServices = "sd-switch"; 406 407 # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion 408 home.stateVersion = "23.05"; 409}