From 20e7a2a2544afd682f487327aa42d1899784db98 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 28 Jun 2022 15:04:28 +0200 Subject: ... --- accounts/gkleen@sif/default.nix | 606 ++++++++++++++++++++-------------------- 1 file changed, 309 insertions(+), 297 deletions(-) (limited to 'accounts') diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix index 66328970..4d4eb7be 100644 --- a/accounts/gkleen@sif/default.nix +++ b/accounts/gkleen@sif/default.nix @@ -43,350 +43,362 @@ in { imports = with flake.nixosModules.userProfiles.${userName}; [ mpv yt-dlp (args: import ./xcompose.nix (inputs // args)) ]; - - config.home-manager.users.${userName} = { - nixpkgs.config = { - allowUnfree = true; - zathura.useMupdf = false; - }; - - programs = { - ssh = { - matchBlocks = import ./ssh-hosts.nix { inherit pkgs; }; # customUtils.nixImport { dir = ./ssh-hosts; }; - extraConfig = '' - 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" - ProxyJump remote.cip.ifi.lmu.de - - Match host *.mathinst.loc,*.cipmath.loc,*.math.lmu.de - IdentityFile ~/.ssh/gkleen@mathinst.loc - HostKeyAlgorithms +ssh-rsa - PubkeyAcceptedAlgorithms +ssh-rsa - ConnectTimeout 30 - PasswordAuthentication yes - KbdInteractiveAuthentication yes - - Match host *.mathinst.loc !host mathw0g.mathinst.loc !exec "nc -z -w 1 %h %p &>/dev/null" - # ProxyCommand ${pkgs.socat}/bin/socat - SOCKS4A:127.0.0.1:%h:%p,socksport=8118 - ProxyJump mathw0g - - Match host mathw0g.mathinst.loc !exec "nc -z -w 1 %h %p &>/dev/null" - HostName mathw0g.math.lmu.de - - Match host *.cipmath.loc !exec "nc -z -w 1 %h %p &>/dev/null" - ProxyJump mathw0h - - Match host *.ifi.lmu.de,*.math.lmu.de - AddressFamily inet - - Match host *.mgmt.yggdrasil - ProxyJump vidhar - - Host * + + config = { + services.xserver = { + displayManager.defaultSession = "none+xmonad"; + + windowManager.session = [{ + name = "xmonad"; + start = '' + ${pkgs.systemd}/bin/systemd-cat -t xmonad -- ${pkgs.coreutils}/bin/env -u SHLVL -- ${xmonad}/bin/xmonad & + waitPID=$! ''; - }; + }]; + }; - emacs = { - enable = true; - extraPackages = epkgs: with epkgs; [ - evil evil-dvorak undo-tree magit haskell-mode nix-mode - yaml-mode json-mode shakespeare-mode smart-mode-line - highlight-parentheses highlight-symbol ag sass-mode lua-mode - fira-code-mode use-package # notmuch - use-package-ensure-system-package git-gutter emacsScratch - edit-server mediawiki editorconfig typescript-mode - markdown-mode - ]; + home-manager.users.${userName} = { + nixpkgs.config = { + allowUnfree = true; + zathura.useMupdf = false; }; - firefox = { - enable = true; - profiles.default = { - settings = { - "layout.css.devPixelsPerPx" = "1.75"; - "browser.tabs.drawInTitlebar" = false; - "toolkit.legacyUserProfileCustomizations.stylesheets" = true; - "dom.security.https_only_mode" = true; + + programs = { + ssh = { + matchBlocks = import ./ssh-hosts.nix { inherit pkgs; }; # customUtils.nixImport { dir = ./ssh-hosts; }; + extraConfig = '' + 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" + ProxyJump remote.cip.ifi.lmu.de + + Match host *.mathinst.loc,*.cipmath.loc,*.math.lmu.de + IdentityFile ~/.ssh/gkleen@mathinst.loc + HostKeyAlgorithms +ssh-rsa + PubkeyAcceptedAlgorithms +ssh-rsa + ConnectTimeout 30 + PasswordAuthentication yes + KbdInteractiveAuthentication yes + + Match host *.mathinst.loc !host mathw0g.mathinst.loc !exec "nc -z -w 1 %h %p &>/dev/null" + # ProxyCommand ${pkgs.socat}/bin/socat - SOCKS4A:127.0.0.1:%h:%p,socksport=8118 + ProxyJump mathw0g + + Match host mathw0g.mathinst.loc !exec "nc -z -w 1 %h %p &>/dev/null" + HostName mathw0g.math.lmu.de + + Match host *.cipmath.loc !exec "nc -z -w 1 %h %p &>/dev/null" + ProxyJump mathw0h + + Match host *.ifi.lmu.de,*.math.lmu.de + AddressFamily inet + + Match host *.mgmt.yggdrasil + ProxyJump vidhar + + Host * + ''; + }; + + emacs = { + enable = true; + extraPackages = epkgs: with epkgs; [ + evil evil-dvorak undo-tree magit haskell-mode nix-mode + yaml-mode json-mode shakespeare-mode smart-mode-line + highlight-parentheses highlight-symbol ag sass-mode lua-mode + fira-code-mode use-package # notmuch + use-package-ensure-system-package git-gutter emacsScratch + edit-server mediawiki editorconfig typescript-mode + markdown-mode + ]; + }; + firefox = { + enable = true; + profiles.default = { + settings = { + "layout.css.devPixelsPerPx" = "1.75"; + "browser.tabs.drawInTitlebar" = false; + "toolkit.legacyUserProfileCustomizations.stylesheets" = true; + "dom.security.https_only_mode" = true; + }; }; }; - }; - alacritty = { - enable = true; - settings = import ./alacritty.nix; - }; + alacritty = { + enable = true; + settings = import ./alacritty.nix; + }; - zathura.enable = true; + zathura.enable = true; - mpv.config = { - demuxer-max-bytes = 1073741824; - demuxer-max-back-bytes = 268435456; - # gpu-api = "vulkan"; - }; + mpv.config = { + demuxer-max-bytes = 1073741824; + demuxer-max-back-bytes = 268435456; + # gpu-api = "vulkan"; + }; - autorandr = { - enable = true; - hooks = { - preswitch = { - "stop-tray" = '' - ${pkgs.systemd}/bin/systemctl --user try-restart tray.target - ''; - }; - postswitch = { - # "restart-compton" = "${pkgs.systemd}/bin/systemctl --user try-restart picom"; - "restart-tray" = '' - ${pkgs.systemd}/bin/systemctl --user try-restart tray.target - ''; + autorandr = { + enable = true; + hooks = { + preswitch = { + "stop-tray" = '' + ${pkgs.systemd}/bin/systemctl --user try-restart tray.target + ''; + }; + postswitch = { + # "restart-compton" = "${pkgs.systemd}/bin/systemctl --user try-restart picom"; + "restart-tray" = '' + ${pkgs.systemd}/bin/systemctl --user try-restart tray.target + ''; + }; }; + profiles = customUtils.nixImport rec { dir = ./autorandr-profiles; _import = name: _base: import "${toString dir}/${name}" inputs; }; }; - profiles = customUtils.nixImport rec { dir = ./autorandr-profiles; _import = name: _base: import "${toString dir}/${name}" inputs; }; - }; - zsh.initExtra = "source ${./zshrc}"; - zsh.dirHashes = let - flakeHashes = lib.mapAttrs' (n: v: lib.nameValuePair (inputNames.${n} or n) (toString v)) flakeInputs; - inputNames = { - "nixpkgs" = "nixos"; + zsh.initExtra = "source ${./zshrc}"; + zsh.dirHashes = let + flakeHashes = lib.mapAttrs' (n: v: lib.nameValuePair (inputNames.${n} or n) (toString v)) flakeInputs; + inputNames = { + "nixpkgs" = "nixos"; + }; + in flakeHashes // { + u2w = "$HOME/projects/uni2work"; + docs = "$HOME/documents"; + dl = "$HOME/Downloads"; + flk = "$HOME/config/nixos-flakes"; + rz = "$HOME/projects/rz"; }; - in flakeHashes // { - u2w = "$HOME/projects/uni2work"; - docs = "$HOME/documents"; - dl = "$HOME/Downloads"; - flk = "$HOME/config/nixos-flakes"; - rz = "$HOME/projects/rz"; - }; - obs-studio = { - enable = true; - plugins = with pkgs; []; - }; - - gh = { - enable = true; - settings = { - editor = "${config.home-manager.users.${userName}.programs.emacs.package}/bin/emacsclient"; - gitProtocol = "ssh"; + obs-studio = { + enable = true; + plugins = with pkgs; []; }; - }; - nix-index.enable = true; - }; + gh = { + enable = true; + settings = { + editor = "${config.home-manager.users.${userName}.programs.emacs.package}/bin/emacsclient"; + gitProtocol = "ssh"; + }; + }; - services = { - dunst = { - settings = import ./dunst-settings.nix inputs; - iconTheme = cfg.gtk.iconTheme; - enable = true; + nix-index.enable = true; }; - emacs = { - enable = true; - client = { + + services = { + dunst = { + settings = import ./dunst-settings.nix inputs; + iconTheme = cfg.gtk.iconTheme; enable = true; - arguments = lib.mkForce ["-a" "\"\""]; }; - }; - gpg-agent = { - enable = true; - enableSshSupport = true; - extraConfig = '' - pinentry-program ${pkgs.pinentry-gtk2}/bin/pinentry - grab - ''; - }; - taffybar = { - enable = true; - package = import ./taffybar { haskellPackages = pkgs.haskell.packages.ghc8107; }; - }; - status-notifier-watcher.enable = true; - xembed-sni-proxy.enable = true; - pasystray.enable = true; - udiskie = { - enable = true; - automount = false; - }; - unclutter = { - enable = true; - timeout = 5; - }; - network-manager-applet.enable = true; - blueman-applet.enable = true; + emacs = { + enable = true; + client = { + enable = true; + arguments = lib.mkForce ["-a" "\"\""]; + }; + }; + gpg-agent = { + enable = true; + enableSshSupport = true; + extraConfig = '' + pinentry-program ${pkgs.pinentry-gtk2}/bin/pinentry + grab + ''; + }; + taffybar = { + enable = true; + package = import ./taffybar { haskellPackages = pkgs.haskell.packages.ghc8107; }; + }; + status-notifier-watcher.enable = true; + xembed-sni-proxy.enable = true; + pasystray.enable = true; + udiskie = { + enable = true; + automount = false; + }; + unclutter = { + enable = true; + timeout = 5; + }; + network-manager-applet.enable = true; + blueman-applet.enable = true; - sxhkd = { - enable = true; - keybindings = { - "button8" = "${muteScript}/bin/mute unmute"; - "@button8" = "${muteScript}/bin/mute mute"; - "button9" = "${pkgs.pulseaudio}/bin/pacmd set-sink-mute @DEFAULT_SINK@ 1"; - "@button9" = "${pkgs.pulseaudio}/bin/pacmd set-sink-mute @DEFAULT_SINK@ 0"; + sxhkd = { + enable = true; + keybindings = { + "button8" = "${muteScript}/bin/mute unmute"; + "@button8" = "${muteScript}/bin/mute mute"; + "button9" = "${pkgs.pulseaudio}/bin/pacmd set-sink-mute @DEFAULT_SINK@ 1"; + "@button9" = "${pkgs.pulseaudio}/bin/pacmd set-sink-mute @DEFAULT_SINK@ 0"; + }; }; - }; - unison = { - enable = true; - pairs = { - documents = { - roots = ["${cfg.home.homeDirectory}/documents" "ssh://unison.vidhar/documents"]; - stateDirectory = "${cfg.xdg.dataHome}/documents.unison"; - commandOptions = { - auto = "true"; - batch = "true"; - log = "false"; - repeat = "watch"; - sshcmd = "${pkgs.openssh}/bin/ssh"; - ui = "text"; + unison = { + enable = true; + pairs = { + documents = { + roots = ["${cfg.home.homeDirectory}/documents" "ssh://unison.vidhar/documents"]; + stateDirectory = "${cfg.xdg.dataHome}/documents.unison"; + commandOptions = { + auto = "true"; + batch = "true"; + log = "false"; + repeat = "watch"; + sshcmd = "${pkgs.openssh}/bin/ssh"; + ui = "text"; + }; }; }; }; - }; - easyeffects = { - enable = true; - preset = "LoudnessEqualizer"; - }; + easyeffects = { + enable = true; + preset = "LoudnessEqualizer"; + }; - screen-locker = { - enable = true; - lockCmd = toString (pkgs.writeShellScript "lock" '' - cleanup() { - ${cfg.services.dunst.package}/bin/dunstctl set-paused false - } - trap cleanup EXIT INT TERM - - ${pkgs.playerctl}/bin/playerctl -a pause - ${cfg.services.dunst.package}/bin/dunstctl set-paused true - ${pkgs.xsecurelock}/bin/xsecurelock - ''); - xss-lock.extraOptions = ["--transfer-sleep-lock"]; + screen-locker = { + enable = true; + lockCmd = toString (pkgs.writeShellScript "lock" '' + cleanup() { + ${cfg.services.dunst.package}/bin/dunstctl set-paused false + } + trap cleanup EXIT INT TERM + + ${pkgs.playerctl}/bin/playerctl -a pause + ${cfg.services.dunst.package}/bin/dunstctl set-paused true + ${pkgs.xsecurelock}/bin/xsecurelock + ''); + xss-lock.extraOptions = ["--transfer-sleep-lock"]; + }; }; - }; - home.pointerCursor = { - package = pkgs.vanilla-dmz; - name = "Vanilla-DMZ-AA"; - size = 32; + home.pointerCursor = { + package = pkgs.vanilla-dmz; + name = "Vanilla-DMZ-AA"; + size = 32; - x11 = { - enable = true; - defaultCursor = "left_ptr"; + x11 = { + enable = true; + defaultCursor = "left_ptr"; + }; + gtk.enable = true; }; - gtk.enable = true; - }; - gtk = { - enable = true; - font = { - package = pkgs.fira; - name = "Fira Sans"; - size = 6; - }; - theme = { - package = pkgs.equilux-theme; - name = "Equilux-compact"; - }; - iconTheme = { - package = pkgs.paper-icon-theme; - name = "Paper"; + gtk = { + enable = true; + font = { + package = pkgs.fira; + name = "Fira Sans"; + size = 6; + }; + theme = { + package = pkgs.equilux-theme; + name = "Equilux-compact"; + }; + iconTheme = { + package = pkgs.paper-icon-theme; + name = "Paper"; + }; }; - }; - - xsession = { - enable = true; - windowManager.command = "${pkgs.coreutils}/bin/env -u SHLVL -- ${xmonad}/bin/xmonad"; - - initExtra = '' - ${pkgs.xorg.xinput}/bin/xinput disable 'Synaptics TM3512-010' - ${pkgs.xorg.xmodmap}/bin/xmodmap -e 'keysym Caps_Lock = Multi_key' - ''; - }; + xsession = { + enable = true; - xresources.properties = import ./xresources.nix; - - home = { - packages = with pkgs; [ - fira fira-code powerline-fonts nerdfonts pavucontrol keepassxc - sxiv xclip mumble pulseaudio-ctl pamixer libnotify synergy - xorg.xbacklight screen-message - ytmdesktop qt5ct playerctl evince - thunderbird wrappedZulip zoom-us steam steam-run wireshark - virt-manager rclone cached-nix-shell xournal xmonad worktime - fira-code-symbols libreoffice xournalpp wrappedChrome - nixos-shell virt-viewer freerdp gnome-icon-theme - paper-icon-theme sshpassSecret weechat helvum - wrappedElementDesktop matrix-synapse-tools.synadm - wrappedRocketChatDesktop - flakeInputs.deploy-rs.packages.${config.nixpkgs.system}.deploy-rs - sieve-connect - ]; - - file = { - ".emacs".source = ./emacs.el; - ".backup-munin".source = ./backup-patterns; - ".mozilla/firefox/default/chrome/userChrome.css".source = ./firefox-chrome.css; - ".mozilla/firefox/default/chrome/userContent.css".source = ./firefox-content.css; + initExtra = '' + ${pkgs.xorg.xinput}/bin/xinput disable 'Synaptics TM3512-010' + ${pkgs.xorg.xmodmap}/bin/xmodmap -e 'keysym Caps_Lock = Multi_key' + ''; }; - sessionVariables = { - GDK_SCALE = 96.0 / 282.0; - QT_AUTO_SCREEN_SCALE_FACTOR = 1; - QT_QPA_PLATFORMTHEME = "qt5ct"; - LIBVIRT_DEFAULT_URI = "qemu:///system"; - }; + xresources.properties = import ./xresources.nix; + + home = { + packages = with pkgs; [ + fira fira-code powerline-fonts nerdfonts pavucontrol keepassxc + sxiv xclip mumble pulseaudio-ctl pamixer libnotify synergy + xorg.xbacklight screen-message + ytmdesktop qt5ct playerctl evince + thunderbird wrappedZulip zoom-us steam steam-run wireshark + virt-manager rclone cached-nix-shell xournal xmonad worktime + fira-code-symbols libreoffice xournalpp wrappedChrome + nixos-shell virt-viewer freerdp gnome-icon-theme + paper-icon-theme sshpassSecret weechat helvum + wrappedElementDesktop matrix-synapse-tools.synadm + wrappedRocketChatDesktop + flakeInputs.deploy-rs.packages.${config.nixpkgs.system}.deploy-rs + sieve-connect + ]; - extraProfileCommands = '' - export XDG_DATA_DIRS="${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}:${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}''${XDG_DATA_DIRS:+:''${XDG_DATA_DIRS}}" - ''; + file = { + ".emacs".source = ./emacs.el; + ".backup-munin".source = ./backup-patterns; + ".mozilla/firefox/default/chrome/userChrome.css".source = ./firefox-chrome.css; + ".mozilla/firefox/default/chrome/userContent.css".source = ./firefox-content.css; + }; - keyboard = { - layout = "us"; - variant = "dvp"; - options = [ "ctl:nocaps" "compose:caps" ]; - }; - }; + sessionVariables = { + GDK_SCALE = 96.0 / 282.0; + QT_AUTO_SCREEN_SCALE_FACTOR = 1; + QT_QPA_PLATFORMTHEME = "qt5ct"; + LIBVIRT_DEFAULT_URI = "qemu:///system"; + }; - xdg.configFile = { - "dunst/dunstrc.d" = { - source = ./dunstrc.d; - recursive = true; - onChange = '' - ${pkgs.systemd}/bin/systemctl --user try-restart dunst + extraProfileCommands = '' + export XDG_DATA_DIRS="${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}:${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}''${XDG_DATA_DIRS:+:''${XDG_DATA_DIRS}}" ''; + + keyboard = { + layout = "us"; + variant = "dvp"; + options = [ "ctl:nocaps" "compose:caps" ]; + }; }; - "wireplumber" = { - source = ./wireplumber; - recursive = true; - onChange = '' - ${pkgs.systemd}/bin/systemctl --user try-restart wireplumber - ''; + + xdg.configFile = { + "dunst/dunstrc.d" = { + source = ./dunstrc.d; + recursive = true; + onChange = '' + ${pkgs.systemd}/bin/systemctl --user try-restart dunst + ''; + }; + "wireplumber" = { + source = ./wireplumber; + recursive = true; + onChange = '' + ${pkgs.systemd}/bin/systemctl --user try-restart wireplumber + ''; + }; }; - }; - xdg.dataFile = { - "pandoc/abbreviations" = { - source = pkgs.runCommand "pandoc-abbreviations" { - buildInputs = [ pkgs.pandoc pkgs.coreutils ]; - } (let - germanAbbrevs = pkgs.fetchFromGitHub { - owner = "jfilter"; - repo = "german-abbreviations"; - rev = "8eb9dae93b6f05d7c53374cd217ab2dc89558e0c"; - sha256 = "SaD3tSqzen6Y3SPICe6/9vhe4iMHlArZ3kFQaEk7Hps="; - }; - in '' - cat \ - <(pandoc --print-default-data-file=abbreviations) \ - <(grep -E '^[^ ]+\.$' ${germanAbbrevs}/german_abbreviations.txt) \ - ${pkgs.writeText "abbrevs.txt" '' - i.A. - d.h. - D.h. - gdw. - ''} \ - | sort | uniq >$out - ''); + xdg.dataFile = { + "pandoc/abbreviations" = { + source = pkgs.runCommand "pandoc-abbreviations" { + buildInputs = [ pkgs.pandoc pkgs.coreutils ]; + } (let + germanAbbrevs = pkgs.fetchFromGitHub { + owner = "jfilter"; + repo = "german-abbreviations"; + rev = "8eb9dae93b6f05d7c53374cd217ab2dc89558e0c"; + sha256 = "SaD3tSqzen6Y3SPICe6/9vhe4iMHlArZ3kFQaEk7Hps="; + }; + in '' + cat \ + <(pandoc --print-default-data-file=abbreviations) \ + <(grep -E '^[^ ]+\.$' ${germanAbbrevs}/german_abbreviations.txt) \ + ${pkgs.writeText "abbrevs.txt" '' + i.A. + d.h. + D.h. + gdw. + ''} \ + | sort | uniq >$out + ''); + }; }; - }; - fonts.fontconfig.enable = true; + fonts.fontconfig.enable = true; - systemd.user = import ./systemd.nix inputs; + systemd.user = import ./systemd.nix inputs; + }; }; } -- cgit v1.2.3