home-config/nix-home-manager/home.nix
f1bc773106aae04b7f622e72cbfd1650c24b1ed7
· 16.5 KB · 472 lines
raw
| 1 | { config, pkgs, hyprland, nixgl, wpaperd, hyprpicker-git, hyprlock, ... }: |
| 2 | let |
| 3 | lock-false = { |
| 4 | Value = false; |
| 5 | Status = "locked"; |
| 6 | }; |
| 7 | lock-true = { |
| 8 | Value = true; |
| 9 | Status = "locked"; |
| 10 | }; |
| 11 | in |
| 12 | { |
| 13 | # Home Manager needs a bit of information about you and the paths it should |
| 14 | # manage. |
| 15 | home.username = "ryan"; |
| 16 | home.homeDirectory = "/home/ryan"; |
| 17 | |
| 18 | # Ignore news |
| 19 | news.display = "silent"; |
| 20 | |
| 21 | # This value determines the Home Manager release that your configuration is |
| 22 | # compatible with. This helps avoid breakage when a new Home Manager release |
| 23 | # introduces backwards incompatible changes. |
| 24 | # |
| 25 | # You should not change this value, even if you update Home Manager. If you do |
| 26 | # want to update the value, then make sure to first check the Home Manager |
| 27 | # release notes. |
| 28 | home.stateVersion = "23.11"; # Please read the comment before changing. |
| 29 | |
| 30 | # This value will set some environment variables to allow home-manager to |
| 31 | # function better outside of NixOS |
| 32 | nixpkgs.config.allowUnfree = true; |
| 33 | #targets.genericLinux.enable = true; |
| 34 | fonts.fontconfig.enable = true; |
| 35 | fonts.fontconfig.defaultFonts = { |
| 36 | monospace = [ "DejaVu Sans Mono" ]; |
| 37 | sansSerif = [ "DejaVu Sans" ]; |
| 38 | serif = [ "DejaVu Serif" ]; |
| 39 | }; |
| 40 | |
| 41 | # wayland.windowManager.hyprland.enable = true; |
| 42 | |
| 43 | # Install firefox and add some customizations |
| 44 | programs.firefox = { |
| 45 | enable = true; |
| 46 | policies = { |
| 47 | EnableTrackingProtection = { |
| 48 | Value = true; |
| 49 | Locked = true; |
| 50 | Cryptomining = true; |
| 51 | Fingerprinting = true; |
| 52 | EmailTracking = true; |
| 53 | }; |
| 54 | UserMessaging = { |
| 55 | WhatsNew = false; |
| 56 | ExtensionRecommendations = false; |
| 57 | FeatureRecommendations = false; |
| 58 | UrlbarInterventions = false; |
| 59 | SkipOnboarding = true; |
| 60 | MoreFromMozilla = false; |
| 61 | Labs = false; |
| 62 | Locked = true; |
| 63 | }; |
| 64 | DisableAppUpdate = true; |
| 65 | DisableAccounts = true; |
| 66 | DisableFirefoxAccounts = true; |
| 67 | DisableFirefoxStudies = true; |
| 68 | DisablePocket = true; |
| 69 | DisableTelemetry = true; |
| 70 | AutofillAddressEnabled = false; |
| 71 | AutofillCreditCardEnabled = false; |
| 72 | DisableMasterPasswordCreation = true; |
| 73 | PasswordManagerEnabled = false; |
| 74 | PrimaryPassword = false; |
| 75 | OfferToSaveLogins = false; |
| 76 | NoDefaultBookmarks = true; |
| 77 | OverrideFirstRunPage = ""; |
| 78 | OverridePostUpdatePage = ""; |
| 79 | FirefoxHome = { |
| 80 | Search = true; |
| 81 | TopSites = true; |
| 82 | SponsoredTopSites = false; |
| 83 | Highlights = false; |
| 84 | Pocket = false; |
| 85 | SponsoredPocket = false; |
| 86 | Snippets = false; |
| 87 | Locked = true; |
| 88 | }; |
| 89 | SearchSuggestEnabled = true; |
| 90 | FirefoxSuggest = { |
| 91 | WebSuggestions = true; |
| 92 | SponsoredSuggestions = false; |
| 93 | ImproveSuggest = false; |
| 94 | Locked = true; |
| 95 | }; |
| 96 | PictureInPicture = lock-true; |
| 97 | HardwareAcceleration = true; |
| 98 | Certificates = { |
| 99 | ImportEnterpriseRoots = true; |
| 100 | }; |
| 101 | ExtensionSettings = { |
| 102 | #"*".installation_mode = "blocked"; |
| 103 | # uBlock Origin |
| 104 | "uBlock0@raymondhill.net" = { |
| 105 | install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; |
| 106 | installation_mode = "force_installed"; |
| 107 | }; |
| 108 | # Bitwarden |
| 109 | "{446900e4-71c2-419f-a6a7-df9c091e268b}" = { |
| 110 | install_url = "https://addons.mozilla.org/firefox/downloads/latest/bitwarden-password-manager/latest.xpi"; |
| 111 | installation_mode = "normal_installed"; |
| 112 | }; |
| 113 | # SponsorBlock |
| 114 | "sponsorBlocker@ajay.app" = { |
| 115 | install_url = "https://addons.mozilla.org/firefox/downloads/latest/sponsorblock/latest.xpi"; |
| 116 | installation_mode = "force_installed"; |
| 117 | }; |
| 118 | # DeArrow |
| 119 | "deArrow@ajay.app" = { |
| 120 | install_url = "https://addons.mozilla.org/firefox/downloads/latest/dearrow/latest.xpi"; |
| 121 | installation_mode = "force_installed"; |
| 122 | }; |
| 123 | # Return Youtube Dislike |
| 124 | "{762f9885-5a13-4abd-9c77-433dcd38b8fd}" = { |
| 125 | install_url = "https://addons.mozilla.org/firefox/downloads/latest/return-youtube-dislikes/latest.xpi"; |
| 126 | installation_mode = "force_installed"; |
| 127 | }; |
| 128 | # Youtube Nonstop |
| 129 | "{0d7cafdd-501c-49ca-8ebb-e3341caaa55e}" = { |
| 130 | install_url = "https://addons.mozilla.org/firefox/downloads/latest/youtube-nonstop/latest.xpi"; |
| 131 | installation_mode = "force_installed"; |
| 132 | }; |
| 133 | # Sidebery |
| 134 | "{3c078156-979c-498b-8990-85f7987dd929}" = { |
| 135 | install_url = "https://addons.mozilla.org/firefox/downloads/latest/sidebery/latest.xpi"; |
| 136 | installation_mode = "normal_installed"; |
| 137 | }; |
| 138 | # TamperMonkey |
| 139 | "firefox@tampermonkey.net" = { |
| 140 | install_url = "https://addons.mozilla.org/firefox/downloads/latest/tampermonkey/latest.xpi"; |
| 141 | installation_mode = "force_installed"; |
| 142 | }; |
| 143 | # Floccus |
| 144 | "floccus@handmadeideas.org" = { |
| 145 | install_url = "https://addons.mozilla.org/firefox/downloads/latest/floccus/latest.xpi"; |
| 146 | installation_mode = "force_installed"; |
| 147 | }; |
| 148 | }; |
| 149 | Preferences = { |
| 150 | "browser.startup.homepage" = "https://d.in.rschanz.org"; |
| 151 | "extensions.activeThemeID" = { |
| 152 | Value = "firefox-compact-dark@mozilla.org"; |
| 153 | Status = "locked"; |
| 154 | }; |
| 155 | "toolkit.legacyUserProfileCustomizations.stylesheets" = lock-true; |
| 156 | "xpinstall.whitelist.required" = lock-true; |
| 157 | "dom.webgpu.enabled" = lock-true; |
| 158 | "media.eme.enabled" = lock-true; |
| 159 | "general.autoScroll" = lock-true; |
| 160 | "general.smoothScroll" = lock-true; |
| 161 | "browser.crashReports.unsubmittedCheck.autoSubmit2" = lock-false; |
| 162 | "browser.aboutConfig.showWarning" = lock-false; |
| 163 | }; |
| 164 | }; |
| 165 | profiles.${config.home.username} = { |
| 166 | name = "${config.home.username}"; |
| 167 | isDefault = true; |
| 168 | containersForce = true; |
| 169 | containers = { |
| 170 | rit = { |
| 171 | name = "RIT"; |
| 172 | color = "orange"; |
| 173 | icon = "dollar"; |
| 174 | id = 1; |
| 175 | }; |
| 176 | ritwork = { |
| 177 | name = "RIT Work"; |
| 178 | color = "green"; |
| 179 | icon = "briefcase"; |
| 180 | id = 2; |
| 181 | }; |
| 182 | other = { |
| 183 | name = "Other"; |
| 184 | color = "blue"; |
| 185 | icon = "fingerprint"; |
| 186 | id = 3; |
| 187 | }; |
| 188 | }; |
| 189 | search = { |
| 190 | force = true; |
| 191 | default = "DuckDuckGo"; |
| 192 | order = ["DuckDuckGo" "Google"]; |
| 193 | engines = { |
| 194 | "Nix Packages" = { |
| 195 | urls = [ |
| 196 | { |
| 197 | template = "https://search.nixos.org/packages"; |
| 198 | params = [ |
| 199 | { |
| 200 | name = "type"; |
| 201 | value = "packages"; |
| 202 | } |
| 203 | { |
| 204 | name = "channel"; |
| 205 | value = "unstable"; |
| 206 | } |
| 207 | { |
| 208 | name = "query"; |
| 209 | value = "{searchTerms}"; |
| 210 | } |
| 211 | ]; |
| 212 | } |
| 213 | ]; |
| 214 | icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; |
| 215 | definedAliases = ["@np"]; |
| 216 | }; |
| 217 | }; |
| 218 | }; |
| 219 | userChrome = " |
| 220 | #main-window .toolbar-items { |
| 221 | overflow: hidden; |
| 222 | transition: height 0.3s 0.3s !important; |
| 223 | } |
| 224 | /* Default state: Set initial height to enable animation */ |
| 225 | #main-window .toolbar-items { height: 3em !important; } |
| 226 | #main-window .titlebar-button { height: 3em !important; } |
| 227 | #main-window[uidensity=\"touch\"] .toolbar-items { height: 3.35em !important; } |
| 228 | #main-window[uidensity=\"compact\"] .toolbar-items { height: 2.7em !important; } |
| 229 | /* Hidden state: Hide native tabs strip */ |
| 230 | #main-window[titlepreface*=\"\"] .toolbar-items { height: 0 !important; } |
| 231 | #main-window[titlepreface*=\"\"] .titlebar-button { height: 0 !important; } |
| 232 | /* Hidden state: Fix z-index of active pinned tabs */ |
| 233 | #main-window[titlepreface*=\"\"] #tabbrowser-tabs { z-index: 0 !important; } |
| 234 | |
| 235 | /* Sidebery expand on mouse-over and hide otherwise */ |
| 236 | |
| 237 | /* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/autohide_sidebar.css made available under Mozilla Public License v. 2.0 |
| 238 | See the above repository for updates as well as full license text. */ |
| 239 | |
| 240 | /* Show sidebar only when the cursor is over it */ |
| 241 | /* The border controlling sidebar width will be removed so you'll need to modify these values to change width */ |
| 242 | |
| 243 | #sidebar-box{ |
| 244 | --uc-sidebar-width: 60px; |
| 245 | --uc-sidebar-hover-width: 230px; |
| 246 | --uc-autohide-sidebar-delay: 200ms; /* Wait 0.2s before hiding sidebar */ |
| 247 | --uc-autohide-transition-duration: 115ms; |
| 248 | --uc-autohide-transition-type: linear; |
| 249 | --browser-area-z-index-sidebar: 3; |
| 250 | position: relative; |
| 251 | min-width: var(--uc-sidebar-width) !important; |
| 252 | width: var(--uc-sidebar-width) !important; |
| 253 | max-width: var(--uc-sidebar-width) !important; |
| 254 | z-index: var(--browser-area-z-index-sidebar,3); |
| 255 | } |
| 256 | #sidebar-box[positionend]{ direction: rtl } |
| 257 | #sidebar-box[positionend] > *{ direction: ltr } |
| 258 | |
| 259 | #sidebar-box[positionend]:-moz-locale-dir(rtl){ direction: ltr } |
| 260 | #sidebar-box[positionend]:-moz-locale-dir(rtl) > *{ direction: rtl } |
| 261 | |
| 262 | #main-window[sizemode=\"fullscreen\"] #sidebar-box{ --uc-sidebar-width: 1px; } |
| 263 | |
| 264 | #sidebar-splitter{ display: none } |
| 265 | |
| 266 | #sidebar-header{ |
| 267 | overflow: hidden; |
| 268 | color: var(--chrome-color, inherit) !important; |
| 269 | padding-inline: 0 !important; |
| 270 | } |
| 271 | |
| 272 | #sidebar-header::before, |
| 273 | #sidebar-header::after{ |
| 274 | content: \"\"; |
| 275 | display: flex; |
| 276 | padding-left: 8px; |
| 277 | } |
| 278 | |
| 279 | #sidebar-header, |
| 280 | #sidebar{ |
| 281 | transition: min-width var(--uc-autohide-transition-duration) var(--uc-autohide-transition-type) var(--uc-autohide-sidebar-delay) !important; |
| 282 | min-width: var(--uc-sidebar-width) !important; |
| 283 | will-change: min-width; |
| 284 | } |
| 285 | #sidebar-box:hover > #sidebar-header, |
| 286 | #sidebar-box:hover > #sidebar{ |
| 287 | min-width: var(--uc-sidebar-hover-width) !important; |
| 288 | transition-delay: 0ms !important; |
| 289 | } |
| 290 | |
| 291 | .sidebar-panel{ |
| 292 | background-color: transparent !important; |
| 293 | color: var(--newtab-text-primary-color) !important; |
| 294 | } |
| 295 | |
| 296 | .sidebar-panel #search-box{ |
| 297 | -moz-appearance: none !important; |
| 298 | background-color: rgba(249,249,250,0.1) !important; |
| 299 | color: inherit !important; |
| 300 | } |
| 301 | |
| 302 | /* Add sidebar divider and give it background */ |
| 303 | |
| 304 | #sidebar, |
| 305 | #sidebar-header{ |
| 306 | background-color: inherit !important; |
| 307 | border-inline: 1px solid rgb(80,80,80); |
| 308 | border-inline-width: 0px 1px; |
| 309 | } |
| 310 | |
| 311 | #sidebar-box:not([positionend]) > :-moz-locale-dir(rtl), |
| 312 | #sidebar-box[positionend] > *{ |
| 313 | border-inline-width: 1px 0px; |
| 314 | } |
| 315 | |
| 316 | /* Move statuspanel to the other side when sidebar is hovered so it doesn't get covered by sidebar */ |
| 317 | |
| 318 | #sidebar-box:not([positionend]):hover ~ #appcontent #statuspanel{ |
| 319 | inset-inline: auto 0px !important; |
| 320 | } |
| 321 | #sidebar-box:not([positionend]):hover ~ #appcontent #statuspanel-label{ |
| 322 | margin-inline: 0px !important; |
| 323 | border-left-style: solid !important; |
| 324 | } |
| 325 | |
| 326 | /* Remove the tabs label and move the Sidebary icon to the center of the box */ |
| 327 | #sidebar-box:hover [id=\"sidebar-icon\"] { |
| 328 | transform: translateX(0px) !important; |
| 329 | transition-delay: 0ms !important; |
| 330 | } |
| 331 | |
| 332 | #sidebar-box [id=\"sidebar-icon\"] { |
| 333 | transform: translateX(9px); |
| 334 | transition: transform var(--uc-autohide-transition-duration) var(--uc-autohide-transition-type) var(--uc-autohide-sidebar-delay) !important; |
| 335 | } |
| 336 | |
| 337 | #sidebar-box [id=\"sidebar-title\"] { |
| 338 | visibility: hidden !important; |
| 339 | transition: visibility var(--uc-autohide-transition-duration) var(--uc-autohide-transition-type) var(--uc-autohide-sidebar-delay) !important; |
| 340 | } |
| 341 | |
| 342 | #sidebar-box:hover [id=\"sidebar-title\"] { |
| 343 | visibility: visible !important; |
| 344 | transition-delay: 0ms !important; |
| 345 | } |
| 346 | "; |
| 347 | }; |
| 348 | }; |
| 349 | |
| 350 | programs.starship = { |
| 351 | enable = true; |
| 352 | settings = { |
| 353 | add_newline = false; |
| 354 | character = { |
| 355 | success_symbol = "[➜](bold green)"; |
| 356 | error_symbol = "[➜](bold red)"; |
| 357 | }; |
| 358 | time = { |
| 359 | disabled = false; |
| 360 | format = "\[ $time \]($style)"; |
| 361 | time_format = "%T"; |
| 362 | }; |
| 363 | }; |
| 364 | }; |
| 365 | |
| 366 | # The home.packages option allows you to install Nix packages into your |
| 367 | # environment. |
| 368 | home.packages = with pkgs; [ |
| 369 | # # Adds the 'hello' command to your environment. It prints a friendly |
| 370 | # # "Hello, world!" when run. |
| 371 | # pkgs.hello |
| 372 | yt-dlp |
| 373 | #pass |
| 374 | rustup |
| 375 | zoxide |
| 376 | nodePackages.pnpm |
| 377 | gcc |
| 378 | aerc |
| 379 | pkg-config |
| 380 | wttrbar |
| 381 | wl-clip-persist |
| 382 | gifski |
| 383 | waypaper |
| 384 | gdu |
| 385 | spotify-player |
| 386 | #hyprpicker |
| 387 | xwayland |
| 388 | xdg-desktop-portal |
| 389 | xdg-desktop-portal-gtk |
| 390 | mpv |
| 391 | imv |
| 392 | libva |
| 393 | libvdpau |
| 394 | #wpaperd |
| 395 | hypridle |
| 396 | #latest.firefox-nightly-bin |
| 397 | eza |
| 398 | wl-mirror |
| 399 | starship |
| 400 | taskwarrior3 |
| 401 | delta |
| 402 | |
| 403 | # Here until i can fix firefox's stupid devtools issue |
| 404 | chromium |
| 405 | |
| 406 | # Wrapped programs for some env variables |
| 407 | (pkgs.writeScriptBin "hyprlock" '' |
| 408 | #! ${pkgs.bash}/bin/bash |
| 409 | export LD_PRELOAD="/run/current-system/profile/lib/libpam.so.0:/run/current-system/profile/lib/libfontconfig.so:$LD_PRELOAD" |
| 410 | exec ${hyprlock.packages.${pkgs.system}.hyprlock}/bin/hyprlock "$@" |
| 411 | '') |
| 412 | |
| 413 | # Flakes specific things defined in flake.nix |
| 414 | hyprland.packages.${pkgs.system}.default |
| 415 | hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland |
| 416 | nixgl.packages.${pkgs.system}.nixGLIntel |
| 417 | wpaperd.packages.${pkgs.system}.wpaperd |
| 418 | hyprpicker-git.packages.${pkgs.system}.hyprpicker |
| 419 | |
| 420 | # Fonts! |
| 421 | noto-fonts |
| 422 | dejavu_fonts |
| 423 | liberation_ttf |
| 424 | noto-fonts-cjk-sans |
| 425 | noto-fonts-emoji |
| 426 | |
| 427 | # # It is sometimes useful to fine-tune packages, for example, by applying |
| 428 | # # overrides. You can do that directly here, just don't forget the |
| 429 | # # parentheses. Maybe you want to install Nerd Fonts with a limited number of |
| 430 | # # fonts? |
| 431 | # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; }) |
| 432 | |
| 433 | # # You can also create simple shell scripts directly inside your |
| 434 | # # configuration. For example, this adds a command 'my-hello' to your |
| 435 | # # environment: |
| 436 | # (pkgs.writeShellScriptBin "my-hello" '' |
| 437 | # echo "Hello, ${config.home.username}!" |
| 438 | # '') |
| 439 | ]; |
| 440 | |
| 441 | # Home Manager is pretty good at managing dotfiles. The primary way to manage |
| 442 | # plain files is through 'home.file'. |
| 443 | home.file = { |
| 444 | # # Building this configuration will create a copy of 'dotfiles/screenrc' in |
| 445 | # # the Nix store. Activating the configuration will then make '~/.screenrc' a |
| 446 | # # symlink to the Nix store copy. |
| 447 | # ".screenrc".source = dotfiles/screenrc; |
| 448 | |
| 449 | # # You can also set the file content immediately. |
| 450 | # ".gradle/gradle.properties".text = '' |
| 451 | # org.gradle.console=verbose |
| 452 | # org.gradle.daemon.idletimeout=3600000 |
| 453 | # ''; |
| 454 | }; |
| 455 | |
| 456 | # You can also manage environment variables but you will have to manually |
| 457 | # source |
| 458 | # |
| 459 | # ~/.nix-profile/etc/profile.d/hm-session-vars.sh |
| 460 | # |
| 461 | # or |
| 462 | # |
| 463 | # /etc/profiles/per-user/ryan/etc/profile.d/hm-session-vars.sh |
| 464 | # |
| 465 | # if you don't want to manage your shell through Home Manager. |
| 466 | home.sessionVariables = { |
| 467 | # EDITOR = "emacs"; |
| 468 | }; |
| 469 | |
| 470 | # Let Home Manager install and manage itself. |
| 471 | programs.home-manager.enable = true; |
| 472 | } |