diff options
Diffstat (limited to '')
35 files changed, 544 insertions, 230 deletions
diff --git a/modules/by-name/at/atuin/module.nix b/modules/by-name/at/atuin/module.nix index caabdf40..cfa10f71 100644 --- a/modules/by-name/at/atuin/module.nix +++ b/modules/by-name/at/atuin/module.nix @@ -39,6 +39,10 @@ in { }; soispha.programs.zsh.integrations.atuin = ./atuin.zsh; + soispha.services.unison.pathsToIgnore = [ + # Already synchronized by atuin sync server + "~/.local/share/atuin" + ]; home-manager.users.soispha = { programs.atuin = { diff --git a/modules/by-name/au/ausweisapp/module.nix b/modules/by-name/au/ausweisapp/module.nix index 3a89db9d..e74f3d91 100644 --- a/modules/by-name/au/ausweisapp/module.nix +++ b/modules/by-name/au/ausweisapp/module.nix @@ -14,5 +14,8 @@ in { soispha.impermanence.userDirectories = [ ".config/AusweisApp" ]; + soispha.services.unison.pathsToSync = [ + "~/.config/AusweisApp" + ]; }; } diff --git a/modules/by-name/ba/backup/env.vars b/modules/by-name/ba/backup/env.vars new file mode 100644 index 00000000..339c5a5b --- /dev/null +++ b/modules/by-name/ba/backup/env.vars @@ -0,0 +1 @@ +RESTIC_COMPRESSION=max diff --git a/modules/by-name/ba/backup/module.nix b/modules/by-name/ba/backup/module.nix index dd0dfac7..031445cf 100644 --- a/modules/by-name/ba/backup/module.nix +++ b/modules/by-name/ba/backup/module.nix @@ -63,12 +63,23 @@ in { soispha.impermanence.directories = lib.mkMerge [ (lib.mkIf cfg.storagebox.enable [ "/var/cache/restic-backups-storagebox" + + # Generate the base systemd.mount from impermanence (we will override this, so it + # points to the non-admin one instead) + "/var/cache/restic-backups-storagebox-admin" ]) (lib.mkIf cfg.local.enable [ "/var/cache/restic-backups-local" ]) ]; + # TODO: Make this work (`systemd.mounts` is a list, so _this_ doesn't work.) <2026-07-07> + # systemd.mounts."/var/cache/restic-backups-storagebox-admin" = { + # # TODO: Don't hardcode the path, but use + # # `systemd.mounts."/var/cache/restic-backups-storagebox".what` instead <2026-07-07> + # what = "/srv/var/cache/restic-backups-storagebox"; + # }; + age.secrets = { resticStorageboxSshKey = lib.mkIf cfg.storagebox.enable { file = cfg.storagebox.sshKey; @@ -97,6 +108,8 @@ in { }; }; + programs.fuse.enable = cfg.storagebox.enable || cfg.local.enable; + systemd.services = { prepare-backup = { requires = []; @@ -154,16 +167,21 @@ in { ]; exclude = [ "${homeDir}/soispha/.cache" + "${homeDir}/soispha/.local/share/lutris/install" + "${homeDir}/soispha/.local/share/Steam/steamapps/common" ]; extraBackupArgs = [ + # Don't scan the filesystem to determine an estimate. + "--no-scan" "--verbose=2" ]; + environmentFile = "${./env.vars}"; in { local = lib.mkIf cfg.local.enable { inhibitsSleep = true; initialize = true; - inherit paths exclude extraBackupArgs; + inherit paths exclude extraBackupArgs environmentFile; passwordFile = config.age.secrets.resticLocalRepositoryPassword.path; @@ -177,7 +195,7 @@ in { inhibitsSleep = true; initialize = true; - inherit paths exclude extraBackupArgs; + inherit paths exclude extraBackupArgs environmentFile; passwordFile = config.age.secrets.resticStorageboxRepositoryPassword.path; extraOptions = [ @@ -199,9 +217,13 @@ in { # This is only for listing, pruning and such stuff. storagebox-admin = lib.mkIf cfg.storagebox.enable { - inhibitsSleep = false; + inhibitsSleep = true; + + # Don't create the repository if it doesn't exist yet. initialize = false; + inherit paths exclude extraBackupArgs environmentFile; + passwordFile = config.age.secrets.resticStorageboxRepositoryPassword.path; extraOptions = [ "rclone.program='ssh -p 23 ${cfg.storagebox.user}@${cfg.storagebox.user}.your-storagebox.de command_forced_on_remote'" diff --git a/modules/by-name/bo/boot/module.nix b/modules/by-name/bo/boot/module.nix index 4dc9130a..80a47420 100644 --- a/modules/by-name/bo/boot/module.nix +++ b/modules/by-name/bo/boot/module.nix @@ -37,42 +37,43 @@ iso_options = ## General options? [ - "initrd=${tails.initrd}" - # "noprompt" - # "timezone=Etc/UTC" # "config" - # "noautologin" - # "slab_nomerge" - # "slub_debug=FZ" - # "mce=0" - # "vsyscall=none" - # "init_on_free=1" - # "mds=full,nosmt" - # "page_alloc.shuffle=1" - # "randomize_kstack_offset=on" - # "efi_pstore.pstore_disable=1" - # "erst_disable" - # "spec_store_bypass_disable=on" - # "systemd.condition_needs_update=no" + "initrd=${tails.initrd}" + + "efi_pstore.pstore_disable=1" + "erst_disable" + "init_on_free=1" + "mce=0" + "mds=full,nosmt" + "noautologin" + "noprompt" + "page_alloc.shuffle=1" + "randomize_kstack_offset=on" + "slab_nomerge" + "slub_debug=FZ" + "spec_store_bypass_disable=on" + "systemd.condition_needs_update=no" + "timezone=Etc/UTC" + "vsyscall=none" ] ## Systemd log options ++ [ - "systemd.log_level=debug" - "systemd.log_target=console" - "console=tty1" - "systemd.journald.forward_to_console=1" - "systemd.unit=rescue.target" + # "systemd.log_level=debug" + # "systemd.log_target=console" + # "console=tty1" + # "systemd.journald.forward_to_console=1" + # "systemd.unit=rescue.target" ] ## Options for the first `init` script ++ [ # Use the `*-live` scripts "boot=live" - # "splash" - "plymouth.enable=0" + "splash" + # "plymouth.enable=0" # "quiet" - "debug" + # "debug" ] ## Options for the `*-live` `init` scripts ++ [ @@ -207,6 +208,8 @@ in { }; extraFiles = { + # TODO: Check that the ISO we use for booting is _actually_ still the one we + # copied there (someone might exchange it in between) <2026-06-09> "${tails.root}" = "${iso}/tails.iso"; "${tails.vmlinuz}" = "${iso}/live/vmlinuz-linux"; "${tails.initrd}" = "${iso}/live/initrd.img"; diff --git a/modules/by-name/ca/calibre/module.nix b/modules/by-name/ca/calibre/module.nix new file mode 100644 index 00000000..4188e360 --- /dev/null +++ b/modules/by-name/ca/calibre/module.nix @@ -0,0 +1,38 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + config, + lib, + libraries, + ... +}: let + cfg = config.soispha.programs.calibre; +in { + options.soispha.programs.calibre = { + enable = libraries.base.options.mkEnable "calibre"; + }; + + config = lib.mkIf cfg.enable { + soispha.impermanence.userDirectories = [ + ".config/calibre" + ]; + soispha.services.unison.pathsToSync = [ + "~/.config/calibre" + ]; + + # Calibre depends on multiple “AI” slop stuff, which I don't really want to have in my + # closure. + # Considering, that calibre is probably also LLM friendly (and maybe contains + # vibe-coded stuff), I should probably replace it, but currently I'll keep it. + home-manager.users.soispha.programs.calibre = { + enable = false; + }; + }; +} diff --git a/modules/by-name/di/direnv/module.nix b/modules/by-name/di/direnv/module.nix index 363f5cea..baa0d954 100644 --- a/modules/by-name/di/direnv/module.nix +++ b/modules/by-name/di/direnv/module.nix @@ -11,26 +11,49 @@ config, lib, pkgs, + sources, ... }: let cfg = config.soispha.programs.direnv; + + inherit (sources) devshells nixpkgs; + + pre-cache = pkgs.runCommand "pre-cache.sh" {} '' + cat "${./pre-cache.sh}" > $out + + substituteInPlace $out \ + --replace-fail "%DEVSHELLS_REPO%" "${devshells}" \ + --replace-fail "%DEVSHELLS_REPO_REF%" "${devshells.sourceInfo.rev}.${builtins.readFile "${nixpkgs}/.git-revision"}" + ''; in { options.soispha.programs.direnv = { enable = lib.mkEnableOption "direnv"; }; - config.home-manager.users.soispha.programs.direnv = lib.mkIf cfg.enable { - enable = true; - - nix-direnv = { + config.home-manager.users.soispha = lib.mkIf cfg.enable { + programs.direnv = { enable = true; - package = pkgs.nix-direnv.override {nix = config.nix.package;}; - }; - config = { - warn_timeout = 0; - # strict_env = true; - # disable_stdin = true; + package = pkgs.direnv-patched; + + nix-direnv = { + enable = true; + package = pkgs.nix-direnv.override {nix = config.nix.package;}; + }; + + config = { + warn_timeout = 0; + + # NOTE: Something variable is undeclared in the my default loaded stuff :/. <2026-08-18> + # strict_env = true; + + # disable_stdin = true; + }; + }; + xdg.configFile = { + "direnv/lib/hm-pre-cache.sh" = { + source = pre-cache; + }; }; }; } diff --git a/modules/by-name/di/direnv/pre-cache.sh b/modules/by-name/di/direnv/pre-cache.sh new file mode 100755 index 00000000..d2174f98 --- /dev/null +++ b/modules/by-name/di/direnv/pre-cache.sh @@ -0,0 +1,86 @@ +#! /usr/bin/env sh + +_pre_cache_log() { + printf "pre-cache: %s\n" "$1" +} +_pre_cache_preflight() { + set -eu + _nix_direnv_preflight + + REPO="%DEVSHELLS_REPO%" + system="x86_64-linux" + cache_dir="$XDG_CACHE_HOME/pre_cache" + [ -d "$cache_dir" ] || mkdir --parents "$cache_dir" + + repo_ref="%DEVSHELLS_REPO_REF%" + final_cache="$cache_dir/$repo_ref" + + if ! [ -d "$final_cache" ]; then + _pre_cache_log "Cache dir invalidated" + + # There is not yet a final cache directory, so the ref must have changed. + # Therefore we delete the whole cache directory, so we invalidate old cached shells. + set -u + rm --recursive "$cache_dir" + + mkdir --parents "$final_cache" + fi +} + +_pre_cache_load_shell() { + lang="$1" + lang_cache="$final_cache/$lang" + + if ! [ -f "$lang_cache" ]; then + tmp_profile="$final_cache/__tmp_profile" + profile="$final_cache/__profile" + + # It does not already exists, we need to evaluate it. + _nix print-dev-env --profile "$tmp_profile" "$REPO#$lang" >"$lang_cache" + + _nix_add_gcroot "$tmp_profile" "$profile" + # rm "$tmp_profile" "$tmp_profile"* || true + fi + + _pre_cache_log "Loaded dev-shell for $lang." + _nix_import_env "$lang_cache" +} + +_pre_cache_build_shells() { + installables="" + + for lang in "$@"; do + lang_cache="$final_cache/$lang" + + if ! [ -f "$lang_cache" ]; then + new_part="$REPO#devShells.$system.$lang" + + if [ -z "$installables" ]; then + installables="$new_part" + else + installables="$installables $new_part" + fi + fi + done + + if [ -n "$installables" ]; then + _pre_cache_log "Building '$installables'..." + + # We want shell-spliting + # shellcheck disable=SC2086 + _nix build --no-link $installables + fi +} + +pre_cache_load() { + _pre_cache_preflight + + # Build all not-yet build shells concurrently. That speeds up the initial load. + _pre_cache_build_shells "$@" + + for lan in "$@"; do + _pre_cache_load_shell "$lan" + done +} + +# vim: ft=sh diff --git a/modules/by-name/fo/foot/module.nix b/modules/by-name/fo/foot/module.nix index 370c4d5a..8d5cfe2b 100644 --- a/modules/by-name/fo/foot/module.nix +++ b/modules/by-name/fo/foot/module.nix @@ -27,6 +27,15 @@ in { ]; home-manager.users.soispha = { + systemd.user.services.foot = { + # Don't restart the foot server (otherwise all my open foot terminals would exit + # too) + Unit.X-SwitchMethod = "keep-old"; + + # TODO: This should probably be added <2026-07-02> + # OOMScoreAdjust=-100; + }; + programs.foot = { enable = true; server.enable = true; @@ -45,6 +54,10 @@ in { launch = "ll \${match}"; }; + colors-dark = { + jump-labels = "f2f4f8 484848"; + }; + key-bindings = { regex-launch = [ "[hashes] Control+h" diff --git a/modules/by-name/gi/git/git_ignore.git b/modules/by-name/gi/git/git_ignore.git index 8f29815e..9a92db69 100644 --- a/modules/by-name/gi/git/git_ignore.git +++ b/modules/by-name/gi/git/git_ignore.git @@ -1,4 +1,7 @@ # default nvim Session file name Session.vim +# The .direnv file for pre-cache devshells +.nenvrc + # vim: ft=gitignore diff --git a/modules/by-name/gp/gpg/module.nix b/modules/by-name/gp/gpg/module.nix index d5136e92..769bcab6 100644 --- a/modules/by-name/gp/gpg/module.nix +++ b/modules/by-name/gp/gpg/module.nix @@ -22,7 +22,35 @@ in { }; config = lib.mkIf cfg.enable { - soispha.programs.qutebrowser.key = "8321 ED3A 8DB9 99A5 1F3B F80F F268 2914 EA42 DE26"; + soispha = { + programs = { + qutebrowser.key = "8321 ED3A 8DB9 99A5 1F3B F80F F268 2914 EA42 DE26"; + + zsh.integrations.gpg = '' + export GPG_TTY=$(tty) + + # Magic copied from the gpg-agent manual + unset SSH_AGENT_PID + if [ "''${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then + export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" + fi + + + # Ensure that get gpg agent is started (necessary because ssh does not start it + # automatically and has it's tty updated) + gpg-connect-agent /bye + ''; + }; + + services.unison.pathsToIgnore = [ + # "Unknown filetype" (and there is no real reason to (try to) synchronize sockets) + "~/.local/share/gnupg/S.gpg-agent" + "~/.local/share/gnupg/S.gpg-agent.browser" + "~/.local/share/gnupg/S.gpg-agent.extra" + "~/.local/share/gnupg/S.gpg-agent.ssh" + "~/.local/share/gnupg/S.scdaemon" + ]; + }; home-manager.users.soispha = { programs.gpg = { @@ -74,20 +102,5 @@ in { }; }; }; - - soispha.programs.zsh.integrations.gpg = '' - export GPG_TTY=$(tty) - - # Magic copied from the gpg-agent manual - unset SSH_AGENT_PID - if [ "''${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then - export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" - fi - - - # Ensure that get gpg agent is started (necessary because ssh does not start it - # automatically and has it's tty updated) - gpg-connect-agent /bye - ''; }; } diff --git a/modules/by-name/gt/gtk/module.nix b/modules/by-name/gt/gtk/module.nix new file mode 100644 index 00000000..44442077 --- /dev/null +++ b/modules/by-name/gt/gtk/module.nix @@ -0,0 +1,82 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + config, + pkgs, + lib, + packageSets, + libraries, + ... +}: let + cfg = config.soispha.gtk; + + homeConfig = config.home-manager.users.soispha; +in { + options.soispha.gtk = { + enable = libraries.base.options.mkEnable "gtk themes"; + }; + + config.home-manager.users.soispha = lib.mkIf cfg.enable { + gtk = { + enable = true; + theme = { + # NOTE: The `nordic` package pulls the whole plasma shell, to copy some stuff from a plasma theme :/ <2026-05-29> + # NOTE: Unstable removed the nordic theme, as it also supported gtk2, which is + # insecure. So we use stable until unstable adds it again. <2026-08-13> + package = packageSets.stable.nordic; + name = "Nordic"; + }; + cursorTheme = { + package = pkgs.nordzy-cursor-theme; + name = "Nordzy-cursors"; + }; + iconTheme = { + package = pkgs.nordzy-icon-theme; + name = "Nordzy-icon"; + }; + font = { + name = "Noto Sans"; + size = 10; + }; + gtk2 = { + configLocation = "${homeConfig.xdg.configHome}/gtk-2.0/gtkrc"; + # extraConfig = '' + # gtk-enable-animations=1 + # gtk-primary-button-warps-slider=0 + # gtk-toolbar-style=3 + # gtk-menu-images=1 + # gtk-button-images=1 + # + # ''; + }; + gtk3 = { + # extraConfig = '' + # gtk-button-images=true + # gtk-decoration-layout=icon:minimize,maximize,close + # gtk-enable-animations=true + # gtk-menu-images=true + # gtk-primary-button-warps-slider=false + # gtk-toolbar-style=3 + # #gtk-modules=window-decorations-gtk-module:colorreload-gtk-module + # ''; + extraCss = ""; + }; + gtk4 = { + theme = homeConfig.gtk.theme; + # extraConfig = '' + # gtk-application-prefer-dark-theme=true + # gtk-decoration-layout=icon:minimize,maximize,close + # gtk-enable-animations=true + # gtk-primary-button-warps-slider=false + # ''; + }; + }; + }; +} diff --git a/modules/by-name/i3/i3bar-river/module.nix b/modules/by-name/i3/i3bar-river/module.nix index 982ec1e3..55ac59e9 100644 --- a/modules/by-name/i3/i3bar-river/module.nix +++ b/modules/by-name/i3/i3bar-river/module.nix @@ -186,7 +186,7 @@ in { }; # The font and various sizes - font = "SauceCodePro Nerd Font Mono:pixelsize=26"; + font = "SauceCodePro NFM:pixelsize=26"; height = 24; margin_top = 10; margin_bottom = 0; diff --git a/modules/by-name/lf/lf/commands/default.nix b/modules/by-name/lf/lf/commands/default.nix index 42dc548e..98b3119f 100644 --- a/modules/by-name/lf/lf/commands/default.nix +++ b/modules/by-name/lf/lf/commands/default.nix @@ -169,9 +169,6 @@ in { dependencies = [ pkgs.conceal pkgs.fzf - pkgs.gawk - pkgs.trashy - pkgs.gnused ]; }; diff --git a/modules/by-name/lf/lf/commands/scripts/trash_restore.sh b/modules/by-name/lf/lf/commands/scripts/trash_restore.sh index 7b078c26..789ab59a 100755 --- a/modules/by-name/lf/lf/commands/scripts/trash_restore.sh +++ b/modules/by-name/lf/lf/commands/scripts/trash_restore.sh @@ -19,9 +19,5 @@ fs="$fs" # shellcheck disable=SC2269 id="$id" -while IFS="$(printf '\n')" read -r file; do - set -- "$@" "$(pwd)/$file" -done <"$(conceal list | fzf --multi --ansi | awk '{$1="";$2=""; print $0}' | sed 's/^\s*//' | tmp)" - -[ "$#" -ne 0 ] && trash restore --match=exact "$@" +conceal restore --finder=fzf # vim: ft=sh diff --git a/modules/by-name/lf/lf/keybindings/default.nix b/modules/by-name/lf/lf/keybindings/default.nix index d7f8eb95..bd4b2a2c 100644 --- a/modules/by-name/lf/lf/keybindings/default.nix +++ b/modules/by-name/lf/lf/keybindings/default.nix @@ -11,69 +11,99 @@ uid, downloadDir, }: { - # Remove some defaults - "'\"'" = null; - ";" = null; - "\"'\"" = null; + # v o visual-change + # v <esc> visual-discard + # v o visual-change + # v V visual-accept + + "\\!" = "shell-wait"; + "\\$" = "shell"; + "\\%" = "shell-pipe"; + "\\&" = "shell-async"; + "\\:" = "read"; + + "<f-1>" = "help"; + + "<left>" = "updir"; + "<right>" = "open"; + "<down>" = "down"; + "<up>" = "up"; + + "<c-f>" = "page-down"; + "<pgdn>" = "page-down"; + "<pgup>" = "page-up"; + "<c-b>" = "page-up"; + + "[" = "jump-prev"; + "]" = "jump-next"; + q = "quit"; # Sorting - # k = null; k = { - n = ":set sortby natural; set info"; - s = ":set sortby size; set info size"; - t = ":set sortby time; set info time"; - a = ":set sortby atime; set info atime"; - c = ":set sortby ctime; set info ctime"; - e = ":set sortby ext; set info"; + a = ":{{ set sortby atime; set info atime; }}"; + b = ":{{ set sortby btime; set info btime; }}"; + c = ":{{ set sortby ctime; set info ctime; }}"; + e = ":{{ set sortby ext; set info; }}"; + n = ":{{ set sortby natural; set info; }}"; + s = ":{{ set sortby size; set info size; }}"; + t = ":{{ set sortby time; set info time; }}"; + }; + z = { + a = "set info size:time"; + h = "set hidden!"; + n = "set info"; + r = "set reverse!"; + s = "set info size"; + t = "set info time"; }; # Searching l = "search-next"; L = "search-prev"; + "/" = "search"; + "?" = "search-back"; + F = "find-back"; + "," = "find-prev"; + # File edit - # e = null; e = { - e = "\$\$EDITOR \"$f\""; - s = "\$ nvim -S \"$f\""; + e = "\${{ $EDITOR \"$f\" }}"; + s = "\${{ nvim -S \"$f\" }}"; }; u = "view_file"; - # f = null; f = { e = "execute"; l = "follow_link"; }; - # c = null; c = { + h = "chmod"; p = "set_clipboard_path"; s = "stripspace"; - h = "chmod"; }; # Archive Mappings a = { - u = "archive_decompress"; a = "archive_compress"; + u = "archive_decompress"; }; D = { D = "delete"; }; - # d = null; d = { # Trash Mappings d = "trash"; # Dragon Mapping + i = "dragon_individual"; r = "dragon"; s = "dragon_stay"; - i = "dragon_individual"; }; - # j = null; j = { c = "trash_clear"; r = "trash_restore"; @@ -86,17 +116,22 @@ s = "open"; # Basic Functions - "." = "set hidden!"; p = "paste"; x = "cut"; y = "copy"; "<enter>" = "open"; - # m = null; + # Selecting + v = "invert"; + V = "visual"; + "<space>" = ":{{ toggle; down; }}"; + C = "clear"; + U = "unselect"; + m = { - k = "mk_link"; - f = "mk_file"; d = "mk_directory"; + f = "mk_file"; + l = "mk_link"; s = "mk_script"; }; @@ -104,18 +139,24 @@ g = "set_wallpaper"; }; - r = ":rename; cmd-end"; + r = ":{{ rename; cmd-end; }}"; + "<c-r>" = "reload"; R = "reload"; - C = "clear"; - U = "unselect"; + "<c-l>" = "redraw"; + + # Change cursor position + G = "bottom"; + H = "high"; + M = "middle"; # (walking) Movement w = { - u = "cd /run/user/${builtins.toString uid}"; - e = "cd /etc"; d = "cd ${downloadDir}"; - t = "cd /tmp"; + e = "cd /etc"; + H = "cd ~"; h = "cd_project_root"; + t = "cd /tmp"; + u = "cd /run/user/${builtins.toString uid}"; }; g = "cd_lf_make_map"; diff --git a/modules/by-name/lf/lf/module.nix b/modules/by-name/lf/lf/module.nix index 0a0e193f..4205771e 100644 --- a/modules/by-name/lf/lf/module.nix +++ b/modules/by-name/lf/lf/module.nix @@ -14,11 +14,24 @@ shell_library, system, lib, + libraries, ... }: let - commands = import ./commands {inherit pkgs sysLib shell_library system;}; + real_commands = import ./commands {inherit pkgs sysLib shell_library system;}; keybindings_raw = import ./keybindings {inherit (cfg.keymaps) uid downloadDir;}; + # NOTE: There is no (easy) way for me to make sure, that the `clearmaps` command is + # generated in the lf config before the keymapping commands. + # This command injection works around that. <2026-07-21> + commands = libraries.extra.warnMerge real_commands { + __clearmaps_injection = '' + :{{ + clearmaps + }}; + clearmaps + ''; + } "lf command map"; + process = prefix: attrs: lib.mapAttrsToList (name: value: if (builtins.isAttrs value) diff --git a/modules/by-name/lu/lutris/module.nix b/modules/by-name/lu/lutris/module.nix index 728322e1..eabc11fb 100644 --- a/modules/by-name/lu/lutris/module.nix +++ b/modules/by-name/lu/lutris/module.nix @@ -11,6 +11,7 @@ lib, config, libraries, + pkgs, ... }: let cfg = config.soispha.programs.lutris; @@ -20,12 +21,34 @@ in { }; config = lib.mkIf cfg.enable { + soispha.impermanence.userDirectories = [ + ".config/lutris" + ]; + soispha.services.unison.pathsToSync = [ + "~/.config/lutris" + ]; + + # TODO: This should also have something, to avoid giving the games network access: 'https://github.com/lutris/docs/blob/master/DisableNetworkAccess.md' <2026-07-10> home-manager.users.soispha = { programs.lutris = { enable = true; - steamPackage = - lib.mkIf config.programs.steam.enable - config.programs.steam.package; + extraPackages = [ + # Show fps and such in game + pkgs.mangohud + + pkgs.winetricks + + # Runs game in it's own compositor (avoids issues with all the resolution stuff) + pkgs.gamescope + + pkgs.gamemode + pkgs.umu-launcher + ]; + steamPackage = lib.mkIf config.programs.steam.enable config.programs.steam.package; + defaultWinePackage = pkgs.proton-ge-bin; + protonPackages = [pkgs.proton-ge-bin]; + + # winePackages = [pkgs.wineWow64Packages.full]; }; }; }; diff --git a/modules/by-name/mp/mpv/module.nix b/modules/by-name/mp/mpv/module.nix index 0610dcd8..496dcd47 100644 --- a/modules/by-name/mp/mpv/module.nix +++ b/modules/by-name/mp/mpv/module.nix @@ -19,38 +19,44 @@ in { enable = lib.mkEnableOption "mpv"; }; - config.home-manager.users.soispha = lib.mkIf cfg.enable { - programs.mpv = { - enable = true; + config = lib.mkIf cfg.enable { + soispha.services.unison.pathsToSync = [ + "~/.local/state/mpv" + ]; - package = pkgs.mpv.override { - mpv-unwrapped = pkgs.mpv-unwrapped.override { - ffmpeg = pkgs.ffmpeg-headless; + home-manager.users.soispha = { + programs.mpv = { + enable = true; + + package = pkgs.mpv.override { + mpv-unwrapped = pkgs.mpv-unwrapped.override { + ffmpeg = pkgs.ffmpeg-headless; + }; }; - }; - bindings = { - q = "quit 0"; - "Ctrl+c" = "quit 1"; - "Shift+q" = "quit-watch-later 1"; - }; + bindings = { + q = "quit 0"; + "Ctrl+c" = "quit 1"; + "Shift+q" = "quit-watch-later 1"; + }; - config = { - osd-bar = true; + config = { + osd-bar = true; - border = false; - }; - scriptOpts = { - osc = { - scalewindowed = 0.8; - hidetimeout = 300; + border = false; }; - thumbfast = { - hwdec = true; - network = false; - spawn_first = false; - max_height = 250; - max_width = 250; + scriptOpts = { + osc = { + scalewindowed = 0.8; + hidetimeout = 300; + }; + thumbfast = { + hwdec = true; + network = false; + spawn_first = false; + max_height = 250; + max_width = 250; + }; }; }; }; diff --git a/modules/by-name/ni/nix/module.nix b/modules/by-name/ni/nix/module.nix index 65b6ed5c..b7e64989 100644 --- a/modules/by-name/ni/nix/module.nix +++ b/modules/by-name/ni/nix/module.nix @@ -19,7 +19,7 @@ externalDependencies, ... }: let - nixpkgs = sources.loadFlake "nixpkgs"; + inherit (sources) nixpkgs; cfg = config.soispha.nix; in { @@ -59,6 +59,9 @@ in { }; settings = { + # Don't warn about dirty git trees (It is usually absolutely useless) + warn-dirty = false; + auto-optimise-store = true; experimental-features = [ "nix-command" diff --git a/modules/by-name/ni/nixos-shell/module.nix b/modules/by-name/ni/nixos-shell/module.nix index 3556a98b..1a0190c8 100644 --- a/modules/by-name/ni/nixos-shell/module.nix +++ b/modules/by-name/ni/nixos-shell/module.nix @@ -15,7 +15,7 @@ ... }: let cfg = config.soispha.nixos-shell; - nixpkgs = sources.loadFlake "nixpkgs"; + inherit (sources) nixpkgs; in { options.soispha.nixos-shell = { enable = lib.mkEnableOption "nixos-shell"; diff --git a/modules/by-name/nv/nvim/module.nix b/modules/by-name/nv/nvim/module.nix index 81d7febf..860610bd 100644 --- a/modules/by-name/nv/nvim/module.nix +++ b/modules/by-name/nv/nvim/module.nix @@ -42,6 +42,10 @@ in { }; config = lib.mkIf cfg.enable { + soispha.services.unison.pathsToSync = [ + "~/.local/state/nvim" + ]; + home-manager.users.soispha = { imports = [ modules.nixvim.homeModules.nixvim diff --git a/modules/by-name/qu/qutebrowser/module.nix b/modules/by-name/qu/qutebrowser/module.nix index 51c1b239..d7689793 100644 --- a/modules/by-name/qu/qutebrowser/module.nix +++ b/modules/by-name/qu/qutebrowser/module.nix @@ -80,7 +80,7 @@ in { config = lib.mkIf cfg.enable { home-manager.users.soispha = { disabledModules = [ - "${sources.sources.home-manager}/modules/programs/qutebrowser.nix" + "${sources.home-manager}/modules/programs/qutebrowser.nix" ]; imports = [ ./module.hm.nix diff --git a/modules/by-name/ri/river/keymap.nix b/modules/by-name/ri/river/keymap.nix index 1d4b8c3e..897d11df 100644 --- a/modules/by-name/ri/river/keymap.nix +++ b/modules/by-name/ri/river/keymap.nix @@ -69,7 +69,7 @@ in { "x" = { "q" = ["exit"]; "l" = mkSpawn pkgs.lock "" {once = true;}; - "h" = mkSpawn' pkgs.procps "pkill" "--signal USR1 i3bar-river" {once = true;}; + "h" = mkSpawn pkgs.systemd-toggle "--user i3bar-river.service" {once = true;}; }; # Media control diff --git a/modules/by-name/ri/river/module.nix b/modules/by-name/ri/river/module.nix index 7eb30014..f9ecea0f 100644 --- a/modules/by-name/ri/river/module.nix +++ b/modules/by-name/ri/river/module.nix @@ -229,7 +229,7 @@ in { home.packages = [ river-start - pkgs.swallow + pkgs.sw ]; xdg.configFile."river/init" = { diff --git a/modules/by-name/ss/ssh/module.nix b/modules/by-name/ss/ssh/module.nix index 87c50728..39c203fd 100644 --- a/modules/by-name/ss/ssh/module.nix +++ b/modules/by-name/ss/ssh/module.nix @@ -55,6 +55,13 @@ in { text = cfg.rootKnownHosts; }) ); + "Host *.your-storagebox.de" = { + # Don't try to authenticate via password for these, because we need to use the + # forced commands, and they are only provided via the ssh key login. + # So password login is a footgun (it is, however, valid to use it for non-root + # use-cases) + PasswordAuthentication = false; + }; }; }; @@ -64,6 +71,11 @@ in { settings = { "Host *" = mkDefaultMatchBlock "${config.home-manager.users.soispha.xdg.dataHome}/ssh/known_hosts"; + "Host *.your-storagebox.de" = { + # Port 22 is for sftp, and when we connect as user, we probably want an + # interactive shell. + Port = 23; + }; }; }; }; diff --git a/modules/by-name/st/steam/module.nix b/modules/by-name/st/steam/module.nix index aaa36fd3..f44aa0dd 100644 --- a/modules/by-name/st/steam/module.nix +++ b/modules/by-name/st/steam/module.nix @@ -26,6 +26,11 @@ in { "steam-run" ]; + soispha.services.unison.pathsToIgnore = [ + # That is just to big to be synchronized (# TODO: Work around that <2024-08-31> ) + "~/.local/share/Steam" + ]; + programs.steam = { enable = true; }; diff --git a/modules/by-name/ta/taskwarrior/module.nix b/modules/by-name/ta/taskwarrior/module.nix index d757be90..d499c08e 100644 --- a/modules/by-name/ta/taskwarrior/module.nix +++ b/modules/by-name/ta/taskwarrior/module.nix @@ -110,6 +110,11 @@ in { inherit mkHook; }; + soispha.services.unison.pathsToIgnore = [ + # Already synchronized by TaskChampion sync server + "~/.local/share/task" + ]; + age.secrets.taskwarrior_sync_server_encryption_key = lib.mkIf (cfg.enable && cfg.enableAge) { file = ./secrets/sync_server_encryption_key.age; mode = "700"; diff --git a/modules/by-name/un/unison/module.nix b/modules/by-name/un/unison/module.nix index 8d156b00..8e943304 100644 --- a/modules/by-name/un/unison/module.nix +++ b/modules/by-name/un/unison/module.nix @@ -84,6 +84,17 @@ in { }; config = lib.mkIf cfg.enable { + soispha.services.unison.pathsToIgnore = let + prefix = "/home/soispha/"; + dataDir = + if lib.strings.hasPrefix prefix cfg.dataDir + then "~/${lib.strings.removePrefix prefix cfg.dataDir}" + else builtins.throw "Wrong prefix in unison"; + in [ + # Should not be synchronized + dataDir + ]; + home-manager.users.soispha = { home.sessionVariables = { UNISON = cfg.dataDir; diff --git a/modules/by-name/ve/version/module.nix b/modules/by-name/ve/version/module.nix index fc03b107..d666695d 100644 --- a/modules/by-name/ve/version/module.nix +++ b/modules/by-name/ve/version/module.nix @@ -10,19 +10,19 @@ { config, lib, - self, + sources, ... }: let cfg = config.soispha.version; + + inherit (sources) nixpkgs; in { options.soispha.version = { - enable = lib.mkEnableOption "storing the git revision in /etc/nixos_git_rev"; + enable = lib.mkEnableOption "storing the git revision in /etc/nixpkgs-git-revision"; }; config = lib.mkIf cfg.enable { - environment.etc.nixos_git_rev = { - text = builtins.toString (self.longRev - or self.lastModified - or "unknown"); + environment.etc.nixpkgs-git-revision = { + source = "${nixpkgs}/.git-revision"; }; }; } diff --git a/modules/common/default.nix b/modules/common/default.nix index e5172921..f2a6b04d 100644 --- a/modules/common/default.nix +++ b/modules/common/default.nix @@ -97,33 +97,14 @@ config.home-manager.users.soispha.home.file); in [ - # TODO(@bpeetz): Move these to their respective modules <2025-05-09> - # Already synchronized by TaskChampion sync server - "~/.local/share/task" - # Already synchronized by atuin sync server - "~/.local/share/atuin" + # TODO(@bpeetz): Move that to its respective module (after migrating it to + # by-name) <2025-05-09> # Already synchronized by mbsync "~/.local/share/maildir" - - - # "Unknown filetype" (and there is no real reason to (try to) synchronize sockets) - "~/.local/share/gnupg/S.gpg-agent" - "~/.local/share/gnupg/S.gpg-agent.browser" - "~/.local/share/gnupg/S.gpg-agent.extra" - "~/.local/share/gnupg/S.gpg-agent.ssh" - "~/.local/share/gnupg/S.scdaemon" - - # Should not be synchronized - "~/.local/share/unison" - - # These are just to big to be synchronized (# TODO: Work around that <2024-08-31> ) - "~/.local/share/Steam" ] ++ homeManagerSymlinks; pathsToSync = [ - "~/.local/state/mpv" - "~/.local/state/nvim" "~/.local/share" "~/.local/.Trash-1000" diff --git a/modules/common/projects.json b/modules/common/projects.json index e8e9bc39..7f434976 100644 --- a/modules/common/projects.json +++ b/modules/common/projects.json @@ -22,6 +22,7 @@ "google": {}, "health": {}, "job": {}, + "shop": {}, "sweden": {} } }, diff --git a/modules/home.legacy/conf/default.nix b/modules/home.legacy/conf/default.nix index b50068ea..9af67102 100644 --- a/modules/home.legacy/conf/default.nix +++ b/modules/home.legacy/conf/default.nix @@ -13,7 +13,6 @@ ./btop ./dconf ./gammastep - ./gtk ./himalaya ./keepassxc ./mail diff --git a/modules/home.legacy/conf/gtk/default.nix b/modules/home.legacy/conf/gtk/default.nix deleted file mode 100644 index e624765b..00000000 --- a/modules/home.legacy/conf/gtk/default.nix +++ /dev/null @@ -1,67 +0,0 @@ -# nixos-config - My current NixOS configuration -# -# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> -# SPDX-License-Identifier: GPL-3.0-or-later -# -# This file is part of my nixos-config. -# -# You should have received a copy of the License along with this program. -# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. -{ - config, - pkgs, - ... -}: { - gtk = { - enable = true; - theme = { - # NOTE: The `nordic` package pulls the whole plasma shell, to copy some stuff from a plasma theme :/ <2026-05-29> - package = pkgs.nordic; - name = "Nordic"; - }; - cursorTheme = { - package = pkgs.nordzy-cursor-theme; - name = "Nordzy-cursors"; - }; - iconTheme = { - package = pkgs.nordzy-icon-theme; - name = "Nordzy-icon"; - }; - font = { - name = "Noto Sans"; - size = 10; - }; - gtk2 = { - configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; - # extraConfig = '' - # gtk-enable-animations=1 - # gtk-primary-button-warps-slider=0 - # gtk-toolbar-style=3 - # gtk-menu-images=1 - # gtk-button-images=1 - # - # ''; - }; - gtk3 = { - # extraConfig = '' - # gtk-button-images=true - # gtk-decoration-layout=icon:minimize,maximize,close - # gtk-enable-animations=true - # gtk-menu-images=true - # gtk-primary-button-warps-slider=false - # gtk-toolbar-style=3 - # #gtk-modules=window-decorations-gtk-module:colorreload-gtk-module - # ''; - extraCss = ""; - }; - gtk4 = { - theme = config.gtk.theme; - # extraConfig = '' - # gtk-application-prefer-dark-theme=true - # gtk-decoration-layout=icon:minimize,maximize,close - # gtk-enable-animations=true - # gtk-primary-button-warps-slider=false - # ''; - }; - }; -} diff --git a/modules/home.legacy/pkgs/default.nix b/modules/home.legacy/pkgs/default.nix index ddc633c1..840ffb19 100644 --- a/modules/home.legacy/pkgs/default.nix +++ b/modules/home.legacy/pkgs/default.nix @@ -23,7 +23,6 @@ with pkgs; let TuiCli = { Misc = [ - killall # kill a application by name bc # Smart calculator aumo # Automatic mount jq # Json parser @@ -81,12 +80,6 @@ with pkgs; let ripgrep # A search tool that combines the usability of ag with the raw speed of grep file # Show information about a file ]; - - Programming = { - GeneralTools = [ - glow # Command-line markdown renderer - ]; - }; }; mapFun = x: if builtins.isAttrs x |
