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.nix235
1 files changed, 202 insertions, 33 deletions
diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix
index 6574af9d..a1a694ea 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 };
53in { 64in {
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" = {
@@ -160,6 +172,7 @@ in {
160 }; 172 };
161 }; 173 };
162 }; 174 };
175 chromium.enable = true;
163 176
164 zathura = { 177 zathura = {
165 enable = true; 178 enable = true;
@@ -175,13 +188,91 @@ in {
175 gpu-api = "vulkan"; 188 gpu-api = "vulkan";
176 }; 189 };
177 190
178 zsh.initExtra = '' 191 zsh.initContent = let
179 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
180 ''; 272 '';
181 zsh.dirHashes = let 273 zsh.dirHashes = let
182 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;
183 inputNames = { 275 inputNames = {
184 "nixpkgs" = "nixos";
185 }; 276 };
186 in flakeHashes // { 277 in flakeHashes // {
187 u2w = "$HOME/projects/uni2work"; 278 u2w = "$HOME/projects/uni2work";
@@ -193,6 +284,16 @@ in {
193 pro = "$HOME/projects/pro"; 284 pro = "$HOME/projects/pro";
194 media = "$HOME/media"; 285 media = "$HOME/media";
195 }; 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 };
196 297
197 obs-studio = { 298 obs-studio = {
198 enable = true; 299 enable = true;
@@ -202,7 +303,7 @@ in {
202 gh = { 303 gh = {
203 enable = true; 304 enable = true;
204 settings = { 305 settings = {
205 editor = lib.getExe' config.home-manager.users.${userName}.programs.emacs.package "emacsclient"; 306 editor = lib.getExe' editor "emacsclient";
206 gitProtocol = "ssh"; 307 gitProtocol = "ssh";
207 }; 308 };
208 }; 309 };
@@ -228,16 +329,10 @@ in {
228 # notify_on_cmd_finish = "invisible 120"; 329 # notify_on_cmd_finish = "invisible 120";
229 }; 330 };
230 keybindings = { 331 keybindings = {
231 "kitty_mod+n" = "detach_window"; 332 "kitty_mod+n" = "new_os_window_with_cwd";
232 "kitty_mod+m" = "detach_window ask"; 333 "kitty_mod+m" = "detach_window ask";
233 }; 334 "kitty_mod+enter" = "new_window_with_cwd";
234 }; 335 "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 }; 336 };
242 }; 337 };
243 fuzzel = { 338 fuzzel = {
@@ -250,7 +345,7 @@ in {
250 font = "Fira Sans"; 345 font = "Fira Sans";
251 }; 346 };
252 colors = { 347 colors = {
253 background = "000000aa"; 348 background = "000000cc";
254 text = "cdd6f4ff"; 349 text = "cdd6f4ff";
255 match = "94e2d5ff"; 350 match = "94e2d5ff";
256 selection = "585b70ff"; 351 selection = "585b70ff";
@@ -267,15 +362,28 @@ in {
267 enable = true; 362 enable = true;
268 extraAbbreviations = ["i.A." "d.h." "D.h." "gdw."]; 363 extraAbbreviations = ["i.A." "d.h." "D.h." "gdw."];
269 }; 364 };
365 nushell = {
366 enable = true;
367 settings.show_banner = false;
368 };
369 fd.enable = true;
270 }; 370 };
271 371
272 services = { 372 services = {
373 wpaperd = {
374 enable = true;
375 settings.default = {
376 path = "~/.wallpapers";
377 duration = "15m";
378 mode = "center";
379 };
380 };
273 emacs = { 381 emacs = {
274 enable = true; 382 enable = true;
275 socketActivation.enable = true; 383 socketActivation.enable = true;
276 client = { 384 client = {
277 enable = true; 385 enable = true;
278 arguments = mkForce ["--reuse-frame" "--alternate-editor" "\"\""]; 386 arguments = mkForce ["--create-frame" "--alternate-editor" (lib.getExe cfg.services.emacs.package)];
279 }; 387 };
280 }; 388 };
281 gpg-agent = { 389 gpg-agent = {
@@ -384,6 +492,13 @@ in {
384 }; 492 };
385 }; 493 };
386 494
495 qt.kde.settings = {
496 kwalletrc = {
497 KSecretD.Enabled = false;
498 Wallet."Default Wallet" = "store";
499 };
500 };
501
387 xsession.preferStatusNotifierItems = true; 502 xsession.preferStatusNotifierItems = true;
388 503
389 xresources.properties = import ./xresources.nix; 504 xresources.properties = import ./xresources.nix;
@@ -395,15 +510,15 @@ in {
395 wrappedYTMDesktop libsForQt5.qt5ct playerctl evince papers 510 wrappedYTMDesktop libsForQt5.qt5ct playerctl evince papers
396 thunderbird zoom-us xdg-desktop-portal steam steam-run 511 thunderbird zoom-us xdg-desktop-portal steam steam-run
397 wireshark virt-manager rclone cached-nix-shell worktime 512 wireshark virt-manager rclone cached-nix-shell worktime
398 fira-code-symbols libreoffice xournalpp google-chrome 513 fira-code-symbols libreoffice xournalpp
399 nixos-shell virt-viewer freerdp gnome-icon-theme 514 nixos-shell virt-viewer freerdp gnome-icon-theme
400 paper-icon-theme sshpassSecret weechat element-desktop 515 paper-icon-theme sshpassSecret weechat element-desktop
401 sieve-connect gimp3 inkscape udiskie glab nitrokey-app 516 sieve-connect gimp3 inkscape udiskie glab nitrokey-app
402 pynitrokey gtklock wlrctl remmina openscad spice-record 517 pynitrokey gtklock wlrctl remmina openscad spice-record
403 libguestfs-with-appliance nerd-fonts.fira-mono 518 libguestfs-with-appliance nerd-fonts.fira-mono
404 nerd-fonts.symbols-only nerd-fonts.fira-code powerline-fonts 519 nerd-fonts.symbols-only nerd-fonts.fira-code powerline-fonts
405 swtpm (hunspellWithDicts (with hunspellDicts; [en_GB-large de_DE])) 520 swtpm (hunspell.withDicts (dicts: with dicts; [en_GB-large de_DE]))
406 # synadm 521 libation libqalculate
407 ] ++ mapAttrsToList (_name: pkg: pkgs.callPackage pkg {}) (customUtils.nixImport { dir = ./utils; }); 522 ] ++ mapAttrsToList (_name: pkg: pkgs.callPackage pkg {}) (customUtils.nixImport { dir = ./utils; });
408 523
409 file = { 524 file = {
@@ -424,12 +539,9 @@ in {
424 QT_QPA_PLATFORMTHEME = "qt5ct"; 539 QT_QPA_PLATFORMTHEME = "qt5ct";
425 LIBVIRT_DEFAULT_URI = "qemu:///system"; 540 LIBVIRT_DEFAULT_URI = "qemu:///system";
426 STACK_XDG = 1; 541 STACK_XDG = 1;
427 EDITOR = pkgs.writeShellScript "editor" '' 542 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"; 543 RCLONE_PASSWORD_COMMAND = "${lib.getExe' pkgs.libsecret "secret-tool"} lookup service rclone";
544 SYSTEMD_TINT_BACKGROUND = "false";
433 }; 545 };
434 546
435 extraProfileCommands = '' 547 extraProfileCommands = ''
@@ -466,9 +578,17 @@ in {
466 General = { 578 General = {
467 dot_as_separator = 0; 579 dot_as_separator = 0;
468 }; 580 };
581 Mode = {
582 calculate_as_you_type = 1;
583 };
469 }; 584 };
470 }; 585 };
471 "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 };
472 "systemd/user/xdg-desktop-portal.service.d/after-graphical-session.conf".text = '' 592 "systemd/user/xdg-desktop-portal.service.d/after-graphical-session.conf".text = ''
473 [Unit] 593 [Unit]
474 After=graphical-session.target 594 After=graphical-session.target
@@ -486,6 +606,8 @@ in {
486 xdg.dataFile = { 606 xdg.dataFile = {
487 "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";
488 "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";
489 "emoji-data/list.txt".source = pkgs.stdenv.mkDerivation { 611 "emoji-data/list.txt".source = pkgs.stdenv.mkDerivation {
490 inherit (sources.emoji-data) pname src; 612 inherit (sources.emoji-data) pname src;
491 version = lib.removePrefix "v" sources.emoji-data.version; 613 version = lib.removePrefix "v" sources.emoji-data.version;
@@ -573,11 +695,11 @@ in {
573 exec -- \ 695 exec -- \
574 ${lib.getExe' config.systemd.package "systemd-run"} --wait --user --slice-inherit \ 696 ${lib.getExe' config.systemd.package "systemd-run"} --wait --user --slice-inherit \
575 --property 'CPUAccounting=yes' --property 'CPUQuotaPeriodSec=50ms' \ 697 --property 'CPUAccounting=yes' --property 'CPUQuotaPeriodSec=50ms' \
576 --property 'Environment=DSCP=46' \ 698 -E DSCP=46 -E NIXOS_OZONE_WL \
577 -- ${lib.getExe pkgs.dscp} ${lib.getExe' pkgs.google-chrome "google-chrome-stable"} \ 699 -- ${lib.getExe pkgs.dscp} ${lib.getExe cfg.programs.chromium.package} \
578 --class=Rainbow \ 700 --class=Rainbow \
579 --kiosk "https://web.openrainbow.com" \ 701 --app="https://web.openrainbow.com" \
580 --user-data-dir=''${HOME}/.config/google-chrome-rainbow 702 --user-data-dir=''${HOME}/.config/chromium-rainbow
581 ''); 703 '');
582 icon = pkgs.fetchurl { 704 icon = pkgs.fetchurl {
583 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";
@@ -587,6 +709,53 @@ in {
587 StartupWMClass = "Rainbow"; 709 StartupWMClass = "Rainbow";
588 }; 710 };
589 }; 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 };
758 };
590 }; 759 };
591 760
592 fonts = { 761 fonts = {