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.nix107
1 files changed, 32 insertions, 75 deletions
diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix
index 6f720bbf..1254b6db 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,7 +42,7 @@ 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 })
@@ -87,8 +56,6 @@ in {
87 ]; 56 ];
88 57
89 config = { 58 config = {
90 services.displayManager.defaultSession = "Hyprland"; # "none+xmonad";
91
92 home-manager.users.${userName} = { 59 home-manager.users.${userName} = {
93 imports = [ 60 imports = [
94 ./libvirt 61 ./libvirt
@@ -137,8 +104,8 @@ in {
137 ''} 104 ''}
138 105
139 Match host *.mathinst.loc,*.math.lmu.de !host ssh.math.lmu.de !exec "nc -z -w 1 %h %p &>/dev/null" 106 Match host *.mathinst.loc,*.math.lmu.de !host ssh.math.lmu.de !exec "nc -z -w 1 %h %p &>/dev/null"
140 # ProxyCommand ${pkgs.socat}/bin/socat - SOCKS4A:127.0.0.1:%h:%p,socksport=8118 107 ProxyCommand ${lib.getExe pkgs.socat} - SOCKS4A:127.0.0.1:%h:%p,socksport=8118
141 ProxyJump ssh.math.lmu.de 108 # ProxyJump ssh.math.lmu.de
142 109
143 Match host *.cipmath.loc !host cip04.cipmath.loc,mgmt-cls01.cipmath.loc !exec "nc -z -w 1 %h %p &>/dev/null" 110 Match host *.cipmath.loc !host cip04.cipmath.loc,mgmt-cls01.cipmath.loc !exec "nc -z -w 1 %h %p &>/dev/null"
144 ProxyJump cip04 111 ProxyJump cip04
@@ -159,18 +126,27 @@ in {
159 extraPackages = epkgs: with epkgs; [ 126 extraPackages = epkgs: with epkgs; [
160 evil evil-dvorak undo-tree magit haskell-tng-mode nix-mode 127 evil evil-dvorak undo-tree magit haskell-tng-mode nix-mode
161 yaml-mode json-mode shakespeare-mode smart-mode-line 128 yaml-mode json-mode shakespeare-mode smart-mode-line
162 highlight-parentheses highlight-symbol ag sass-mode lua-mode 129 highlight-parentheses highlight-symbol ag sass-mode
163 fira-code-mode use-package wanderlust # notmuch 130 lua-mode fira-code-mode use-package wanderlust # notmuch
164 git-gutter emacsScratch 131 git-gutter scratch edit-server mediawiki editorconfig
165 edit-server mediawiki editorconfig typescript-mode 132 typescript-mode markdown-mode nftables-mode rustic
166 markdown-mode nftables-mode rustic lsp-mode lsp-ui 133 lsp-mode lsp-ui direnv company projectile
167 direnv company projectile tomorrow-night-paradise-theme 134 tomorrow-night-paradise-theme
168 treesit-grammars.with-all-grammars magit-delta scad-mode 135 treesit-grammars.with-all-grammars magit-delta scad-mode
169 ]; 136 ];
170 overrides = self: super: { 137 overrides = self: super: {
171 tomorrow-night-paradise-theme = super.trivialBuild { 138 tomorrow-night-paradise-theme = super.trivialBuild {
172 inherit (sources.tomorrow-night-paradise-theme) pname version src; 139 inherit (sources.tomorrow-night-paradise-theme) pname version src;
173 }; 140 };
141 scratch = pkgs.stdenv.mkDerivation {
142 inherit (sources.emacs-scratch_el) pname version src;
143
144 phases = [ "unpackPhase" "installPhase" ];
145
146 installPhase = ''
147 install -Dt $out/share/emacs/site-lisp scratch.el
148 '';
149 };
174 }; 150 };
175 }; 151 };
176 firefox = { 152 firefox = {
@@ -226,7 +202,7 @@ in {
226 gh = { 202 gh = {
227 enable = true; 203 enable = true;
228 settings = { 204 settings = {
229 editor = "${config.home-manager.users.${userName}.programs.emacs.package}/bin/emacsclient"; 205 editor = lib.getExe' config.home-manager.users.${userName}.programs.emacs.package "emacsclient";
230 gitProtocol = "ssh"; 206 gitProtocol = "ssh";
231 }; 207 };
232 }; 208 };
@@ -287,6 +263,10 @@ in {
287 }; 263 };
288 }; 264 };
289 }; 265 };
266 pandoc = {
267 enable = true;
268 extraAbbreviations = ["i.A." "d.h." "D.h." "gdw."];
269 };
290 }; 270 };
291 271
292 services = { 272 services = {
@@ -302,7 +282,7 @@ in {
302 enable = true; 282 enable = true;
303 enableSshSupport = true; 283 enableSshSupport = true;
304 extraConfig = '' 284 extraConfig = ''
305 pinentry-program ${pkgs.pinentry-gtk2}/bin/pinentry 285 pinentry-program ${lib.getExe' pkgs.pinentry-gtk2 "pinentry"}
306 grab 286 grab
307 ''; 287 '';
308 }; 288 };
@@ -342,7 +322,7 @@ in {
342 batch = "true"; 322 batch = "true";
343 log = "false"; 323 log = "false";
344 repeat = "watch"; 324 repeat = "watch";
345 sshcmd = "${pkgs.openssh}/bin/ssh"; 325 sshcmd = lib.getExe' pkgs.openssh "ssh";
346 ui = "text"; 326 ui = "text";
347 }; 327 };
348 }; 328 };
@@ -418,13 +398,13 @@ in {
418 fira-code-symbols libreoffice xournalpp google-chrome 398 fira-code-symbols libreoffice xournalpp google-chrome
419 nixos-shell virt-viewer freerdp gnome-icon-theme 399 nixos-shell virt-viewer freerdp gnome-icon-theme
420 paper-icon-theme sshpassSecret weechat element-desktop 400 paper-icon-theme sshpassSecret weechat element-desktop
421 matrix-synapse-tools.synadm
422 flakeInputs.deploy-rs.packages.${config.nixpkgs.system}.deploy-rs 401 flakeInputs.deploy-rs.packages.${config.nixpkgs.system}.deploy-rs
423 sieve-connect gimp inkscape udiskie glab nitrokey-app 402 sieve-connect gimp inkscape udiskie glab nitrokey-app
424 pynitrokey gtklock wlrctl remmina openscad spice-record 403 pynitrokey gtklock wlrctl remmina openscad spice-record
425 libguestfs-with-appliance nerd-fonts.fira-mono 404 libguestfs-with-appliance nerd-fonts.fira-mono
426 nerd-fonts.symbols-only nerd-fonts.fira-code powerline-fonts 405 nerd-fonts.symbols-only nerd-fonts.fira-code powerline-fonts
427 swtpm (hunspellWithDicts (with hunspellDicts; [en_GB-large de_DE])) 406 swtpm (hunspellWithDicts (with hunspellDicts; [en_GB-large de_DE]))
407 # synadm
428 ]; 408 ];
429 409
430 file = { 410 file = {
@@ -448,9 +428,9 @@ in {
448 EDITOR = pkgs.writeShellScript "editor" '' 428 EDITOR = pkgs.writeShellScript "editor" ''
449 args=("--reuse-frame" "--alternate-editor" "") 429 args=("--reuse-frame" "--alternate-editor" "")
450 args+=("$@") 430 args+=("$@")
451 exec -a emacsclient ${cfg.services.emacs.package}/bin/emacsclient "''${args[@]}" 431 exec -a emacsclient ${lib.getExe' cfg.services.emacs.package "emacsclient"} "''${args[@]}"
452 ''; 432 '';
453 RCLONE_PASSWORD_COMMAND = "${pkgs.libsecret}/bin/secret-tool lookup service rclone"; 433 RCLONE_PASSWORD_COMMAND = "${lib.getExe' pkgs.libsecret "secret-tool"} lookup service rclone";
454 }; 434 };
455 435
456 extraProfileCommands = '' 436 extraProfileCommands = ''
@@ -463,7 +443,7 @@ in {
463 source = ./wireplumber; 443 source = ./wireplumber;
464 recursive = true; 444 recursive = true;
465 onChange = '' 445 onChange = ''
466 ${pkgs.systemd}/bin/systemctl --user try-restart wireplumber 446 ${lib.getExe' config.systemd.package "systemctl"} --user try-restart wireplumber
467 ''; 447 '';
468 }; 448 };
469 "stack/config.yaml" = { 449 "stack/config.yaml" = {
@@ -505,29 +485,6 @@ in {
505 }; 485 };
506 486
507 xdg.dataFile = { 487 xdg.dataFile = {
508 "pandoc/abbreviations" = {
509 source = pkgs.runCommand "pandoc-abbreviations" {
510 buildInputs = [ pkgs.pandoc pkgs.coreutils ];
511 } (let
512 germanAbbrevs = pkgs.fetchFromGitHub {
513 owner = "jfilter";
514 repo = "german-abbreviations";
515 rev = "8eb9dae93b6f05d7c53374cd217ab2dc89558e0c";
516 sha256 = "SaD3tSqzen6Y3SPICe6/9vhe4iMHlArZ3kFQaEk7Hps=";
517 };
518 in ''
519 cat \
520 <(pandoc --print-default-data-file=abbreviations) \
521 <(grep -E '^[^ ]+\.$' ${germanAbbrevs}/german_abbreviations.txt) \
522 ${pkgs.writeText "abbrevs.txt" ''
523 i.A.
524 d.h.
525 D.h.
526 gdw.
527 ''} \
528 | sort | uniq >$out
529 '');
530 };
531 "dbus-1/services/org.keepassxc.KeePassXC.service".source = "${wrappedKeepassxc}/share/dbus-1/services/org.keepassxc.KeePassXC.service"; 488 "dbus-1/services/org.keepassxc.KeePassXC.service".source = "${wrappedKeepassxc}/share/dbus-1/services/org.keepassxc.KeePassXC.service";
532 "dbus-1/services/org.freedesktop.secrets.service.service".source = "${wrappedKeepassxc}/share/dbus-1/services/org.freedesktop.secrets.service.service"; 489 "dbus-1/services/org.freedesktop.secrets.service.service".source = "${wrappedKeepassxc}/share/dbus-1/services/org.freedesktop.secrets.service.service";
533 "emoji-data/list.txt".source = pkgs.stdenv.mkDerivation { 490 "emoji-data/list.txt".source = pkgs.stdenv.mkDerivation {
@@ -615,10 +572,10 @@ in {
615 name = "Rainbow"; 572 name = "Rainbow";
616 exec = toString (pkgs.writeShellScript "rainbow" '' 573 exec = toString (pkgs.writeShellScript "rainbow" ''
617 exec -- \ 574 exec -- \
618 ${config.systemd.package}/bin/systemd-run --wait --user --slice-inherit \ 575 ${lib.getExe' config.systemd.package "systemd-run"} --wait --user --slice-inherit \
619 --property 'CPUAccounting=yes' --property 'CPUQuotaPeriodSec=50ms' \ 576 --property 'CPUAccounting=yes' --property 'CPUQuotaPeriodSec=50ms' \
620 --property 'Environment=DSCP=46' \ 577 --property 'Environment=DSCP=46' \
621 -- ${pkgs.dscp}/bin/dscp ${pkgs.google-chrome}/bin/google-chrome-stable \ 578 -- ${lib.getExe pkgs.dscp} ${lib.getExe' pkgs.google-chrome "google-chrome-stable"} \
622 --class=Rainbow \ 579 --class=Rainbow \
623 --kiosk "https://web.openrainbow.com" \ 580 --kiosk "https://web.openrainbow.com" \
624 --user-data-dir=''${HOME}/.config/google-chrome-rainbow 581 --user-data-dir=''${HOME}/.config/google-chrome-rainbow