home-config/nix-home-manager/home.nix

ce1c24e3100d48c9c210eb1ebc5ebadcc6b77659 · 15.9 KB · 446 lines raw

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