{ pkgs, lib, config, nixosConfig, ... }: let wrap = name: pkg: postBuild: pkgs.symlinkJoin { inherit name postBuild; paths = [pkg]; buildInputs = [pkgs.makeWrapper]; }; fixGdk = name: pkg: wrap name pkg '' wrapProgram $out/bin/${name} --set GDK_BACKEND x11 ''; lutrisWithLibs = pkgs.lutris.override { extraLibraries = pkgs: with pkgs; [ xz libstdcxx5 # For Hotline: Miami expat openal nvidia_cg_toolkit # For Dead Cells # Provides libXss.1 xorg.libXScrnSaver ]; }; firefoxWithProfile = exe: profile: pkgs.writeShellApplication { name = exe; runtimeInputs = [pkgs.firefox]; text = '' firefox -P "${profile}" ''; }; nnnIcons = pkgs.nnn.override {withNerdIcons = true;}; in { imports = [ ./modules/git.nix ./modules/shell.nix ./modules/kitty.nix ./modules/gpg.nix ./modules/mail.nix ./modules/pass.nix ./modules/zathura.nix ./modules/scarlett-solo.nix ./modules/helix.nix ./modules/mpv.nix ./modules/hypr.nix ./modules/notes.nix ../modules/restic-backup.nix ../modules/profiles-cleanup.nix ../modules/aichat.nix ]; config = { settings.hyprland.enable = true; settings.mail.enable = true; home = { packages = [ pkgs.prismlauncher pkgs.jq pkgs.mosh pkgs.wl-clipboard lutrisWithLibs (firefoxWithProfile "ff" "default") (firefoxWithProfile "ff-work" "Work") ] ++ (with pkgs; [ alejandra element-desktop-wayland feh (pkgs.discord.override { withOpenASAR = true; withVencord = true; }) vesktop (pkgs.callPackage ../../pkgs/mattermost-desktop.nix {}) (fixGdk "losslesscut" losslesscut-bin) (fixGdk "skypeforlinux" skypeforlinux) # geekbench gimp nautilus sushi simple-scan helvum hledger inkscape kbdlight libnotify libreoffice mensa mumble nickel patchelf pavucontrol pdftk pkgs."2i-emulator" ponymix pulseaudio python3 qt5ct rtorrent screenfetch signal-desktop # FIXME: Once it works again? (fixElectron "signal-desktop" signal-desktop) sshfs tdesktop unar unison vlc vscode wev xdg_utils xournalpp yt-dlp # youtube-dl alternative that doesn't suck nnnIcons nushell protonmail-desktop ]); sessionVariables = { MOZ_USE_XINPUT2 = "1"; }; pointerCursor = { name = "phinger-cursors-dark"; package = pkgs.phinger-cursors; size = 32; gtk.enable = true; }; # Use default US, so that games don't get too confused. But let me # switch to a more comfortable workman layout! keyboard = null; # Use some german units and formats but with the english language! language = { base = "en_US.UTF-8"; address = "de_DE.UTF-8"; measurement = "de_DE.UTF-8"; monetary = "de_DE.UTF-8"; name = "de_DE.UTF-8"; paper = "de_DE.UTF-8"; telephone = "de_DE.UTF-8"; time = "de_DE.UTF-8"; }; }; xdg.enable = true; # Make sure firefox is my default browser programs.firefox.enable = true; programs.aichat = { enable = true; openaiApiKeyFile = nixosConfig.sops.secrets.openai-aichat-api-key.path; settings = { model = "openai:gpt-4o"; clients = [ {type = "openai";} ]; save = true; save_session = true; highlight = true; light_theme = true; wrap = "auto"; keybindings = "vi"; }; roles = { emoji.prompt = '' I want you to translate the sentences I write into emojis. I will write the sentence, and you will express it with emojis. I don't want you to reply with anything but emoji. ''; }; }; programs.obs-studio = { enable = true; plugins = [ pkgs.obs-studio-plugins.wlrobs #pkgs.obs-studio-plugins.v4l2sink ]; }; # Configure restic backups services.restic = { enable = true; paths = [ "/home/malte/Documents" "/home/malte/Lieder" "/home/malte/Pictures" "/home/malte/Uni" "/home/malte/helden" "/home/malte/ledger" "/home/malte/vimwiki" ]; }; services.darkman = { enable = true; settings = { lat = 51.34; lng = 12.36; }; }; services.mpris-proxy.enable = true; services.pasystray.enable = true; services.pueue = { enable = true; settings = { shared = {}; daemon.callback = "notify-send \"Task {{ id }}\nCommand: {{ command }}\nStatus '{{ result }}'\nTook: $(${pkgs.bc}/bin/bc <<< \"{{end}} - {{start}}\") seconds\""; }; }; programs.fish.shellAliases.p = "pueue"; fonts.fontconfig.enable = true; home.file.".yubico/authorized_yubikeys".text = "malte:ccccccvblrrf"; xdg.configFile."nix/nix.conf".text = '' include ${nixosConfig.sops.secrets.nix-conf-secrets.path} ''; services.darkman.lightModeScripts."home-manager-generation" = lib.getExe (pkgs.writeShellApplication { name = "darkman-switch-light-home-manager-generation"; runtimeInputs = [pkgs.findutils pkgs.gawk pkgs.home-manager pkgs.coreutils pkgs.bash]; text = '' for path in $(home-manager generations | awk '{print $7}'); do activate="$path/specialisation/light/activate" if [ -x "$activate" ]; then echo "$activate" fi done | head -n1 | xargs sh ''; }); services.darkman.darkModeScripts."home-manager-generation" = lib.getExe (pkgs.writeShellApplication { name = "darkman-switch-dark-home-manager-generation"; runtimeInputs = [pkgs.findutils pkgs.gawk pkgs.home-manager pkgs.coreutils pkgs.bash]; text = '' for path in $(home-manager generations | awk '{print $7}'); do activate="$path/specialisation/dark/activate" if [ -x "$activate" ]; then echo "$activate" fi done | head -n1 | xargs sh ''; }); home.stateVersion = "18.09"; }; }