summaryrefslogtreecommitdiff
path: root/home-config/nix-home-manager/home.nix
blob: d7089dc9b3a0c724e1a3b69fa0e9974ca6bf3572 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
{ config, pkgs, hyprland, nixgl, wpaperd, hyprpicker-git, hyprlock, ... }:
    let
        lock-false = {
            Value = false;
            Status = "locked";
        };
        lock-true = {
            Value = true;
            Status = "locked";
        };
    in
{
  # Home Manager needs a bit of information about you and the paths it should
  # manage.
  home.username = "ryan";
  home.homeDirectory = "/home/ryan";

  # Ignore news
  news.display = "silent";

  # This value determines the Home Manager release that your configuration is
  # compatible with. This helps avoid breakage when a new Home Manager release
  # introduces backwards incompatible changes.
  #
  # You should not change this value, even if you update Home Manager. If you do
  # want to update the value, then make sure to first check the Home Manager
  # release notes.
  home.stateVersion = "23.11"; # Please read the comment before changing.

  # This value will set some environment variables to allow home-manager to
  # function better outside of NixOS
  nixpkgs.config.allowUnfree = true;
  #targets.genericLinux.enable = true;
  fonts.fontconfig.enable = true;
  fonts.fontconfig.defaultFonts = {
    monospace = [ "DejaVu Sans Mono" ];
    sansSerif = [ "DejaVu Sans" ];
    serif = [ "DejaVu Serif" ];
  };

  # wayland.windowManager.hyprland.enable = true;

  # Install firefox and add some customizations
  programs.firefox = {
    enable = true;
    policies = {
        EnableTrackingProtection = {
            Value = true;
            Locked = true;
            Cryptomining = true;
            Fingerprinting = true;
            EmailTracking = true;
        };
        UserMessaging = {
            WhatsNew = false;
            ExtensionRecommendations = false;
            FeatureRecommendations = false;
            UrlbarInterventions = false;
            SkipOnboarding = true;
            MoreFromMozilla = false;
            Labs = false;
            Locked = true;
        };
        DisableAppUpdate = true;
        DisableAccounts = true;
        DisableFirefoxAccounts = true;
        DisableFirefoxStudies = true;
        DisablePocket = true;
        DisableTelemetry = true;
        AutofillAddressEnabled = false;
        AutofillCreditCardEnabled = false;
        DisableMasterPasswordCreation = true;
        PasswordManagerEnabled = false;
        PrimaryPassword = false;
        OfferToSaveLogins = false;
        NoDefaultBookmarks = true;
        OverrideFirstRunPage = "";
        OverridePostUpdatePage = "";
        FirefoxHome = {
            Search = true;
            TopSites = true;
            SponsoredTopSites = false;
            Highlights = false;
            Pocket = false;
            SponsoredPocket = false;
            Snippets = false;
            Locked = true;
        };
        SearchSuggestEnabled = true;
        FirefoxSuggest = {
            WebSuggestions = true;
            SponsoredSuggestions = false;
            ImproveSuggest = false;
            Locked = true;
        };
        PictureInPicture = lock-true;
        HardwareAcceleration = true;
        Certificates = {
            ImportEnterpriseRoots = true;
        };
        ExtensionSettings = {
            #"*".installation_mode = "blocked";
            # uBlock Origin
            "uBlock0@raymondhill.net" = {
                install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
                installation_mode = "force_installed";
            };
            # Bitwarden
            "{446900e4-71c2-419f-a6a7-df9c091e268b}" = {
                install_url = "https://addons.mozilla.org/firefox/downloads/latest/bitwarden-password-manager/latest.xpi";
                installation_mode = "normal_installed";
            };
            # SponsorBlock
            "sponsorBlocker@ajay.app" = {
                install_url = "https://addons.mozilla.org/firefox/downloads/latest/sponsorblock/latest.xpi";
                installation_mode = "force_installed";
            };
            # DeArrow
            "deArrow@ajay.app" = {
                install_url = "https://addons.mozilla.org/firefox/downloads/latest/dearrow/latest.xpi";
                installation_mode = "force_installed";
            };
            # Return Youtube Dislike
            "{762f9885-5a13-4abd-9c77-433dcd38b8fd}" = {
                install_url = "https://addons.mozilla.org/firefox/downloads/latest/return-youtube-dislikes/latest.xpi";
                installation_mode = "force_installed";
            };
            # Youtube Nonstop
            "{0d7cafdd-501c-49ca-8ebb-e3341caaa55e}" = {
                install_url = "https://addons.mozilla.org/firefox/downloads/latest/youtube-nonstop/latest.xpi";
                installation_mode = "force_installed";
            };
            # Sidebery
            "{3c078156-979c-498b-8990-85f7987dd929}" = {
                install_url = "https://addons.mozilla.org/firefox/downloads/latest/sidebery/latest.xpi";
                installation_mode = "normal_installed";
            };
            # TamperMonkey
            "firefox@tampermonkey.net" = {
                install_url = "https://addons.mozilla.org/firefox/downloads/latest/tampermonkey/latest.xpi";
                installation_mode = "force_installed";
            };
            # Floccus
            "floccus@handmadeideas.org" = {
                install_url = "https://addons.mozilla.org/firefox/downloads/latest/floccus/latest.xpi";
                installation_mode = "force_installed";
            };
        };
        Preferences = {
            "browser.startup.homepage" = "https://d.in.rschanz.org";
            "extensions.activeThemeID" = {
                Value = "firefox-compact-dark@mozilla.org";
                Status = "locked";
            };
            "toolkit.legacyUserProfileCustomizations.stylesheets" = lock-true;
            "xpinstall.whitelist.required" = lock-true;
            "dom.webgpu.enabled" = lock-true;
            "media.eme.enabled" = lock-true;
            "general.autoScroll" = lock-true;
            "general.smoothScroll" = lock-true;
            "browser.crashReports.unsubmittedCheck.autoSubmit2" = lock-false;
            "browser.aboutConfig.showWarning" = lock-false;
        };
    };
    profiles.${config.home.username} = {
        name = "${config.home.username}";
        isDefault = true;
        containersForce = true;
        containers = {
            rit = {
                name = "RIT";
                color = "orange";
                icon = "dollar";
                id = 1;
            };
            ritwork = {
                name = "RIT Work";
                color = "green";
                icon = "briefcase";
                id = 2;
            };
            other = {
                name = "Other";
                color = "blue";
                icon = "fingerprint";
                id = 3;
            };
        };
        search = {
            force = true;
            default = "DuckDuckGo";
            order = ["DuckDuckGo" "Google"];
            engines = {
                "Nix Packages" = {
                    urls = [
                        {
                            template = "https://search.nixos.org/packages";
                            params = [
                                {
                                    name = "type";
                                    value = "packages";
                                }
                                {
                                    name = "channel";
                                    value = "unstable";
                                }
                                {
                                    name = "query";
                                    value = "{searchTerms}";
                                }
                            ];
                        }
                    ];
                    icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
                    definedAliases = ["@np"];
                };
            };
        };
        userChrome = "
        #main-window .toolbar-items {
            overflow: hidden;
        transition: height 0.3s 0.3s !important;
        }
        /* Default state: Set initial height to enable animation */
        #main-window .toolbar-items { height: 3em !important; }
        #main-window .titlebar-button { height: 3em !important; }
        #main-window[uidensity=\"touch\"] .toolbar-items { height: 3.35em !important; }
        #main-window[uidensity=\"compact\"] .toolbar-items { height: 2.7em !important; }
        /* Hidden state: Hide native tabs strip */
        #main-window[titlepreface*=\"\"] .toolbar-items { height: 0 !important; }
        #main-window[titlepreface*=\"\"] .titlebar-button { height: 0 !important; }
        /* Hidden state: Fix z-index of active pinned tabs */
        #main-window[titlepreface*=\"\"] #tabbrowser-tabs { z-index: 0 !important; }

        /* Sidebery expand on mouse-over and hide otherwise */

        /* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/autohide_sidebar.css made available under Mozilla Public License v. 2.0
        See the above repository for updates as well as full license text. */

        /* Show sidebar only when the cursor is over it  */
        /* The border controlling sidebar width will be removed so you'll need to modify these values to change width */

        #sidebar-box{
          --uc-sidebar-width: 60px;
          --uc-sidebar-hover-width: 230px;
          --uc-autohide-sidebar-delay: 200ms; /* Wait 0.2s before hiding sidebar */
          --uc-autohide-transition-duration: 115ms;
          --uc-autohide-transition-type: linear;
          --browser-area-z-index-sidebar: 3;
          position: relative;
          min-width: var(--uc-sidebar-width) !important;
          width: var(--uc-sidebar-width) !important;
          max-width: var(--uc-sidebar-width) !important;
          z-index: var(--browser-area-z-index-sidebar,3);
        }
        #sidebar-box[positionend]{ direction: rtl }
        #sidebar-box[positionend] > *{ direction: ltr }

        #sidebar-box[positionend]:-moz-locale-dir(rtl){ direction: ltr }
        #sidebar-box[positionend]:-moz-locale-dir(rtl) > *{ direction: rtl }

        #main-window[sizemode=\"fullscreen\"] #sidebar-box{ --uc-sidebar-width: 1px; }

        #sidebar-splitter{ display: none }

        #sidebar-header{
          overflow: hidden;
          color: var(--chrome-color, inherit) !important;
          padding-inline: 0 !important;
        }

        #sidebar-header::before,
        #sidebar-header::after{
          content: \"\";
          display: flex;
          padding-left: 8px;
        }

        #sidebar-header,
        #sidebar{
          transition: min-width var(--uc-autohide-transition-duration) var(--uc-autohide-transition-type) var(--uc-autohide-sidebar-delay) !important;
          min-width: var(--uc-sidebar-width) !important;
          will-change: min-width;
        }
        #sidebar-box:hover > #sidebar-header,
        #sidebar-box:hover > #sidebar{
          min-width: var(--uc-sidebar-hover-width) !important;
          transition-delay: 0ms !important;
        }

        .sidebar-panel{
          background-color: transparent !important;
          color: var(--newtab-text-primary-color) !important;
        }

        .sidebar-panel #search-box{
          -moz-appearance: none !important;
          background-color: rgba(249,249,250,0.1) !important; 
          color: inherit !important;
        }

        /* Add sidebar divider and give it background */

        #sidebar,
        #sidebar-header{
          background-color: inherit !important;
          border-inline: 1px solid rgb(80,80,80);
          border-inline-width: 0px 1px;
        }

        #sidebar-box:not([positionend]) > :-moz-locale-dir(rtl),
        #sidebar-box[positionend] > *{
          border-inline-width: 1px 0px;
        }

        /* Move statuspanel to the other side when sidebar is hovered so it doesn't get covered by sidebar */

        #sidebar-box:not([positionend]):hover ~ #appcontent #statuspanel{
          inset-inline: auto 0px !important;
        }
        #sidebar-box:not([positionend]):hover ~ #appcontent #statuspanel-label{
          margin-inline: 0px !important;
          border-left-style: solid !important; 
        }

        /* Remove the tabs label and move the Sidebary icon to the center of the box */
        #sidebar-box:hover [id=\"sidebar-icon\"] {
            transform: translateX(0px) !important;
            transition-delay: 0ms !important;
        }

        #sidebar-box [id=\"sidebar-icon\"] {
            transform: translateX(9px);
            transition: transform var(--uc-autohide-transition-duration) var(--uc-autohide-transition-type) var(--uc-autohide-sidebar-delay) !important;
        }

        #sidebar-box [id=\"sidebar-title\"] {
            visibility: hidden !important;
            transition: visibility var(--uc-autohide-transition-duration) var(--uc-autohide-transition-type) var(--uc-autohide-sidebar-delay) !important;
        }

        #sidebar-box:hover [id=\"sidebar-title\"] {
            visibility: visible !important;
            transition-delay: 0ms !important;
        }
        ";
    };
};

  programs.starship = {
    enable = true;
    settings = {
        add_newline = false;
        character = {
            success_symbol = "[➜](bold green)";
            error_symbol = "[➜](bold red)";
        };
        time = {
            disabled = false;
            format = "\[ $time \]($style)";
            time_format = "%T";
        };
    };
  };

  # The home.packages option allows you to install Nix packages into your
  # environment.
  home.packages = with pkgs; [
    # # Adds the 'hello' command to your environment. It prints a friendly
    # # "Hello, world!" when run.
    # pkgs.hello
    yt-dlp
    #pass
    rustup
    zoxide
    nodePackages.pnpm
    gcc
    aerc
    pkg-config
    wttrbar
    wl-clip-persist
    gifski
    waypaper
    gdu
    spotify-player
    #hyprpicker
    xwayland
    xdg-desktop-portal
    xdg-desktop-portal-gtk
    mpv
    imv
    libva
    libvdpau
    #wpaperd
    hypridle
    #latest.firefox-nightly-bin
    eza
    wl-mirror
    starship
    taskwarrior3
    delta

    # Here until i can fix firefox's stupid devtools issue
    chromium

    # Wrapped programs for some env variables
    (pkgs.writeScriptBin "hyprlock" ''
      #! ${pkgs.bash}/bin/bash
      export LD_PRELOAD="/run/current-system/profile/lib/libpam.so.0:/run/current-system/profile/lib/libfontconfig.so:$LD_PRELOAD"
      exec ${hyprlock.packages.${pkgs.system}.hyprlock}/bin/hyprlock "$@"
    '')

    # Flakes specific things defined in flake.nix
    hyprland.packages.${pkgs.system}.default
    hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland
    nixgl.packages.${pkgs.system}.nixGLIntel
    wpaperd.packages.${pkgs.system}.wpaperd
    hyprpicker-git.packages.${pkgs.system}.hyprpicker

    # Fonts!
    noto-fonts
    dejavu_fonts
    liberation_ttf
    noto-fonts-cjk-sans
    noto-fonts-emoji

    # # It is sometimes useful to fine-tune packages, for example, by applying
    # # overrides. You can do that directly here, just don't forget the
    # # parentheses. Maybe you want to install Nerd Fonts with a limited number of
    # # fonts?
    # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })

    # # You can also create simple shell scripts directly inside your
    # # configuration. For example, this adds a command 'my-hello' to your
    # # environment:
    # (pkgs.writeShellScriptBin "my-hello" ''
    #   echo "Hello, ${config.home.username}!"
    # '')
  ];

  # Home Manager is pretty good at managing dotfiles. The primary way to manage
  # plain files is through 'home.file'.
  home.file = {
    # # Building this configuration will create a copy of 'dotfiles/screenrc' in
    # # the Nix store. Activating the configuration will then make '~/.screenrc' a
    # # symlink to the Nix store copy.
    # ".screenrc".source = dotfiles/screenrc;

    # # You can also set the file content immediately.
    # ".gradle/gradle.properties".text = ''
    #   org.gradle.console=verbose
    #   org.gradle.daemon.idletimeout=3600000
    # '';
  };

  # You can also manage environment variables but you will have to manually
  # source
  #
  #  ~/.nix-profile/etc/profile.d/hm-session-vars.sh
  #
  # or
  #
  #  /etc/profiles/per-user/ryan/etc/profile.d/hm-session-vars.sh
  #
  # if you don't want to manage your shell through Home Manager.
  home.sessionVariables = {
    # EDITOR = "emacs";
  };

  # Let Home Manager install and manage itself.
  programs.home-manager.enable = true;
}