{ flake, userName, pkgs, customUtils, lib, config, ... }@inputs: let cfg = config.home-manager.users.${userName}; xmonad = import ./xmonad pkgs.haskellPackages; emacsclientDesktopItem = pkgs.makeDesktopItem { name = "emacsclient"; genericName = "Text Editor"; desktopName = "emacsclient"; icon = "emacs"; mimeType = "text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;"; exec = "${config.home-manager.users.${userName}.programs.emacs.package}/bin/emacsclient -a \"\" %F"; }; emacsScratch = pkgs.stdenv.mkDerivation rec { pname = "scratch"; version = "0077334cc299aa7885f804d88f52cdb1b35caf71"; src = pkgs.fetchFromGitHub { owner = "ffevotte"; repo = "scratch.el"; rev = version; sha256 = "sha256-FUkKJ+1COGzgllzzv51yUIjMZI6slOFVExdwWl2ZEBA="; }; phases = [ "installPhase" ]; installPhase = '' mkdir -p $out/share/emacs/site-lisp cp $src/scratch.el $out/share/emacs/site-lisp/default.el ''; }; muteScript = pkgs.stdenv.mkDerivation { name = "mute"; src = ./scripts/mute.zsh; buildInputs = with pkgs; [ makeWrapper ]; phases = [ "installPhase" ]; installPhase = '' mkdir -p $out/bin install -m 0755 $src $out/bin/mute wrapProgram $out/bin/mute \ --prefix PATH : ${pkgs.zsh}/bin \ --prefix PATH : ${pkgs.findutils}/bin \ --prefix PATH : ${pkgs.util-linux}/bin \ --prefix PATH : ${pkgs.coreutils}/bin \ --prefix PATH : ${pkgs.pulseaudio}/bin ''; }; in { imports = with flake.nixosModules.userProfiles.${userName}; [ mpv ]; home-manager.users.${userName} = { programs = { ssh = { matchBlocks = import ./ssh-hosts.nix; # customUtils.recImport { 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 gate2 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 notmuch ag sass-mode lua-mode fira-code-mode use-package use-package-ensure-system-package git-gutter emacsScratch ]; }; 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; }; }; }; urxvt = { enable = true; package = pkgs.rxvt_unicode-with-plugins; fonts = [ "xft:FiraCode Nerd Font Mono:style=Regular:pixelsize=21" ]; scroll = { lines = 0; bar.enable = false; }; extraConfig = { urgentOnBell = false; print-pipe = "cat >/dev/null"; perl-ext-common = "52-osc,url-select"; "url-select.launcher" = "firefox"; "url-select.underline" = true; }; keybindings = { "M-u" = "perl:url-select:select_next"; }; }; zathura = { enable = true; package = pkgs.zathura.override { useMupdf = false; }; }; mpv.config = { demuxer-max-bytes = 1073741824; demuxer-max-back-bytes = 268435456; }; autorandr = { enable = true; hooks.postswitch = { # "restart-compton" = "${pkgs.systemd}/bin/systemctl --user try-restart picom"; "restart-trays" = '' ${pkgs.coreutils}/bin/sleep 5 ${pkgs.systemd}/bin/systemctl --user try-restart trayer xmobar ''; }; profiles = customUtils.recImport { dir = ./autorandr-profiles; }; }; zsh.initExtra = "source ${./zshrc}"; zsh.dirHashes = { u2w = "$HOME/projects/uni2work"; docs = "$HOME/documents"; dl = "$HOME/Downloads"; flk = "$HOME/config/nixos-flakes"; fsk-timi = "$HOME/projects/21s/fsk-timi"; }; obs-studio = { enable = true; plugins = with pkgs; [obs-v4l2sink]; }; }; services = { dunst = { settings = import ./dunst-settings.nix inputs; iconTheme = cfg.gtk.iconTheme; enable = true; }; emacs.enable = true; gpg-agent = { enable = true; enableSshSupport = true; extraConfig = '' pinentry-program ${pkgs.pinentry-gtk2}/bin/pinentry grab ''; }; 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"; }; }; }; gtk = { enable = true; font.name = "DejaVu Sans 6"; theme = { package = pkgs.equilux-theme; name = "Equilux-compact"; }; iconTheme = { package = pkgs.paper-icon-theme; name = "Paper"; }; }; xsession = { enable = true; windowManager.command = "${xmonad}/bin/xmonad"; initExtra = let lockScript = pkgs.writeScript "lock" '' #!${pkgs.stdenv.shell} ${pkgs.playerctl}/bin/playerctl -a pause exec ${pkgs.xsecurelock}/bin/xsecurelock ''; in '' ${pkgs.coreutils}/bin/env XSECURELOCK_WANT_FIRST_KEYPRESS=1 XSECURELOCK_DIM_ALPHA=1 ${pkgs.xss-lock}/bin/xss-lock -l -n ${pkgs.xsecurelock}/libexec/xsecurelock/dimmer -- ${lockScript} & ${pkgs.xorg.xinput}/bin/xinput disable 'Synaptics TM3512-010' ${pkgs.xorg.xset}/bin/xset s 590 10 ''; }; xresources.properties = import ./xresources.nix; home = { packages = with pkgs; [ fira-code powerline-fonts nerdfonts pavucontrol keepassxc youtube-dl sxiv xclip mumble pulseaudio-ctl libnotify synergy xorg.xbacklight screen-message pidgin-with-plugins google-play-music-desktop-player qt5ct playerctl evince thunderbird zulip zoom-us steam steam-run wireshark skype virt-manager rclone cached-nix-shell xournal discord xmonad worktime fira-code-symbols emacsclientDesktopItem libreoffice xournalpp ]; 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; }; sessionVariables = { GDK_SCALE = 96.0 / 282.0; QT_AUTO_SCREEN_SCALE_FACTOR = 1; QT_QPA_PLATFORMTHEME = "qt5ct"; }; 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}}" ''; stateVersion = "20.03"; }; fonts.fontconfig.enable = true; systemd.user = import ./systemd.nix inputs; }; }