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

a04498c0b18d6fdf7e600dd9c8b5e7db781c21f3 · 15.7 KB · 443 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 = "force_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 #titlebar {
218 overflow: hidden;
219 transition: height 0.3s 0.3s !important;
220 }
221 /* Default state: Set initial height to enable animation */
222 #main-window #titlebar { height: 3em !important; }
223 #main-window[uidensity=\"touch\"] #titlebar { height: 3.35em !important; }
224 #main-window[uidensity=\"compact\"] #titlebar { height: 2.7em !important; }
225 /* Hidden state: Hide native tabs strip */
226 #main-window[titlepreface*=\"​\"] #titlebar { height: 0 !important; }
227 /* Hidden state: Fix z-index of active pinned tabs */
228 #main-window[titlepreface*=\"​\"] #tabbrowser-tabs { z-index: 0 !important; }
229
230 /* Sidebery expand on mouse-over and hide otherwise */
231
232 /* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/autohide_sidebar.css made available under Mozilla Public License v. 2.0
233 See the above repository for updates as well as full license text. */
234
235 /* Show sidebar only when the cursor is over it */
236 /* The border controlling sidebar width will be removed so you'll need to modify these values to change width */
237
238 #sidebar-box{
239 --uc-sidebar-width: 60px;
240 --uc-sidebar-hover-width: 230px;
241 --uc-autohide-sidebar-delay: 200ms; /* Wait 0.2s before hiding sidebar */
242 --uc-autohide-transition-duration: 115ms;
243 --uc-autohide-transition-type: linear;
244 --browser-area-z-index-sidebar: 3;
245 position: relative;
246 min-width: var(--uc-sidebar-width) !important;
247 width: var(--uc-sidebar-width) !important;
248 max-width: var(--uc-sidebar-width) !important;
249 z-index: var(--browser-area-z-index-sidebar,3);
250 }
251 #sidebar-box[positionend]{ direction: rtl }
252 #sidebar-box[positionend] > *{ direction: ltr }
253
254 #sidebar-box[positionend]:-moz-locale-dir(rtl){ direction: ltr }
255 #sidebar-box[positionend]:-moz-locale-dir(rtl) > *{ direction: rtl }
256
257 #main-window[sizemode=\"fullscreen\"] #sidebar-box{ --uc-sidebar-width: 1px; }
258
259 #sidebar-splitter{ display: none }
260
261 #sidebar-header{
262 overflow: hidden;
263 color: var(--chrome-color, inherit) !important;
264 padding-inline: 0 !important;
265 }
266
267 #sidebar-header::before,
268 #sidebar-header::after{
269 content: \"\";
270 display: flex;
271 padding-left: 8px;
272 }
273
274 #sidebar-header,
275 #sidebar{
276 transition: min-width var(--uc-autohide-transition-duration) var(--uc-autohide-transition-type) var(--uc-autohide-sidebar-delay) !important;
277 min-width: var(--uc-sidebar-width) !important;
278 will-change: min-width;
279 }
280 #sidebar-box:hover > #sidebar-header,
281 #sidebar-box:hover > #sidebar{
282 min-width: var(--uc-sidebar-hover-width) !important;
283 transition-delay: 0ms !important;
284 }
285
286 .sidebar-panel{
287 background-color: transparent !important;
288 color: var(--newtab-text-primary-color) !important;
289 }
290
291 .sidebar-panel #search-box{
292 -moz-appearance: none !important;
293 background-color: rgba(249,249,250,0.1) !important;
294 color: inherit !important;
295 }
296
297 /* Add sidebar divider and give it background */
298
299 #sidebar,
300 #sidebar-header{
301 background-color: inherit !important;
302 border-inline: 1px solid rgb(80,80,80);
303 border-inline-width: 0px 1px;
304 }
305
306 #sidebar-box:not([positionend]) > :-moz-locale-dir(rtl),
307 #sidebar-box[positionend] > *{
308 border-inline-width: 1px 0px;
309 }
310
311 /* Move statuspanel to the other side when sidebar is hovered so it doesn't get covered by sidebar */
312
313 #sidebar-box:not([positionend]):hover ~ #appcontent #statuspanel{
314 inset-inline: auto 0px !important;
315 }
316 #sidebar-box:not([positionend]):hover ~ #appcontent #statuspanel-label{
317 margin-inline: 0px !important;
318 border-left-style: solid !important;
319 }
320
321 /* Remove the tabs label and move the Sidebary icon to the center of the box */
322 #sidebar-box:hover [id=\"sidebar-icon\"] {
323 transform: translateX(0px) !important;
324 transition-delay: 0ms !important;
325 }
326
327 #sidebar-box [id=\"sidebar-icon\"] {
328 transform: translateX(9px);
329 transition: transform var(--uc-autohide-transition-duration) var(--uc-autohide-transition-type) var(--uc-autohide-sidebar-delay) !important;
330 }
331
332 #sidebar-box [id=\"sidebar-title\"] {
333 visibility: hidden !important;
334 transition: visibility var(--uc-autohide-transition-duration) var(--uc-autohide-transition-type) var(--uc-autohide-sidebar-delay) !important;
335 }
336
337 #sidebar-box:hover [id=\"sidebar-title\"] {
338 visibility: visible !important;
339 transition-delay: 0ms !important;
340 }
341 ";
342 };
343 };
344
345 # The home.packages option allows you to install Nix packages into your
346 # environment.
347 home.packages = with pkgs; [
348 # # Adds the 'hello' command to your environment. It prints a friendly
349 # # "Hello, world!" when run.
350 # pkgs.hello
351 yt-dlp
352 #pass
353 rustup
354 zoxide
355 nodePackages.pnpm
356 gcc
357 aerc
358 pkg-config
359 wttrbar
360 wl-clip-persist
361 gifski
362 waypaper
363 gdu
364 spotify-player
365 hyprpicker
366 xwayland
367 xdg-desktop-portal
368 xdg-desktop-portal-gtk
369 mpv
370 imv
371 libva
372 libvdpau
373 #wpaperd
374 hypridle
375 #latest.firefox-nightly-bin
376 eza
377
378 # Wrapped programs for some env variables
379 (pkgs.writeScriptBin "hyprlock" ''
380 #! ${pkgs.bash}/bin/bash
381 export LD_PRELOAD="/run/current-system/profile/lib/libpam.so.0:/run/current-system/profile/lib/libfontconfig.so:$LD_PRELOAD"
382 exec ${pkgs.hyprlock}/bin/hyprlock "$@"
383 '')
384
385 # Flakes specific things defined in flake.nix
386 hyprland.packages.${pkgs.system}.default
387 hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland
388 nixgl.packages.${pkgs.system}.nixGLIntel
389 wpaperd.packages.${pkgs.system}.wpaperd
390
391 # Fonts!
392 noto-fonts
393 dejavu_fonts
394 liberation_ttf
395 noto-fonts-cjk-sans
396 noto-fonts-emoji
397
398 # # It is sometimes useful to fine-tune packages, for example, by applying
399 # # overrides. You can do that directly here, just don't forget the
400 # # parentheses. Maybe you want to install Nerd Fonts with a limited number of
401 # # fonts?
402 # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
403
404 # # You can also create simple shell scripts directly inside your
405 # # configuration. For example, this adds a command 'my-hello' to your
406 # # environment:
407 # (pkgs.writeShellScriptBin "my-hello" ''
408 # echo "Hello, ${config.home.username}!"
409 # '')
410 ];
411
412 # Home Manager is pretty good at managing dotfiles. The primary way to manage
413 # plain files is through 'home.file'.
414 home.file = {
415 # # Building this configuration will create a copy of 'dotfiles/screenrc' in
416 # # the Nix store. Activating the configuration will then make '~/.screenrc' a
417 # # symlink to the Nix store copy.
418 # ".screenrc".source = dotfiles/screenrc;
419
420 # # You can also set the file content immediately.
421 # ".gradle/gradle.properties".text = ''
422 # org.gradle.console=verbose
423 # org.gradle.daemon.idletimeout=3600000
424 # '';
425 };
426
427 # You can also manage environment variables but you will have to manually
428 # source
429 #
430 # ~/.nix-profile/etc/profile.d/hm-session-vars.sh
431 #
432 # or
433 #
434 # /etc/profiles/per-user/ryan/etc/profile.d/hm-session-vars.sh
435 #
436 # if you don't want to manage your shell through Home Manager.
437 home.sessionVariables = {
438 # EDITOR = "emacs";
439 };
440
441 # Let Home Manager install and manage itself.
442 programs.home-manager.enable = true;
443 }