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