summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/gkleen@sif/default.nix')
-rw-r--r--accounts/gkleen@sif/default.nix719
1 files changed, 274 insertions, 445 deletions
diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix
index 23525791..a1a694ea 100644
--- a/accounts/gkleen@sif/default.nix
+++ b/accounts/gkleen@sif/default.nix
@@ -4,33 +4,6 @@ with lib;
4 4
5let 5let
6 cfg = config.home-manager.users.${userName}; 6 cfg = config.home-manager.users.${userName};
7 emacsScratch = pkgs.stdenv.mkDerivation (sources.emacs-scratch_el // rec {
8 phases = [ "installPhase" ];
9
10 installPhase = ''
11 mkdir -p $out/share/emacs/site-lisp
12 cp $src/scratch.el $out/share/emacs/site-lisp/default.el
13 '';
14 });
15 muteScript = pkgs.stdenv.mkDerivation {
16 name = "mute";
17 src = ./scripts/mute.zsh;
18
19 buildInputs = with pkgs; [ makeWrapper ];
20
21 phases = [ "installPhase" ];
22
23 installPhase = ''
24 mkdir -p $out/bin
25 install -m 0755 $src $out/bin/mute
26 wrapProgram $out/bin/mute \
27 --prefix PATH : ${pkgs.zsh}/bin \
28 --prefix PATH : ${pkgs.findutils}/bin \
29 --prefix PATH : ${pkgs.util-linux}/bin \
30 --prefix PATH : ${pkgs.coreutils}/bin \
31 --prefix PATH : ${pkgs.pulseaudio}/bin
32 '';
33 };
34 wrapElectron = { package, bin ? package.meta.mainProgram or package.pname or (pkgs.lib.strings.nameFromURL package.name "-"), outBin ? bin, sandbox ? true }: pkgs.symlinkJoin { 7 wrapElectron = { package, bin ? package.meta.mainProgram or package.pname or (pkgs.lib.strings.nameFromURL package.name "-"), outBin ? bin, sandbox ? true }: pkgs.symlinkJoin {
35 name = "${package.name}-wrapped"; 8 name = "${package.name}-wrapped";
36 buildInputs = with pkgs; [ makeWrapper ]; 9 buildInputs = with pkgs; [ makeWrapper ];
@@ -47,10 +20,6 @@ let
47 ''; 20 '';
48 }; 21 };
49 22
50 wrappedChrome = wrapElectron { package = pkgs.google-chrome; outBin = "google-chrome"; };
51 wrappedZulip = wrapElectron { package = pkgs.zulip; bin = "zulip"; outBin = "zulip"; };
52 wrappedElementDesktop = wrapElectron { package = pkgs.element-desktop; bin = "element-desktop"; };
53 wrappedRocketChatDesktop = wrapElectron { package = pkgs.rocketchat-desktop; bin = "rocketchat-desktop"; outBin = "rocketchat"; };
54 wrappedYTMDesktop = wrapElectron { package = pkgs.ytmdesktop; sandbox = false; }; 23 wrappedYTMDesktop = wrapElectron { package = pkgs.ytmdesktop; sandbox = false; };
55 24
56 wrappedKeepassxc = pkgs.symlinkJoin { 25 wrappedKeepassxc = pkgs.symlinkJoin {
@@ -63,7 +32,7 @@ let
63 text = '' 32 text = ''
64 [D-BUS Service] 33 [D-BUS Service]
65 Name=org.keepassxc.KeePassXC.MainWindow 34 Name=org.keepassxc.KeePassXC.MainWindow
66 Exec=${pkgs.coreutils}/bin/false 35 Exec=${lib.getExe' pkgs.coreutils "false"}
67 SystemdService=keepassxc.service 36 SystemdService=keepassxc.service
68 ''; 37 '';
69 }) 38 })
@@ -73,35 +42,46 @@ let
73 text = '' 42 text = ''
74 [D-BUS Service] 43 [D-BUS Service]
75 Name=org.freedesktop.secrets 44 Name=org.freedesktop.secrets
76 Exec=${pkgs.coreutils}/bin/false 45 Exec=${lib.getExe' pkgs.coreutils "false"}
77 SystemdService=keepassxc.service 46 SystemdService=keepassxc.service
78 ''; 47 '';
79 }) 48 })
80 ]; 49 ];
81 }; 50 };
82 51
83 lockCommand = "${config.systemd.package}/bin/systemctl --user start gtklock.service"; 52 lockCommand = "${lib.getExe' config.systemd.package "systemctl"} --user start gtklock.service";
53
54 editor = pkgs.symlinkJoin {
55 inherit (cfg.services.emacs.package) name;
56 buildInputs = with pkgs; [ makeWrapper ];
57 paths = [ cfg.services.emacs.package ];
58 postBuild = ''
59 wrapProgram $out/bin/emacsclient \
60 --inherit-argv0 \
61 --add-flags ${lib.escapeShellArg (lib.escapeShellArgs cfg.services.emacs.client.arguments)}
62 '';
63 };
84in { 64in {
85 imports = with flake.nixosModules.userProfiles.${userName}; [ 65 imports = with flake.nixosModules.userProfiles.${userName}; [
86 mpv yt-dlp (args: import ./xcompose.nix (inputs // args)) 66 zsh tmux mpv yt-dlp (args: import ./xcompose.nix (inputs // args))
87 ]; 67 ];
88 68
89 config = { 69 config = {
90 services.displayManager.defaultSession = "Hyprland"; # "none+xmonad";
91
92 home-manager.users.${userName} = { 70 home-manager.users.${userName} = {
93 imports = [ 71 imports = [
94 ./libvirt 72 ./libvirt
73 ./niri
74 ./synadm
95 flakeInputs.nix-index-database.hmModules.nix-index 75 flakeInputs.nix-index-database.hmModules.nix-index
96 flakeInputs.impermanence.nixosModules.home-manager.impermanence 76 flakeInputs.impermanence.nixosModules.home-manager.impermanence
97 ]; 77 ];
98 78
99 home.stateVersion = "20.09"; 79 home.stateVersion = "20.09";
100 80
101 nixpkgs.config = { 81 # nixpkgs.config = {
102 allowUnfree = true; 82 # allowUnfree = true;
103 zathura.useMupdf = false; 83 # zathura.useMupdf = false;
104 }; 84 # };
105 85
106 nix.registry = { 86 nix.registry = {
107 "flk" = { 87 "flk" = {
@@ -111,14 +91,14 @@ in {
111 }; 91 };
112 to = { 92 to = {
113 type = "git"; 93 type = "git";
114 url = "file:///home/gkleen/config/nixos-flakes"; 94 url = "file:///home/gkleen/projects/machines";
115 }; 95 };
116 }; 96 };
117 }; 97 };
118 98
119 programs = { 99 programs = {
120 ssh = { 100 ssh = {
121 matchBlocks = import ./ssh-hosts.nix { inherit pkgs; }; # customUtils.nixImport { dir = ./ssh-hosts; }; 101 matchBlocks = import ./ssh-hosts.nix inputs; # customUtils.nixImport { dir = ./ssh-hosts; };
122 extraConfig = '' 102 extraConfig = ''
123 Match host uniworx3.ifi.lmu.de,uniworx4.ifi.lmu.de,uniworx5.ifi.lmu.de,uni2workgw.ifi.lmu.de,blackbeard.tcs.ifi.lmu.de,gitlab2.rz.ifi.lmu.de,oregon.tcs.ifi.lmu.de !exec "nc -z -w 1 %h %p &>/dev/null" 103 Match host uniworx3.ifi.lmu.de,uniworx4.ifi.lmu.de,uniworx5.ifi.lmu.de,uni2workgw.ifi.lmu.de,blackbeard.tcs.ifi.lmu.de,gitlab2.rz.ifi.lmu.de,oregon.tcs.ifi.lmu.de !exec "nc -z -w 1 %h %p &>/dev/null"
124 ProxyJump remote.cip.ifi.lmu.de 104 ProxyJump remote.cip.ifi.lmu.de
@@ -136,8 +116,8 @@ in {
136 ''} 116 ''}
137 117
138 Match host *.mathinst.loc,*.math.lmu.de !host ssh.math.lmu.de !exec "nc -z -w 1 %h %p &>/dev/null" 118 Match host *.mathinst.loc,*.math.lmu.de !host ssh.math.lmu.de !exec "nc -z -w 1 %h %p &>/dev/null"
139 # ProxyCommand ${pkgs.socat}/bin/socat - SOCKS4A:127.0.0.1:%h:%p,socksport=8118 119 ProxyCommand ${lib.getExe pkgs.socat} - SOCKS4A:127.0.0.1:%h:%p,socksport=8118
140 ProxyJump ssh.math.lmu.de 120 # ProxyJump ssh.math.lmu.de
141 121
142 Match host *.cipmath.loc !host cip04.cipmath.loc,mgmt-cls01.cipmath.loc !exec "nc -z -w 1 %h %p &>/dev/null" 122 Match host *.cipmath.loc !host cip04.cipmath.loc,mgmt-cls01.cipmath.loc !exec "nc -z -w 1 %h %p &>/dev/null"
143 ProxyJump cip04 123 ProxyJump cip04
@@ -154,22 +134,31 @@ in {
154 134
155 emacs = { 135 emacs = {
156 enable = true; 136 enable = true;
157 package = pkgs.emacs29-pgtk; 137 package = pkgs.emacs-pgtk;
158 extraPackages = epkgs: with epkgs; [ 138 extraPackages = epkgs: with epkgs; [
159 evil evil-dvorak undo-tree magit haskell-tng-mode nix-mode 139 evil evil-dvorak undo-tree magit haskell-tng-mode nix-mode
160 yaml-mode json-mode shakespeare-mode smart-mode-line 140 yaml-mode json-mode shakespeare-mode smart-mode-line
161 highlight-parentheses highlight-symbol ag sass-mode lua-mode 141 highlight-parentheses highlight-symbol ag sass-mode
162 fira-code-mode use-package wanderlust # notmuch 142 lua-mode fira-code-mode use-package wanderlust # notmuch
163 git-gutter emacsScratch 143 git-gutter scratch edit-server mediawiki editorconfig
164 edit-server mediawiki editorconfig typescript-mode 144 typescript-mode markdown-mode nftables-mode rustic
165 markdown-mode nftables-mode rustic lsp-mode lsp-ui 145 lsp-mode lsp-ui direnv company projectile
166 direnv company projectile tomorrow-night-paradise-theme 146 tomorrow-night-paradise-theme
167 treesit-grammars.with-all-grammars magit-delta scad-mode 147 treesit-grammars.with-all-grammars magit-delta scad-mode
168 ]; 148 ];
169 overrides = self: super: { 149 overrides = self: super: {
170 tomorrow-night-paradise-theme = super.trivialBuild { 150 tomorrow-night-paradise-theme = super.trivialBuild {
171 inherit (sources.tomorrow-night-paradise-theme) pname version src; 151 inherit (sources.tomorrow-night-paradise-theme) pname version src;
172 }; 152 };
153 scratch = pkgs.stdenv.mkDerivation {
154 inherit (sources.emacs-scratch_el) pname version src;
155
156 phases = [ "unpackPhase" "installPhase" ];
157
158 installPhase = ''
159 install -Dt $out/share/emacs/site-lisp scratch.el
160 '';
161 };
173 }; 162 };
174 }; 163 };
175 firefox = { 164 firefox = {
@@ -183,8 +172,14 @@ in {
183 }; 172 };
184 }; 173 };
185 }; 174 };
175 chromium.enable = true;
186 176
187 zathura.enable = true; 177 zathura = {
178 enable = true;
179 options = {
180 scroll-page-aware = true;
181 };
182 };
188 imv.enable = true; 183 imv.enable = true;
189 184
190 mpv.config = { 185 mpv.config = {
@@ -193,13 +188,91 @@ in {
193 gpu-api = "vulkan"; 188 gpu-api = "vulkan";
194 }; 189 };
195 190
196 zsh.initExtra = '' 191 zsh.initContent = let
197 source ${./zshrc} 192 zshrc = pkgs.resholve.mkDerivation {
193 pname = "zshrc";
194 version = "0.0.0";
195
196 src = ./zshrc;
197
198 dontUnpack = true;
199 dontConfigure = true;
200 dontBuild = true;
201
202 installPhase = ''
203 mkdir -p $out/share
204 install "$src" $out/share/zshrc
205 '';
206
207 solutions = {
208 default = {
209 scripts = [ "share/zshrc" ];
210 interpreter = "none";
211 inputs = with pkgs; [
212 coreutils
213 rpm
214 binutils
215 squashfsTools
216 unzip
217 cfg.programs.git.package
218 magickWrapped
219 curl
220 file
221 gnutar
222 cpio
223 magic-wormhole
224 cfg.programs.zsh.package
225 fuse
226 util-linux
227 findutils
228 qrencode
229 tty-clock
230 cfg.programs.jq.package
231 eza
232 less
233 config.systemd.package
234 config.programs.ssh.package
235 gnused
236 miniserve
237 ];
238 execer = with pkgs; [
239 "cannot:${lib.getExe' rpm "rpm2cpio"}"
240 "cannot:${lib.getExe' squashfsTools "unsquashfs"}"
241 "cannot:${lib.getExe' unzip "unzip"}"
242 "cannot:${lib.getExe cfg.programs.git.package}"
243 "cannot:${lib.getExe cpio}"
244 "cannot:${lib.getExe' magic-wormhole "wormhole"}"
245 "cannot:${lib.getExe' fuse "fusermount"}"
246 "cannot:${lib.getExe less}"
247 "cannot:${lib.getExe' config.systemd.package "systemctl"}"
248 "cannot:${lib.getExe config.programs.ssh.package}"
249 ];
250 wrapper = with pkgs; [
251 "${lib.getExe' magickWrapped "magick"}:${lib.getExe' imagemagick "magick"}"
252 ];
253 fake = {
254 builtin = ["print"];
255 external = ["sudo" "umount"];
256 };
257 };
258 };
259 };
260 magickWrapped = pkgs.symlinkJoin {
261 inherit (pkgs.imagemagick) name;
262 paths = [ pkgs.imagemagick ];
263
264 buildInputs = with pkgs; [ makeWrapper ];
265 postBuild = ''
266 wrapProgram $out/bin/magick \
267 --prefix PATH : ${lib.makeBinPath (with pkgs; [ ghostscript ])}
268 '';
269 };
270 in ''
271 source ${zshrc}/share/zshrc
198 ''; 272 '';
199 zsh.dirHashes = let 273 zsh.dirHashes = let
200 flakeHashes = mapAttrs' (n: v: nameValuePair (inputNames.${n} or n) (toString v)) flakeInputs; 274 flakeHashes = mapAttrs' (n: v: nameValuePair (inputNames.${n} or n) (toString v)) flakeInputs;
201 inputNames = { 275 inputNames = {
202 "nixpkgs" = "nixos";
203 }; 276 };
204 in flakeHashes // { 277 in flakeHashes // {
205 u2w = "$HOME/projects/uni2work"; 278 u2w = "$HOME/projects/uni2work";
@@ -211,6 +284,16 @@ in {
211 pro = "$HOME/projects/pro"; 284 pro = "$HOME/projects/pro";
212 media = "$HOME/media"; 285 media = "$HOME/media";
213 }; 286 };
287 jq.colors = {
288 arrays = "1;37";
289 "false" = "0;37";
290 "null" = "2;37";
291 numbers = "0;37";
292 objectKeys = "1;34";
293 objects = "1;37";
294 strings = "0;32";
295 "true" = "0;37";
296 };
214 297
215 obs-studio = { 298 obs-studio = {
216 enable = true; 299 enable = true;
@@ -220,7 +303,7 @@ in {
220 gh = { 303 gh = {
221 enable = true; 304 enable = true;
222 settings = { 305 settings = {
223 editor = "${config.home-manager.users.${userName}.programs.emacs.package}/bin/emacsclient"; 306 editor = lib.getExe' editor "emacsclient";
224 gitProtocol = "ssh"; 307 gitProtocol = "ssh";
225 }; 308 };
226 }; 309 };
@@ -246,310 +329,23 @@ in {
246 # notify_on_cmd_finish = "invisible 120"; 329 # notify_on_cmd_finish = "invisible 120";
247 }; 330 };
248 keybindings = { 331 keybindings = {
249 "kitty_mod+n" = "detach_window"; 332 "kitty_mod+n" = "new_os_window_with_cwd";
250 "kitty_mod+m" = "detach_window ask"; 333 "kitty_mod+m" = "detach_window ask";
251 }; 334 "kitty_mod+enter" = "new_window_with_cwd";
252 }; 335 "kitty_mod+t" = "new_tab_with_cwd";
253 waybar = {
254 enable = true;
255 systemd = {
256 enable = true;
257 target = "hyprland-session.target";
258 };
259 settings = let
260 windowRewrites = {
261 "(.*) — Mozilla Firefox" = "$1";
262 "(.*) - Mozilla Thunderbird" = "$1";
263 "(.*) - mpv" = "$1";
264 };
265 iconSize = 11;
266 in [
267 {
268 layer = "top";
269 position = "top";
270 height = 14;
271 output = [ "eDP-1" "DP-2" "DP-3" ];
272 modules-left = [ "hyprland/workspaces" ];
273 modules-center = [ "hyprland/window" ];
274 modules-right = [ # "custom/worktime" "custom/worktime-today"
275 "custom/weather" "custom/keymap" "privacy" "tray" "wireplumber" "backlight" "battery" "idle_inhibitor" "clock" ];
276
277 "custom/weather" = {
278 format = "{}";
279 tooltip = true;
280 interval = 3600;
281 exec = "${lib.getExe pkgs.wttrbar} --hide-conditions --nerd --custom-indicator \"<span font=\\\"Symbols Nerd Font Mono\\\" size=\\\"120%\\\">{ICON}</span> {FeelsLikeC}°\"";
282 return-type = "json";
283 };
284 "custom/keymap" = {
285 format = "{}";
286 tooltip = true;
287 return-type = "json";
288 exec = pkgs.writers.writePython3 "keymap" {} ''
289 import os
290 import socket
291 import re
292 import subprocess
293 import json
294
295
296 def output(keymap):
297 short = keymap
298 if keymap == "English (programmer Dvorak)":
299 short = "dvp"
300 elif keymap == "English (US)":
301 short = "<span color=\"#ffffff\">us</span>"
302 print(json.dumps({'text': short, 'tooltip': keymap}, separators=(',', ':')), flush=True) # noqa: E501
303
304
305 r = subprocess.run(["hyprctl", "devices", "-j"], check=True, stdout=subprocess.PIPE, text=True) # noqa: E501
306 for keyboard in json.loads(r.stdout)['keyboards']:
307 if keyboard['name'] != "at-translated-set-2-keyboard":
308 continue
309 output(keyboard['active_keymap'])
310
311 sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
312 sock.connect(os.environ["XDG_RUNTIME_DIR"] + "/hypr/" + os.environ["HYPRLAND_INSTANCE_SIGNATURE"] + "/.socket2.sock") # noqa: E501
313 expected = re.compile(r'^activelayout>>at-translated-set-2-keyboard,(?P<keymap>.+)$') # noqa: E501
314 for line in sock.makefile(buffering=1, encoding='utf-8'):
315 if match := expected.match(line):
316 output(match.group("keymap"))
317 '';
318 on-click = "hyprctl switchxkblayout at-translated-set-2-keyboard next";
319 };
320 "custom/worktime" = {
321 interval = 60;
322 exec = getExe pkgs.worktime;
323 tooltip = false;
324 };
325 "custom/worktime-today" = {
326 interval = 60;
327 exec = "${getExe pkgs.worktime} today";
328 tooltip = false;
329 };
330 "hyprland/workspaces" = {
331 all-outputs = true;
332 };
333 "hyprland/window" = {
334 separate-outputs = true;
335 icon = true;
336 icon-size = 14;
337 rewrite = windowRewrites;
338 };
339 clock = {
340 interval = 1;
341 # timezone = "Europe/Berlin";
342 format = "W{:%V-%u %F %H:%M:%S%Ez}";
343 tooltip-format = "<tt><small>{calendar}</small></tt>";
344 calendar = {
345 mode = "year";
346 mode-mon-col = 3;
347 weeks-pos = "left";
348 on-scroll = 1;
349 format = {
350 months = "<span color='#ffead3'><b>{}</b></span>";
351 days = "{}";
352 weeks = "<span color='#99ffdd'><b>{}</b></span>";
353 weekdays = "<span color='#ffcc66'><b>{}</b></span>";
354 today = "<span color='#ff6699'><b>{}</b></span>";
355 };
356 };
357 };
358 battery = {
359 format = "<span font=\"Symbols Nerd Font Mono\" size=\"90%\">{icon}</span>";
360 icon-size = iconSize - 2;
361 states = { warning = 30; critical = 15; };
362 format-icons = ["&#xf008e;" "&#xf007a;" "&#xf007b;" "&#xf007c;" "&#xf007d;" "&#xf007e;" "&#xf007f;" "&#xf0080;" "&#xf0081;" "&#xf0082;" "&#xf0079;" ];
363 format-charging = "&#xf0084;";
364 format-plugged = "&#xf06a5;";
365 tooltip-format = "{capacity}% {timeTo}";
366 interval = 20;
367 };
368 tray = {
369 icon-size = 16;
370 # show-passive-items = true;
371 spacing = 1;
372 };
373 privacy = {
374 icon-spacing = 7;
375 icon-size = iconSize;
376 modules = [
377 { type = "screenshare"; }
378 { type = "audio-in"; }
379 ];
380 };
381 idle_inhibitor = {
382 format = "<span font=\"Symbols Nerd Font Mono\" size=\"90%\">{icon}</span>";
383 icon-size = iconSize;
384 format-icons = { activated = "&#xf0208;"; deactivated = "&#xf0209;"; };
385 timeout = 120;
386 };
387 backlight = {
388 format = "<span font=\"Symbols Nerd Font Mono\" size=\"90%\">{icon}</span>";
389 icon-size = iconSize;
390 tooltip-format = "{percent}%";
391 format-icons = ["&#xf00da;" "&#xf00db;" "&#xf00dc;" "&#xf00dd;" "&#xf00de;" "&#xf00df;" "&#xf00e0;"];
392 on-scroll-up = "lightctl -d -e4 -n1 up";
393 on-scroll-down = "lightctl -d -e4 -n1 down";
394 };
395 wireplumber = {
396 format = "<span font=\"Symbols Nerd Font Mono\" size=\"90%\">{icon}</span>";
397 icon-size = iconSize;
398 tooltip-format = "{volume}% {node_name}";
399 format-icons = ["&#xf057f;" "&#xf0580;" "&#xf057e;"];
400 format-muted = "<span font=\"Symbols Nerd Font Mono\" size=\"90%\">&#xf075f;</span>";
401 # ignored-sinks = ["Easy Effects Sink"];
402 on-scroll-up = "volumectl -d -u up";
403 on-scroll-down = "volumectl -d -u down";
404 on-click = "volumectl -d toggle-mute";
405 };
406 }
407 {
408 layer = "top";
409 position = "top";
410 height = 14;
411 output = [ "!eDP-1" "!DP-2" "!DP-3" ];
412 modules-left = [ "hyprland/workspaces" ];
413 modules-center = [ "hyprland/window" ];
414 modules-right = [ "clock" ];
415
416 "hyprland/workspaces" = {
417 all-outputs = false;
418 };
419 "hyprland/window" = {
420 separate-outputs = true;
421 icon = true;
422 icon-size = 14;
423 rewrite = windowRewrites;
424 };
425 clock = {
426 interval = 1;
427 # timezone = "Europe/Berlin";
428 format = "{:%H:%M}";
429 tooltip-format = "W{:%V-%u %F %H:%M:%S%Ez}";
430 };
431 }
432 ];
433 style = ''
434 @define-color white #ffffff;
435 @define-color grey #555555;
436 @define-color blue #1a8fff;
437 @define-color green #23fd00;
438 @define-color orange #f28a21;
439 @define-color red #f2201f;
440
441 * {
442 border: none;
443 font-family: "Fira Sans Nerd Font";
444 font-size: 10pt;
445 min-height: 0;
446 }
447
448 window#waybar {
449 background-color: rgba(0, 0, 0, 0.66);
450 color: @white;
451 }
452
453 .modules-left {
454 margin-left: 9px;
455 }
456 .modules-right {
457 margin-right: 9px;
458 }
459
460 .module {
461 margin: 0 5px;
462 }
463
464 #workspaces button {
465 color: @grey;
466 }
467 #workspaces button.hosting-monitor {
468 color: @white;
469 }
470 #workspaces button.visible {
471 color: @blue;
472 }
473 #workspaces button.active {
474 color: @green;
475 }
476 #workspaces button.urgent {
477 color: @red;
478 }
479
480 #custom-weather, #custom-keymap, #custom-worktime, #custom-worktime-today {
481 color: @grey;
482 margin: 0 5px;
483 }
484 #custom-weather, #custom-worktime-today {
485 margin-right: 3px;
486 }
487 #custom-keymap, #custom-weather {
488 margin-left: 3px;
489 }
490
491 #tray {
492 margin: 0;
493 }
494 #battery, #idle_inhibitor, #backlight, #wireplumber {
495 color: @grey;
496 margin: 0 5px 0 2px;
497 }
498 #idle_inhibitor {
499 margin-right: 2px;
500 margin-left: 3px;
501 }
502 #battery {
503 margin-right: 3px;
504 }
505 #battery.discharging {
506 color: @white;
507 }
508 #battery.warning {
509 color: @orange;
510 }
511 #battery.critical {
512 color: @red;
513 }
514 #battery.charging {
515 color: @white;
516 }
517 #idle_inhibitor.activated {
518 color: @white;
519 }
520
521 #idle_inhibitor {
522 padding-top: 1px;
523 }
524
525 #privacy {
526 color: @red;
527 margin: -1px 2px 0px 5px;
528 }
529 #clock {
530 /* margin-right: 5px; */
531 }
532 '';
533 };
534 wpaperd = {
535 enable = true;
536 settings.default = {
537 path = "~/.wallpapers";
538 duration = "8h";
539 mode = "center";
540 }; 336 };
541 }; 337 };
542 fuzzel = { 338 fuzzel = {
543 enable = true; 339 enable = true;
544 settings = { 340 settings = {
545 main = { 341 main = {
546 terminal = lib.getExe pkgs.kitty; 342 terminal = lib.getExe cfg.programs.kitty.package;
547 layer = "overlay"; 343 layer = "overlay";
548 icon-theme = "Paper"; 344 icon-theme = "Paper";
549 font = "Fira Sans"; 345 font = "Fira Sans";
550 }; 346 };
551 colors = { 347 colors = {
552 background = "000000aa"; 348 background = "000000cc";
553 text = "cdd6f4ff"; 349 text = "cdd6f4ff";
554 match = "94e2d5ff"; 350 match = "94e2d5ff";
555 selection = "585b70ff"; 351 selection = "585b70ff";
@@ -562,34 +358,46 @@ in {
562 }; 358 };
563 }; 359 };
564 }; 360 };
361 pandoc = {
362 enable = true;
363 extraAbbreviations = ["i.A." "d.h." "D.h." "gdw."];
364 };
365 nushell = {
366 enable = true;
367 settings.show_banner = false;
368 };
369 fd.enable = true;
565 }; 370 };
566 371
567 services = { 372 services = {
568 dunst = { 373 wpaperd = {
569 settings = import ./dunst-settings.nix inputs;
570 iconTheme = {
571 package = pkgs.paper-icon-theme;
572 name = "Paper";
573 };
574 enable = true; 374 enable = true;
375 settings.default = {
376 path = "~/.wallpapers";
377 duration = "15m";
378 mode = "center";
379 };
575 }; 380 };
576 emacs = { 381 emacs = {
577 enable = true; 382 enable = true;
578 socketActivation.enable = true; 383 socketActivation.enable = true;
579 client = { 384 client = {
580 enable = true; 385 enable = true;
581 arguments = mkForce ["--reuse-frame" "--alternate-editor" "\"\""]; 386 arguments = mkForce ["--create-frame" "--alternate-editor" (lib.getExe cfg.services.emacs.package)];
582 }; 387 };
583 }; 388 };
584 gpg-agent = { 389 gpg-agent = {
585 enable = true; 390 enable = true;
586 enableSshSupport = true; 391 enableSshSupport = true;
587 extraConfig = '' 392 extraConfig = ''
588 pinentry-program ${pkgs.pinentry-gtk2}/bin/pinentry 393 pinentry-program ${lib.getExe' pkgs.pinentry-gtk2 "pinentry"}
589 grab 394 grab
590 ''; 395 '';
591 }; 396 };
592 xembed-sni-proxy.enable = true; 397 xembed-sni-proxy = {
398 enable = true;
399 package = pkgs.kdePackages.plasma-workspace;
400 };
593 udiskie = { 401 udiskie = {
594 enable = true; 402 enable = true;
595 automount = false; 403 automount = false;
@@ -600,6 +408,12 @@ in {
600 notification_actions = { 408 notification_actions = {
601 device_mounted = []; 409 device_mounted = [];
602 }; 410 };
411 device_config = [
412 { loop_file = "/nix/store/*-etc-metadata.erofs"; is_mounted = false; ignore = true; }
413 { mount_path = "/run/nixos-etc-metadata"; ignore = true; }
414 { mount_path = "/run/nixos-etc-metadata.*"; ignore = true; }
415 ];
416 icon_names.media = ["drive-removable-media-symbolic"];
603 }; 417 };
604 }; 418 };
605 network-manager-applet.enable = true; 419 network-manager-applet.enable = true;
@@ -616,7 +430,7 @@ in {
616 batch = "true"; 430 batch = "true";
617 log = "false"; 431 log = "false";
618 repeat = "watch"; 432 repeat = "watch";
619 sshcmd = "${pkgs.openssh}/bin/ssh"; 433 sshcmd = lib.getExe' pkgs.openssh "ssh";
620 ui = "text"; 434 ui = "text";
621 }; 435 };
622 }; 436 };
@@ -636,31 +450,17 @@ in {
636 enable = true; 450 enable = true;
637 events = [ 451 events = [
638 { event = "before-sleep"; command = lockCommand; } 452 { event = "before-sleep"; command = lockCommand; }
639 { event = "after-resume"; command = "${cfg.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms on"; }
640 { event = "lock"; command = lockCommand; } 453 { event = "lock"; command = lockCommand; }
641 ]; 454 ];
642 timeouts = [ 455 timeouts = [
643 { timeout = 300; 456 { timeout = 600; command = lockCommand; }
644 command = "${cfg.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms off";
645 }
646 { timeout = 330; command = lockCommand; }
647 ]; 457 ];
648 extraArgs = [ 458 extraArgs = [
459 "-w"
649 "idlehint" "30" 460 "idlehint" "30"
650 ]; 461 ];
651 }; 462 };
652 poweralertd.enable = true; 463 poweralertd.enable = true;
653 avizo = {
654 enable = true;
655 settings.default = {
656 time = "1.0";
657 background = "rgba(0, 0, 0, 0.8)";
658 border-color = "rgba(0, 0, 0, 1)";
659 bar-fg-color = "rgba(160, 160, 160, 1)";
660 bar-bg-color = "rgba(32, 32, 32, 0.96)";
661 # y-offset = "0.25";
662 };
663 };
664 }; 464 };
665 465
666 home.pointerCursor = { 466 home.pointerCursor = {
@@ -692,6 +492,13 @@ in {
692 }; 492 };
693 }; 493 };
694 494
495 qt.kde.settings = {
496 kwalletrc = {
497 KSecretD.Enabled = false;
498 Wallet."Default Wallet" = "store";
499 };
500 };
501
695 xsession.preferStatusNotifierItems = true; 502 xsession.preferStatusNotifierItems = true;
696 503
697 xresources.properties = import ./xresources.nix; 504 xresources.properties = import ./xresources.nix;
@@ -700,18 +507,19 @@ in {
700 packages = with pkgs; [ 507 packages = with pkgs; [
701 fira fira-code pwvucontrol wrappedKeepassxc wl-clipboard-rs 508 fira fira-code pwvucontrol wrappedKeepassxc wl-clipboard-rs
702 mumble pulseaudio-ctl pamixer libnotify screen-message 509 mumble pulseaudio-ctl pamixer libnotify screen-message
703 wrappedYTMDesktop libsForQt5.qt5ct playerctl evince 510 wrappedYTMDesktop libsForQt5.qt5ct playerctl evince papers
704 thunderbird zoom-us steam steam-run wireshark virt-manager 511 thunderbird zoom-us xdg-desktop-portal steam steam-run
705 rclone cached-nix-shell worktime fira-code-symbols 512 wireshark virt-manager rclone cached-nix-shell worktime
706 libreoffice xournalpp google-chrome nixos-shell virt-viewer 513 fira-code-symbols libreoffice xournalpp
707 freerdp gnome-icon-theme paper-icon-theme sshpassSecret 514 nixos-shell virt-viewer freerdp gnome-icon-theme
708 weechat element-desktop matrix-synapse-tools.synadm 515 paper-icon-theme sshpassSecret weechat element-desktop
709 flakeInputs.deploy-rs.packages.${config.nixpkgs.system}.deploy-rs 516 sieve-connect gimp3 inkscape udiskie glab nitrokey-app
710 sieve-connect gimp inkscape udiskie glab nitrokey-app
711 pynitrokey gtklock wlrctl remmina openscad spice-record 517 pynitrokey gtklock wlrctl remmina openscad spice-record
712 libguestfs-with-appliance nerd-fonts.fira-mono 518 libguestfs-with-appliance nerd-fonts.fira-mono
713 nerd-fonts.symbols-only nerd-fonts.fira-code powerline-fonts 519 nerd-fonts.symbols-only nerd-fonts.fira-code powerline-fonts
714 ]; 520 swtpm (hunspell.withDicts (dicts: with dicts; [en_GB-large de_DE]))
521 libation libqalculate
522 ] ++ mapAttrsToList (_name: pkg: pkgs.callPackage pkg {}) (customUtils.nixImport { dir = ./utils; });
715 523
716 file = { 524 file = {
717 ".backup-munin".source = ./backup-patterns; 525 ".backup-munin".source = ./backup-patterns;
@@ -731,12 +539,9 @@ in {
731 QT_QPA_PLATFORMTHEME = "qt5ct"; 539 QT_QPA_PLATFORMTHEME = "qt5ct";
732 LIBVIRT_DEFAULT_URI = "qemu:///system"; 540 LIBVIRT_DEFAULT_URI = "qemu:///system";
733 STACK_XDG = 1; 541 STACK_XDG = 1;
734 EDITOR = pkgs.writeShellScript "editor" '' 542 EDITOR = lib.getExe' editor "emacsclient";
735 args=("--reuse-frame" "--alternate-editor" "") 543 RCLONE_PASSWORD_COMMAND = "${lib.getExe' pkgs.libsecret "secret-tool"} lookup service rclone";
736 args+=("$@") 544 SYSTEMD_TINT_BACKGROUND = "false";
737 exec -a emacsclient ${cfg.services.emacs.package}/bin/emacsclient "''${args[@]}"
738 '';
739 RCLONE_PASSWORD_COMMAND = "${pkgs.libsecret}/bin/secret-tool lookup service rclone";
740 }; 545 };
741 546
742 extraProfileCommands = '' 547 extraProfileCommands = ''
@@ -745,18 +550,11 @@ in {
745 }; 550 };
746 551
747 xdg.configFile = { 552 xdg.configFile = {
748 "dunst/dunstrc.d" = {
749 source = ./dunstrc.d;
750 recursive = true;
751 onChange = ''
752 ${pkgs.systemd}/bin/systemctl --user try-restart dunst
753 '';
754 };
755 "wireplumber" = { 553 "wireplumber" = {
756 source = ./wireplumber; 554 source = ./wireplumber;
757 recursive = true; 555 recursive = true;
758 onChange = '' 556 onChange = ''
759 ${pkgs.systemd}/bin/systemctl --user try-restart wireplumber 557 ${lib.getExe' config.systemd.package "systemctl"} --user try-restart wireplumber
760 ''; 558 '';
761 }; 559 };
762 "stack/config.yaml" = { 560 "stack/config.yaml" = {
@@ -780,37 +578,36 @@ in {
780 General = { 578 General = {
781 dot_as_separator = 0; 579 dot_as_separator = 0;
782 }; 580 };
581 Mode = {
582 calculate_as_you_type = 1;
583 };
783 }; 584 };
784 }; 585 };
785 "emacs/init.el".source = ./emacs.el; 586 "emacs/init.el".source = pkgs.substitute {
587 src = ./emacs.el;
588 substitutions = [
589 "--subst-var-by" "ksshaskpass" (lib.getExe pkgs.kdePackages.ksshaskpass)
590 ];
591 };
592 "systemd/user/xdg-desktop-portal.service.d/after-graphical-session.conf".text = ''
593 [Unit]
594 After=graphical-session.target
595 '';
596 "systemd/user/home-manager.service.d/before-graphical-session.conf".text = ''
597 [Unit]
598 Before=graphical-session-pre.target
599 '';
600 "pdfpc/pdfpcrc".text = ''
601 mouse 8 prev
602 mouse 9 next
603 '';
786 }; 604 };
787 605
788 xdg.dataFile = { 606 xdg.dataFile = {
789 "pandoc/abbreviations" = {
790 source = pkgs.runCommand "pandoc-abbreviations" {
791 buildInputs = [ pkgs.pandoc pkgs.coreutils ];
792 } (let
793 germanAbbrevs = pkgs.fetchFromGitHub {
794 owner = "jfilter";
795 repo = "german-abbreviations";
796 rev = "8eb9dae93b6f05d7c53374cd217ab2dc89558e0c";
797 sha256 = "SaD3tSqzen6Y3SPICe6/9vhe4iMHlArZ3kFQaEk7Hps=";
798 };
799 in ''
800 cat \
801 <(pandoc --print-default-data-file=abbreviations) \
802 <(grep -E '^[^ ]+\.$' ${germanAbbrevs}/german_abbreviations.txt) \
803 ${pkgs.writeText "abbrevs.txt" ''
804 i.A.
805 d.h.
806 D.h.
807 gdw.
808 ''} \
809 | sort | uniq >$out
810 '');
811 };
812 "dbus-1/services/org.keepassxc.KeePassXC.service".source = "${wrappedKeepassxc}/share/dbus-1/services/org.keepassxc.KeePassXC.service"; 607 "dbus-1/services/org.keepassxc.KeePassXC.service".source = "${wrappedKeepassxc}/share/dbus-1/services/org.keepassxc.KeePassXC.service";
813 "dbus-1/services/org.freedesktop.secrets.service.service".source = "${wrappedKeepassxc}/share/dbus-1/services/org.freedesktop.secrets.service.service"; 608 "dbus-1/services/org.freedesktop.secrets.service.service".source = "${wrappedKeepassxc}/share/dbus-1/services/org.freedesktop.secrets.service.service";
609 "dbus-1/services/org.kde.kwalletd6.service".source = "${pkgs.kdePackages.kwallet}/share/dbus-1/services/org.kde.kwalletd6.service";
610 "dbus-1/services/org.kde.kwalletd5.service".source = "${pkgs.kdePackages.kwallet}/share/dbus-1/services/org.kde.kwalletd5.service";
814 "emoji-data/list.txt".source = pkgs.stdenv.mkDerivation { 611 "emoji-data/list.txt".source = pkgs.stdenv.mkDerivation {
815 inherit (sources.emoji-data) pname src; 612 inherit (sources.emoji-data) pname src;
816 version = lib.removePrefix "v" sources.emoji-data.version; 613 version = lib.removePrefix "v" sources.emoji-data.version;
@@ -896,19 +693,68 @@ in {
896 name = "Rainbow"; 693 name = "Rainbow";
897 exec = toString (pkgs.writeShellScript "rainbow" '' 694 exec = toString (pkgs.writeShellScript "rainbow" ''
898 exec -- \ 695 exec -- \
899 ${config.systemd.package}/bin/systemd-run --wait --user --slice-inherit \ 696 ${lib.getExe' config.systemd.package "systemd-run"} --wait --user --slice-inherit \
900 --property 'CPUAccounting=yes' --property 'CPUQuotaPeriodSec=50ms' \ 697 --property 'CPUAccounting=yes' --property 'CPUQuotaPeriodSec=50ms' \
901 --property 'Environment=DSCP=46' \ 698 -E DSCP=46 -E NIXOS_OZONE_WL \
902 -- ${pkgs.dscp}/bin/dscp ${pkgs.google-chrome}/bin/google-chrome-stable \ 699 -- ${lib.getExe pkgs.dscp} ${lib.getExe cfg.programs.chromium.package} \
903 --force-device-scale-factor=1.5 \
904 --class=Rainbow \ 700 --class=Rainbow \
905 --kiosk "https://web.openrainbow.com" \ 701 --app="https://web.openrainbow.com" \
906 --user-data-dir=''${HOME}/.config/google-chrome-rainbow 702 --user-data-dir=''${HOME}/.config/chromium-rainbow
907 ''); 703 '');
908 icon = pkgs.fetchurl { 704 icon = pkgs.fetchurl {
909 url = "https://web.openrainbow.com/rb/2.139.17/assets/skins/rainbow/images/homepage/logo__rainbow.svg"; 705 url = "https://web.openrainbow.com/rb/2.139.17/assets/skins/rainbow/images/homepage/logo__rainbow.svg";
910 hash = "sha256-5fmo8rDqVDpzkGaPjk4Y+SsSZpAsY7VUQSFW6WdHwuU="; 706 hash = "sha256-5fmo8rDqVDpzkGaPjk4Y+SsSZpAsY7VUQSFW6WdHwuU=";
911 }; 707 };
708 settings = {
709 StartupWMClass = "Rainbow";
710 };
711 };
712 kimai = {
713 name = "Kimai";
714 exec = toString (pkgs.writeShellScript "kimai" ''
715 exec -- \
716 ${lib.getExe cfg.programs.chromium.package} \
717 --class=Kimai \
718 --app="https://kimai.yggdrasil.li" \
719 --user-data-dir=''${HOME}/.config/chromium-kimai
720 '');
721 icon = pkgs.fetchurl {
722 url = "https://www.kimai.org/images/kimai_logo.png";
723 hash = "sha256-lnlOttzR2SwXA70R+egJUkeKr4U5V0avqTk8uX4bqfs=";
724 };
725 settings = {
726 StartupWMClass = "Kimai";
727 StartupNotify = "true";
728 };
729 };
730 audiobookshelf = {
731 name = "Audiobookshelf";
732 exec = toString (pkgs.writeShellScript "audiobookshelf" ''
733 exec -- \
734 ${lib.getExe cfg.programs.chromium.package} \
735 --class=Audiobookshelf \
736 --app="https://audiobookshelf.yggdrasil.li" \
737 --user-data-dir=''${HOME}/.config/chromium-audiobookshelf
738 '');
739 icon = pkgs.fetchurl {
740 url = "https://www.audiobookshelf.org/Logo.png";
741 hash = "sha256-JGPk+WNT1C4DC4lSMb0K0YmAMT5LvmSOeO0QRzkc7Lk=";
742 };
743 settings = {
744 StartupWMClass = "Audiobookshelf";
745 StartupNotify = "true";
746 };
747 };
748 thunderbird-lmu = {
749 name = "Thunderbird (LMU)";
750 exec = "thunderbird --name thunderbird -P lmu %U";
751 icon = "thunderbird";
752 genericName = "Email Client";
753 categories = [ "Network" "Chat" "Email" "Feed" "GTK" "News" ];
754 settings = {
755 StartupWMClass = "thunderbird";
756 StartupNotify = "true";
757 };
912 }; 758 };
913 }; 759 };
914 760
@@ -924,23 +770,6 @@ in {
924 color-scheme = "prefer-dark"; 770 color-scheme = "prefer-dark";
925 }; 771 };
926 }; 772 };
927
928 wayland.windowManager.hyprland = {
929 enable = true;
930 settings = import ./hyprland.nix inputs;
931 };
932
933 xdg.portal = {
934 enable = true;
935 xdgOpenUsePortal = true;
936 config = {
937 common.default = [ "gtk" ];
938 hyprland.default = [ "gtk" "kde" "hyprland" ];
939 };
940 extraPortals = with pkgs; [
941 xdg-desktop-portal-kde xdg-desktop-portal-gtk xdg-desktop-portal-wlr xdg-desktop-portal-hyprland
942 ];
943 };
944 }; 773 };
945 }; 774 };
946} 775}