diff options
Diffstat (limited to 'accounts/gkleen@sif/default.nix')
-rw-r--r-- | accounts/gkleen@sif/default.nix | 226 |
1 files changed, 197 insertions, 29 deletions
diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix index 6574af9d..706eb241 100644 --- a/accounts/gkleen@sif/default.nix +++ b/accounts/gkleen@sif/default.nix | |||
@@ -50,9 +50,20 @@ let | |||
50 | }; | 50 | }; |
51 | 51 | ||
52 | lockCommand = "${lib.getExe' config.systemd.package "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 | }; | ||
53 | in { | 64 | in { |
54 | imports = with flake.nixosModules.userProfiles.${userName}; [ | 65 | imports = with flake.nixosModules.userProfiles.${userName}; [ |
55 | mpv yt-dlp (args: import ./xcompose.nix (inputs // args)) | 66 | zsh tmux mpv yt-dlp (args: import ./xcompose.nix (inputs // args)) |
56 | ]; | 67 | ]; |
57 | 68 | ||
58 | config = { | 69 | config = { |
@@ -60,16 +71,17 @@ in { | |||
60 | imports = [ | 71 | imports = [ |
61 | ./libvirt | 72 | ./libvirt |
62 | ./niri | 73 | ./niri |
74 | ./synadm | ||
63 | flakeInputs.nix-index-database.hmModules.nix-index | 75 | flakeInputs.nix-index-database.hmModules.nix-index |
64 | flakeInputs.impermanence.nixosModules.home-manager.impermanence | 76 | flakeInputs.impermanence.nixosModules.home-manager.impermanence |
65 | ]; | 77 | ]; |
66 | 78 | ||
67 | home.stateVersion = "20.09"; | 79 | home.stateVersion = "20.09"; |
68 | 80 | ||
69 | nixpkgs.config = { | 81 | # nixpkgs.config = { |
70 | allowUnfree = true; | 82 | # allowUnfree = true; |
71 | zathura.useMupdf = false; | 83 | # zathura.useMupdf = false; |
72 | }; | 84 | # }; |
73 | 85 | ||
74 | nix.registry = { | 86 | nix.registry = { |
75 | "flk" = { | 87 | "flk" = { |
@@ -175,13 +187,91 @@ in { | |||
175 | gpu-api = "vulkan"; | 187 | gpu-api = "vulkan"; |
176 | }; | 188 | }; |
177 | 189 | ||
178 | zsh.initExtra = '' | 190 | zsh.initContent = let |
179 | source ${./zshrc} | 191 | zshrc = pkgs.resholve.mkDerivation { |
192 | pname = "zshrc"; | ||
193 | version = "0.0.0"; | ||
194 | |||
195 | src = ./zshrc; | ||
196 | |||
197 | dontUnpack = true; | ||
198 | dontConfigure = true; | ||
199 | dontBuild = true; | ||
200 | |||
201 | installPhase = '' | ||
202 | mkdir -p $out/share | ||
203 | install "$src" $out/share/zshrc | ||
204 | ''; | ||
205 | |||
206 | solutions = { | ||
207 | default = { | ||
208 | scripts = [ "share/zshrc" ]; | ||
209 | interpreter = "none"; | ||
210 | inputs = with pkgs; [ | ||
211 | coreutils | ||
212 | rpm | ||
213 | binutils | ||
214 | squashfsTools | ||
215 | unzip | ||
216 | cfg.programs.git.package | ||
217 | magickWrapped | ||
218 | curl | ||
219 | file | ||
220 | gnutar | ||
221 | cpio | ||
222 | magic-wormhole | ||
223 | cfg.programs.zsh.package | ||
224 | fuse | ||
225 | util-linux | ||
226 | findutils | ||
227 | qrencode | ||
228 | tty-clock | ||
229 | cfg.programs.jq.package | ||
230 | eza | ||
231 | less | ||
232 | config.systemd.package | ||
233 | config.programs.ssh.package | ||
234 | gnused | ||
235 | miniserve | ||
236 | ]; | ||
237 | execer = with pkgs; [ | ||
238 | "cannot:${lib.getExe' rpm "rpm2cpio"}" | ||
239 | "cannot:${lib.getExe' squashfsTools "unsquashfs"}" | ||
240 | "cannot:${lib.getExe' unzip "unzip"}" | ||
241 | "cannot:${lib.getExe cfg.programs.git.package}" | ||
242 | "cannot:${lib.getExe cpio}" | ||
243 | "cannot:${lib.getExe' magic-wormhole "wormhole"}" | ||
244 | "cannot:${lib.getExe' fuse "fusermount"}" | ||
245 | "cannot:${lib.getExe less}" | ||
246 | "cannot:${lib.getExe' config.systemd.package "systemctl"}" | ||
247 | "cannot:${lib.getExe config.programs.ssh.package}" | ||
248 | ]; | ||
249 | wrapper = with pkgs; [ | ||
250 | "${lib.getExe' magickWrapped "magick"}:${lib.getExe' imagemagick "magick"}" | ||
251 | ]; | ||
252 | fake = { | ||
253 | builtin = ["print"]; | ||
254 | external = ["sudo" "umount"]; | ||
255 | }; | ||
256 | }; | ||
257 | }; | ||
258 | }; | ||
259 | magickWrapped = pkgs.symlinkJoin { | ||
260 | inherit (pkgs.imagemagick) name; | ||
261 | paths = [ pkgs.imagemagick ]; | ||
262 | |||
263 | buildInputs = with pkgs; [ makeWrapper ]; | ||
264 | postBuild = '' | ||
265 | wrapProgram $out/bin/magick \ | ||
266 | --prefix PATH : ${lib.makeBinPath (with pkgs; [ ghostscript ])} | ||
267 | ''; | ||
268 | }; | ||
269 | in '' | ||
270 | source ${zshrc}/share/zshrc | ||
180 | ''; | 271 | ''; |
181 | zsh.dirHashes = let | 272 | zsh.dirHashes = let |
182 | flakeHashes = mapAttrs' (n: v: nameValuePair (inputNames.${n} or n) (toString v)) flakeInputs; | 273 | flakeHashes = mapAttrs' (n: v: nameValuePair (inputNames.${n} or n) (toString v)) flakeInputs; |
183 | inputNames = { | 274 | inputNames = { |
184 | "nixpkgs" = "nixos"; | ||
185 | }; | 275 | }; |
186 | in flakeHashes // { | 276 | in flakeHashes // { |
187 | u2w = "$HOME/projects/uni2work"; | 277 | u2w = "$HOME/projects/uni2work"; |
@@ -193,6 +283,16 @@ in { | |||
193 | pro = "$HOME/projects/pro"; | 283 | pro = "$HOME/projects/pro"; |
194 | media = "$HOME/media"; | 284 | media = "$HOME/media"; |
195 | }; | 285 | }; |
286 | jq.colors = { | ||
287 | arrays = "1;37"; | ||
288 | "false" = "0;37"; | ||
289 | "null" = "2;37"; | ||
290 | numbers = "0;37"; | ||
291 | objectKeys = "1;34"; | ||
292 | objects = "1;37"; | ||
293 | strings = "0;32"; | ||
294 | "true" = "0;37"; | ||
295 | }; | ||
196 | 296 | ||
197 | obs-studio = { | 297 | obs-studio = { |
198 | enable = true; | 298 | enable = true; |
@@ -202,7 +302,7 @@ in { | |||
202 | gh = { | 302 | gh = { |
203 | enable = true; | 303 | enable = true; |
204 | settings = { | 304 | settings = { |
205 | editor = lib.getExe' config.home-manager.users.${userName}.programs.emacs.package "emacsclient"; | 305 | editor = lib.getExe' editor "emacsclient"; |
206 | gitProtocol = "ssh"; | 306 | gitProtocol = "ssh"; |
207 | }; | 307 | }; |
208 | }; | 308 | }; |
@@ -228,16 +328,10 @@ in { | |||
228 | # notify_on_cmd_finish = "invisible 120"; | 328 | # notify_on_cmd_finish = "invisible 120"; |
229 | }; | 329 | }; |
230 | keybindings = { | 330 | keybindings = { |
231 | "kitty_mod+n" = "detach_window"; | 331 | "kitty_mod+n" = "new_os_window_with_cwd"; |
232 | "kitty_mod+m" = "detach_window ask"; | 332 | "kitty_mod+m" = "detach_window ask"; |
233 | }; | 333 | "kitty_mod+enter" = "new_window_with_cwd"; |
234 | }; | 334 | "kitty_mod+t" = "new_tab_with_cwd"; |
235 | wpaperd = { | ||
236 | enable = true; | ||
237 | settings.default = { | ||
238 | path = "~/.wallpapers"; | ||
239 | duration = "15m"; | ||
240 | mode = "center"; | ||
241 | }; | 335 | }; |
242 | }; | 336 | }; |
243 | fuzzel = { | 337 | fuzzel = { |
@@ -250,7 +344,7 @@ in { | |||
250 | font = "Fira Sans"; | 344 | font = "Fira Sans"; |
251 | }; | 345 | }; |
252 | colors = { | 346 | colors = { |
253 | background = "000000aa"; | 347 | background = "000000cc"; |
254 | text = "cdd6f4ff"; | 348 | text = "cdd6f4ff"; |
255 | match = "94e2d5ff"; | 349 | match = "94e2d5ff"; |
256 | selection = "585b70ff"; | 350 | selection = "585b70ff"; |
@@ -267,15 +361,28 @@ in { | |||
267 | enable = true; | 361 | enable = true; |
268 | extraAbbreviations = ["i.A." "d.h." "D.h." "gdw."]; | 362 | extraAbbreviations = ["i.A." "d.h." "D.h." "gdw."]; |
269 | }; | 363 | }; |
364 | nushell = { | ||
365 | enable = true; | ||
366 | settings.show_banner = false; | ||
367 | }; | ||
368 | fd.enable = true; | ||
270 | }; | 369 | }; |
271 | 370 | ||
272 | services = { | 371 | services = { |
372 | wpaperd = { | ||
373 | enable = true; | ||
374 | settings.default = { | ||
375 | path = "~/.wallpapers"; | ||
376 | duration = "15m"; | ||
377 | mode = "center"; | ||
378 | }; | ||
379 | }; | ||
273 | emacs = { | 380 | emacs = { |
274 | enable = true; | 381 | enable = true; |
275 | socketActivation.enable = true; | 382 | socketActivation.enable = true; |
276 | client = { | 383 | client = { |
277 | enable = true; | 384 | enable = true; |
278 | arguments = mkForce ["--reuse-frame" "--alternate-editor" "\"\""]; | 385 | arguments = mkForce ["--create-frame" "--alternate-editor" (lib.getExe cfg.services.emacs.package)]; |
279 | }; | 386 | }; |
280 | }; | 387 | }; |
281 | gpg-agent = { | 388 | gpg-agent = { |
@@ -384,6 +491,13 @@ in { | |||
384 | }; | 491 | }; |
385 | }; | 492 | }; |
386 | 493 | ||
494 | qt.kde.settings = { | ||
495 | kwalletrc = { | ||
496 | KSecretD.Enabled = false; | ||
497 | Wallet."Default Wallet" = "store"; | ||
498 | }; | ||
499 | }; | ||
500 | |||
387 | xsession.preferStatusNotifierItems = true; | 501 | xsession.preferStatusNotifierItems = true; |
388 | 502 | ||
389 | xresources.properties = import ./xresources.nix; | 503 | xresources.properties = import ./xresources.nix; |
@@ -403,7 +517,7 @@ in { | |||
403 | libguestfs-with-appliance nerd-fonts.fira-mono | 517 | libguestfs-with-appliance nerd-fonts.fira-mono |
404 | nerd-fonts.symbols-only nerd-fonts.fira-code powerline-fonts | 518 | nerd-fonts.symbols-only nerd-fonts.fira-code powerline-fonts |
405 | swtpm (hunspellWithDicts (with hunspellDicts; [en_GB-large de_DE])) | 519 | swtpm (hunspellWithDicts (with hunspellDicts; [en_GB-large de_DE])) |
406 | # synadm | 520 | libation libqalculate |
407 | ] ++ mapAttrsToList (_name: pkg: pkgs.callPackage pkg {}) (customUtils.nixImport { dir = ./utils; }); | 521 | ] ++ mapAttrsToList (_name: pkg: pkgs.callPackage pkg {}) (customUtils.nixImport { dir = ./utils; }); |
408 | 522 | ||
409 | file = { | 523 | file = { |
@@ -424,12 +538,9 @@ in { | |||
424 | QT_QPA_PLATFORMTHEME = "qt5ct"; | 538 | QT_QPA_PLATFORMTHEME = "qt5ct"; |
425 | LIBVIRT_DEFAULT_URI = "qemu:///system"; | 539 | LIBVIRT_DEFAULT_URI = "qemu:///system"; |
426 | STACK_XDG = 1; | 540 | STACK_XDG = 1; |
427 | EDITOR = pkgs.writeShellScript "editor" '' | 541 | EDITOR = lib.getExe' editor "emacsclient"; |
428 | args=("--reuse-frame" "--alternate-editor" "") | ||
429 | args+=("$@") | ||
430 | exec -a emacsclient ${lib.getExe' cfg.services.emacs.package "emacsclient"} "''${args[@]}" | ||
431 | ''; | ||
432 | RCLONE_PASSWORD_COMMAND = "${lib.getExe' pkgs.libsecret "secret-tool"} lookup service rclone"; | 542 | RCLONE_PASSWORD_COMMAND = "${lib.getExe' pkgs.libsecret "secret-tool"} lookup service rclone"; |
543 | SYSTEMD_TINT_BACKGROUND = "false"; | ||
433 | }; | 544 | }; |
434 | 545 | ||
435 | extraProfileCommands = '' | 546 | extraProfileCommands = '' |
@@ -466,9 +577,17 @@ in { | |||
466 | General = { | 577 | General = { |
467 | dot_as_separator = 0; | 578 | dot_as_separator = 0; |
468 | }; | 579 | }; |
580 | Mode = { | ||
581 | calculate_as_you_type = 1; | ||
582 | }; | ||
469 | }; | 583 | }; |
470 | }; | 584 | }; |
471 | "emacs/init.el".source = ./emacs.el; | 585 | "emacs/init.el".source = pkgs.substitute { |
586 | src = ./emacs.el; | ||
587 | substitutions = [ | ||
588 | "--subst-var-by" "ksshaskpass" (lib.getExe pkgs.kdePackages.ksshaskpass) | ||
589 | ]; | ||
590 | }; | ||
472 | "systemd/user/xdg-desktop-portal.service.d/after-graphical-session.conf".text = '' | 591 | "systemd/user/xdg-desktop-portal.service.d/after-graphical-session.conf".text = '' |
473 | [Unit] | 592 | [Unit] |
474 | After=graphical-session.target | 593 | After=graphical-session.target |
@@ -486,6 +605,8 @@ in { | |||
486 | xdg.dataFile = { | 605 | xdg.dataFile = { |
487 | "dbus-1/services/org.keepassxc.KeePassXC.service".source = "${wrappedKeepassxc}/share/dbus-1/services/org.keepassxc.KeePassXC.service"; | 606 | "dbus-1/services/org.keepassxc.KeePassXC.service".source = "${wrappedKeepassxc}/share/dbus-1/services/org.keepassxc.KeePassXC.service"; |
488 | "dbus-1/services/org.freedesktop.secrets.service.service".source = "${wrappedKeepassxc}/share/dbus-1/services/org.freedesktop.secrets.service.service"; | 607 | "dbus-1/services/org.freedesktop.secrets.service.service".source = "${wrappedKeepassxc}/share/dbus-1/services/org.freedesktop.secrets.service.service"; |
608 | "dbus-1/services/org.kde.kwalletd6.service".source = "${pkgs.kdePackages.kwallet}/share/dbus-1/services/org.kde.kwalletd6.service"; | ||
609 | "dbus-1/services/org.kde.kwalletd5.service".source = "${pkgs.kdePackages.kwallet}/share/dbus-1/services/org.kde.kwalletd5.service"; | ||
489 | "emoji-data/list.txt".source = pkgs.stdenv.mkDerivation { | 610 | "emoji-data/list.txt".source = pkgs.stdenv.mkDerivation { |
490 | inherit (sources.emoji-data) pname src; | 611 | inherit (sources.emoji-data) pname src; |
491 | version = lib.removePrefix "v" sources.emoji-data.version; | 612 | version = lib.removePrefix "v" sources.emoji-data.version; |
@@ -573,10 +694,10 @@ in { | |||
573 | exec -- \ | 694 | exec -- \ |
574 | ${lib.getExe' config.systemd.package "systemd-run"} --wait --user --slice-inherit \ | 695 | ${lib.getExe' config.systemd.package "systemd-run"} --wait --user --slice-inherit \ |
575 | --property 'CPUAccounting=yes' --property 'CPUQuotaPeriodSec=50ms' \ | 696 | --property 'CPUAccounting=yes' --property 'CPUQuotaPeriodSec=50ms' \ |
576 | --property 'Environment=DSCP=46' \ | 697 | -E DSCP=46 -E NIXOS_OZONE_WL \ |
577 | -- ${lib.getExe pkgs.dscp} ${lib.getExe' pkgs.google-chrome "google-chrome-stable"} \ | 698 | -- ${lib.getExe pkgs.dscp} ${lib.getExe' pkgs.google-chrome "google-chrome-stable"} \ |
578 | --class=Rainbow \ | 699 | --class=Rainbow \ |
579 | --kiosk "https://web.openrainbow.com" \ | 700 | --app="https://web.openrainbow.com" \ |
580 | --user-data-dir=''${HOME}/.config/google-chrome-rainbow | 701 | --user-data-dir=''${HOME}/.config/google-chrome-rainbow |
581 | ''); | 702 | ''); |
582 | icon = pkgs.fetchurl { | 703 | icon = pkgs.fetchurl { |
@@ -587,6 +708,53 @@ in { | |||
587 | StartupWMClass = "Rainbow"; | 708 | StartupWMClass = "Rainbow"; |
588 | }; | 709 | }; |
589 | }; | 710 | }; |
711 | kimai = { | ||
712 | name = "Kimai"; | ||
713 | exec = toString (pkgs.writeShellScript "kimai" '' | ||
714 | exec -- \ | ||
715 | ${lib.getExe' pkgs.google-chrome "google-chrome-stable"} \ | ||
716 | --class=Kimai \ | ||
717 | --app="https://kimai.yggdrasil.li" \ | ||
718 | --user-data-dir=''${HOME}/.config/google-chrome-kimai | ||
719 | ''); | ||
720 | icon = pkgs.fetchurl { | ||
721 | url = "https://www.kimai.org/images/kimai_logo.png"; | ||
722 | hash = "sha256-lnlOttzR2SwXA70R+egJUkeKr4U5V0avqTk8uX4bqfs="; | ||
723 | }; | ||
724 | settings = { | ||
725 | StartupWMClass = "Kimai"; | ||
726 | StartupNotify = "true"; | ||
727 | }; | ||
728 | }; | ||
729 | audiobookshelf = { | ||
730 | name = "Audiobookshelf"; | ||
731 | exec = toString (pkgs.writeShellScript "audiobookshelf" '' | ||
732 | exec -- \ | ||
733 | ${lib.getExe' pkgs.google-chrome "google-chrome-stable"} \ | ||
734 | --class=Audiobookshelf \ | ||
735 | --app="https://audiobookshelf.yggdrasil.li" \ | ||
736 | --user-data-dir=''${HOME}/.config/google-chrome-audiobookshelf | ||
737 | ''); | ||
738 | icon = pkgs.fetchurl { | ||
739 | url = "https://www.audiobookshelf.org/Logo.png"; | ||
740 | hash = "sha256-JGPk+WNT1C4DC4lSMb0K0YmAMT5LvmSOeO0QRzkc7Lk="; | ||
741 | }; | ||
742 | settings = { | ||
743 | StartupWMClass = "Audiobookshelf"; | ||
744 | StartupNotify = "true"; | ||
745 | }; | ||
746 | }; | ||
747 | thunderbird-lmu = { | ||
748 | name = "Thunderbird (LMU)"; | ||
749 | exec = "thunderbird --name thunderbird -P lmu %U"; | ||
750 | icon = "thunderbird"; | ||
751 | genericName = "Email Client"; | ||
752 | categories = [ "Network" "Chat" "Email" "Feed" "GTK" "News" ]; | ||
753 | settings = { | ||
754 | StartupWMClass = "thunderbird"; | ||
755 | StartupNotify = "true"; | ||
756 | }; | ||
757 | }; | ||
590 | }; | 758 | }; |
591 | 759 | ||
592 | fonts = { | 760 | fonts = { |