dot

vizie's NixOS desktop: Hyprland, CachyOS kernel and gaming tweaks

151 lines5132 bytesNix
1# Settings for the apps you use directly: terminal, launcher, editor, browser.
2{
3 config,
4 lib,
5 ...
6}:
7let
8 inherit (config.lib.dot) link;
9in
10{
11 programs.kitty = {
12 enable = true;
13 settings = {
14 background_opacity = 0;
15 font_size = 12;
16 # JetBrains Mono isn't installed (see fonts.packages in
17 # modules/nixos/desktop.nix), so kitty falls back to Noto Sans Mono.
18 font_family = "JetBrainsMono Nerd Font";
19 bold_font = "JetBrains Mono Bold";
20 italic_font = "JetBrains Mono Italic";
21 bold_italic_font = "JetBrains Mono Bold Italic";
22 disable_ligatures = "never";
23 window_padding_width = 10;
24 term = "xterm-256color";
25 # Do not restore the last window size or maximized state on startup; the
26 # tiling window manager decides the size. Otherwise one kitty closed while
27 # maximized makes every new one open maximized.
28 remember_window_size = false;
29
30 color0 = "#292d3e";
31 color1 = "#ff8288";
32 color2 = "#b4e88d";
33 color3 = "#f4d69f";
34 color4 = "#82aaff";
35 color5 = "#e9c1ff";
36 color6 = "#89ebff";
37 color7 = "#d0d0d0";
38 color8 = "#434758";
39 color9 = "#ff8b92";
40 color10 = "#ddffa7";
41 color11 = "#ffe585";
42 color12 = "#9cc4ff";
43 color13 = "#ddb0f6";
44 color14 = "#a3f7ff";
45 color15 = "#ffffff";
46 };
47 };
48
49 # Hyprland's mod + Return runs config/fuzzel/launch (linked in files.nix),
50 # which puts the apps in config/fuzzel/favorites at the top.
51 programs.fuzzel = {
52 enable = true;
53 settings = {
54 main = {
55 font = "NotoSansM Nerd Font Propo:size=12";
56 # Size fonts like GTK apps do (96 DPI) rather than by the monitors' real
57 # DPI, which made everything bigger.
58 dpi-aware = "no";
59 terminal = lib.getExe config.programs.kitty.package;
60 # Same icon theme as Qt/KDE (theming.nix). Without it fuzzel mixes each
61 # app's own icon, in different styles and sizes.
62 icon-theme = config.qt.qt6ctSettings.Appearance.icon_theme;
63 list-executables-in-path = "yes";
64 placeholder = "Search...";
65 line-height = 36;
66 lines = 5;
67 width = 45;
68 horizontal-pad = 25;
69 vertical-pad = 25;
70 inner-pad = 10;
71 };
72
73 # RRGGBBAA. Same near-transparent black as Waybar and the control centre,
74 # over Hyprland's blur (the "launcher" layer rule).
75 colors = {
76 background = "0000001a";
77 text = "f2f2f2cc";
78 prompt = "f2f2f2cc";
79 input = "f2f2f2ff";
80 placeholder = "f2f2f2cc";
81 match = "f4d69fff";
82 selection = "0000001a";
83 selection-text = "f2f2f2ff";
84 selection-match = "f4d69fff";
85 counter = "f2f2f2cc";
86 };
87
88 # Panel 20, rows inside it 10, like the control centre.
89 border = {
90 width = 0;
91 radius = 20;
92 selection-radius = 10;
93 };
94 };
95 };
96
97 # config/nvim/init.lua. With liveConfig it is loaded from the checkout, so an
98 # edit applies the next time nvim starts.
99 programs.neovim = {
100 enable = true;
101 withRuby = false;
102 withPython3 = false;
103 initLua =
104 if config.dot.liveConfig then
105 ''dofile("${config.dot.repoPath}/config/nvim/init.lua")''
106 else
107 builtins.readFile ../../config/nvim/init.lua;
108 };
109
110 # Firefox: the profile restored from CachyOS, kept by its existing folder and
111 # StoreID (its Profile Groups database). Nixpkgs' Firefox runs with
112 # MOZ_LEGACY_PROFILES, so it opens the profile marked default here. Firefox
113 # itself comes from the system (programs.firefox in modules/nixos/apps.nix).
114 programs.firefox = {
115 enable = true;
116 package = null;
117 profiles.default-release = {
118 path = "3b2nokq1.default-release";
119 storeId = "be5ac646";
120 # Written to user.js, which Firefox reads at startup. Setting userChrome
121 # also turns on toolkit.legacyUserProfileCustomizations.stylesheets.
122 settings = {
123 # Restore the previous session.
124 "browser.startup.page" = 3;
125 "browser.sessionstore.resume_from_crash" = true;
126 # Middle mouse scroll.
127 "general.autoScroll" = true;
128 "middlemouse.paste" = false;
129 "general.aboutConfig.enable" = true;
130 "sidebar.animation.enabled" = false;
131 # "image.jxl.enabled" = true;
132
133 # Browser toolbox and devtools.
134 "devtools.chrome.enabled" = true;
135 "devtools.debugger.remote-enabled" = true;
136 "devtools.cache.disabled" = true;
137 "devtools.netmonitor.persistlog" = true;
138 "devtools.webconsole.persistlog" = true;
139 "devtools.webconsole.timestampMessages" = true;
140
141 # Hardware video decoding on NVIDIA via VA-API (libva-nvidia-driver).
142 # Firefox blocks NVIDIA for this by default; needs NVD_BACKEND and
143 # MOZ_DISABLE_RDD_SANDBOX from Hyprland's env (desktop.nix) as well.
144 "media.hardware-video-decoding.force-enabled" = true;
145 "media.ffmpeg.vaapi.enabled" = true;
146 "widget.dmabuf.force-enabled" = true;
147 };
148 userChrome = link "firefox/userChrome.css";
149 };
150 };
151}