diff options
Diffstat (limited to '')
39 files changed, 737 insertions, 213 deletions
diff --git a/modules/by-name/at/atuin/module.nix b/modules/by-name/at/atuin/module.nix index e55e358e..cfa10f71 100644 --- a/modules/by-name/at/atuin/module.nix +++ b/modules/by-name/at/atuin/module.nix @@ -30,7 +30,7 @@ in { owner = "soispha"; group = "users"; }; - user_id = lib.mkIf cfg.enableAge { + atuin_user_id = lib.mkIf cfg.enableAge { file = ./secrets/user_id.age; mode = "700"; owner = "soispha"; @@ -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/at/atuin/secrets/user_id.age b/modules/by-name/at/atuin/secrets/user_id.age index 8bfc370d..6ac3bcd6 100644 --- a/modules/by-name/at/atuin/secrets/user_id.age +++ b/modules/by-name/at/atuin/secrets/user_id.age @@ -1,13 +1,14 @@ -----BEGIN AGE ENCRYPTED FILE----- -YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB4cmN5R1haeElTZnhmNHha -MERLd2M0V2k1UFU2NlMzU0NWNlVVNEM5c1VBCnZqUktBUFF4eEsvUUwrQkJmclhz -WTJuMktGV09XK0x3WkQ4b0dwd0FGOXcKLT4gc3NoLWVkMjU1MTkgelpFb25nIDhE -dlQyMXJRVmI1MnRBMjAydEJHdE1TNGxlWTRoSGlYUS9Pb1Mrd1BOM2cKaE8vdHM2 -aUZKclVzcHdMaCtiWnVkMWhGZm1ubG5DRGZ4VG41V0VCL1ZyVQotPiBzc2gtZWQy -NTUxOSA3SGZGVXcgMlFIUDBhL2tkcndlT0JyelVzeEJMV0orcHp3WGN1dFU5aytj -NUMwaFMwRQpjYkJpZmQrL1JxOUxPcXE3TEdyYko2YmI2UkdibWpIaUk0TEV2ZzAz -NlJFCi0+IFBRaHdiLWdyZWFzZSAuZ08tXCBURjBMQS4KTVFGcUJpaFdrMDdCU0Vm -R0F0UWR4cU96WWNCSzR3Ci0tLSBkeWRKdk1tQ2t4WnR6aVczejNhRnhISEE0YkZq -U2VEd2I3SjQvbHN0WS9RChDEY9Z7GS4vCEtNetRMX1eLrOY9G+D4SGYcEOXqgrKq -V1q/nnUtKj8qw3X0bfesuBKfz4DsO7t9IjfCn/nFIU4ifFtR +YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB0T3hFUm1NZU1RU2IxNWsx +ZFh2ckVsTnNBZVVqMm9HaGFOTmtKMlh3M2xzClJ1N0RsbFJYYWhnYktpYnFaYWNY +c2VGRzZoMW1GOENsV3FoTEJ1OWVDQ00KLT4gc3NoLWVkMjU1MTkgelpFb25nIDlY +MnRoMFB4dTUyS0pIenVjelRxRERXZ2ptVURZWGttZWR5R25NMWYzekUKaVRDKzJj +cCtRY0F6VVFGUlIyeGhLSThXMVFvNEl2Y0tMdHpSOEI4cjVtTQotPiBzc2gtZWQy +NTUxOSA3SGZGVXcgbjNpdGZZa1NxbEw3YkV4UmxTb0dtSlFPM1htK1QzWXBaRGdv +ZUdTYkoxSQpMcHZCMnNPR0QySkovQ0I1THVPK3Z5RlFCbGJ5Zk5teDBKbUFvY1p4 +T3lzCi0+IGtrVXxkQlItZ3JlYXNlIDBRO3cKWnk5M2MyTUExRDBYd25RdkxRQWla +bnpTU1J0T1NMbVZldGpCbVZOTFZuV29ZRll0UDJwdHo0YWoKLS0tIFI5RG9WSDZu +am9RYnFONE9wZ3pVaG1tVnBLNTZqK3d4NFhhT1F1bWlORzAKz44Fafb+Ck5aMxJF +5/pNNcYE3IRUqjKTWjmSO+fBFVPnlfIIc6gKFhO4Nm05QIxqzSW08PbBhVYFH65u +ivRjFHUg+Gp3 -----END AGE ENCRYPTED FILE----- 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..04540676 100644 --- a/modules/by-name/bo/boot/module.nix +++ b/modules/by-name/bo/boot/module.nix @@ -38,41 +38,41 @@ ## 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" + "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" ] ## 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 +207,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/ca/cargo/module.nix b/modules/by-name/ca/cargo/module.nix index d36a11e5..6a0675d3 100644 --- a/modules/by-name/ca/cargo/module.nix +++ b/modules/by-name/ca/cargo/module.nix @@ -27,8 +27,7 @@ in { cargoHome = "${config.home-manager.users.soispha.xdg.dataHome}/cargo"; settings = { - # {cargo-cache-home} means $CARGO_HOME - build.build-dir = "{cargo-cache-home}/shared-target/"; + build.build-dir = "${config.home-manager.users.soispha.xdg.cacheHome}/cargo/shared-target/"; }; }; }; diff --git a/modules/by-name/fo/foot/module.nix b/modules/by-name/fo/foot/module.nix index d818aac0..8d5cfe2b 100644 --- a/modules/by-name/fo/foot/module.nix +++ b/modules/by-name/fo/foot/module.nix @@ -11,6 +11,7 @@ config, lib, libraries, + pkgs, ... }: let cfg = config.soispha.foot; @@ -20,28 +21,43 @@ in { }; config = lib.mkIf cfg.enable { + # TODO: Maybe we can use the xdg-autostart mechanism for this? <2026-06-23> + soispha.programs.river.init.autoStart = [ + ["${lib.getExe' pkgs.foot "footclient"}"] + ]; + 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; settings = { main = { + include = "${./theme.ini}"; font = "SauceCodePro Nerd Font Mono:size=12"; - horizontal-letter-offset = -1; - vertical-letter-offset = -1; + letter-spacing = "-0.25"; }; - # environment = { - # COLORTERM = "truecolor"; - # }; "regex:hashes" = { regex = "([a-fA-F0-9]{7,128})"; launch = "git show \${match}"; }; "regex:paths" = { - regex = "([^ '\"`=:\\\\[\\\\(]*/)([^/: '\"`\\\\)\\\\]]*)"; + regex = "([^ '\"`=:\\\\[\\\\(]*/[^/: '\"`\\\\)\\\\]*)"; launch = "ll \${match}"; }; + colors-dark = { + jump-labels = "f2f4f8 484848"; + }; + key-bindings = { regex-launch = [ "[hashes] Control+h" @@ -54,29 +70,6 @@ in { }; }; }; - - systemd.user.services = let - footCfg = config.home-manager.users.soispha.programs.foot; - inherit (footCfg.server) systemdTarget; - in { - foot-initial-term = { - Unit = { - Description = "Fast, lightweight and minimalistic Wayland terminal emulator."; - Documentation = "man:foot(1)"; - PartOf = [systemdTarget]; - After = [systemdTarget]; - ConditionEnvironment = "WAYLAND_DISPLAY"; - }; - - Service = { - ExecStart = "${lib.getExe' footCfg.package "footclient"}"; - }; - - Install = { - WantedBy = [systemdTarget]; - }; - }; - }; }; }; } diff --git a/modules/by-name/fo/foot/theme.ini b/modules/by-name/fo/foot/theme.ini new file mode 100644 index 00000000..f5f36039 --- /dev/null +++ b/modules/by-name/fo/foot/theme.ini @@ -0,0 +1,40 @@ +# From https://github.com/mbadolato/iTerm2-Color-Schemes/blob/75bc70670c28b5dc97625af38deb3ae49f4363e6/foot/Carbonfox.ini +# Other themes I considered: +# - ayu-mirage +# - catppuccin-mocha +# - chiba-dark +# - iterm +# - kitty +# - modus-vivendi +# - modus-vivendi-tinted +# - molokai +# - tokyonight-storm +# - visibone +# - xterm +# - poimandres +# -*- conf -*- +# VisiBone + +[colors-dark] +cursor=161616 f2f4f8 +foreground=f2f4f8 +background=161616 +regular0=282828 +regular1=ee5396 +regular2=25be6a +regular3=08bdba +regular4=78a9ff +regular5=be95ff +regular6=33b1ff +regular7=dfdfe0 +bright0=484848 +bright1=f16da6 +bright2=46c880 +bright3=2dc7c4 +bright4=8cb6ff +bright5=c8a5ff +bright6=52bdff +bright7=e4e4e5 +selection-foreground=f2f4f8 +selection-background=2a2a2a + diff --git a/modules/by-name/gi/git/module.nix b/modules/by-name/gi/git/module.nix index 64a64904..28e61ecb 100644 --- a/modules/by-name/gi/git/module.nix +++ b/modules/by-name/gi/git/module.nix @@ -9,6 +9,7 @@ # If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. { lib, + pkgs, config, ... }: let @@ -43,6 +44,14 @@ in { }; }; + # Add my custom git-scripts + home.packages = [ + pkgs.git-edit-index # Allows you to edit the indexed version of a file + pkgs.git-cm # A wrapper that re-adds the last commit's subject + pkgs.git-cgit # Allows fast cgit settings setup + pkgs.stamp # Add a license header to a file + ]; + programs.git = { enable = true; 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/i3/i3bar-river/module.nix b/modules/by-name/i3/i3bar-river/module.nix index 8a2203aa..55ac59e9 100644 --- a/modules/by-name/i3/i3bar-river/module.nix +++ b/modules/by-name/i3/i3bar-river/module.nix @@ -110,7 +110,26 @@ in { }; config = lib.mkIf cfg.enable { - soispha.programs.river.init.backgroundStart = [cfg.package]; + systemd.user.services."i3bar-river" = { + description = "Highly customizable Wayland bar for river"; + partOf = ["graphical-session.target"]; + after = ["graphical-session.target"]; + requisite = ["graphical-session.target"]; + + path = [ + pkgs.bash # `sh` is needed for starting the status command + + # TODO: This should be a wrapper of the status command <2026-06-23> + pkgs.btrfs-progs # `btrfs` is needed by the storage block in the status command + ]; + + serviceConfig = { + ExecStart = "${lib.getExe cfg.package}"; + ExecReload = "kill -SIGUSR2 $MAINPID"; + Restart = "on-failure"; + }; + wantedBy = ["graphical-session.target"]; + }; home-manager.users.soispha = { programs.i3bar-river = { @@ -167,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 b6b7a548..bd4b2a2c 100644 --- a/modules/by-name/lf/lf/keybindings/default.nix +++ b/modules/by-name/lf/lf/keybindings/default.nix @@ -11,54 +11,103 @@ uid, downloadDir, }: { - # Remove some defaults - "'\"'" = null; - ";" = null; - "\"'\"" = null; - c = null; - d = null; - e = null; - j = null; - k = null; - m = null; - f = 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 - kn = ":set sortby natural; set info"; - ks = ":set sortby size; set info size"; - kt = ":set sortby time; set info time"; - ka = ":set sortby atime; set info atime"; - kc = ":set sortby ctime; set info ctime"; - ke = ":set sortby ext; set info"; + k = { + 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"; - # File Openers - ee = "\$\$EDITOR \"$f\""; - es = "\$ nvim -S \"$f\""; + "/" = "search"; + "?" = "search-back"; + F = "find-back"; + "," = "find-prev"; + + # File edit + e = { + e = "\${{ $EDITOR \"$f\" }}"; + s = "\${{ nvim -S \"$f\" }}"; + }; + u = "view_file"; - cc = "\$sudo -e \"$f\""; - fe = "execute"; - fl = "follow_link"; - cp = "set_clipboard_path"; + + f = { + e = "execute"; + l = "follow_link"; + }; + + c = { + h = "chmod"; + p = "set_clipboard_path"; + s = "stripspace"; + }; # Archive Mappings - au = "archive_decompress"; - aa = "archive_compress"; + a = { + a = "archive_compress"; + u = "archive_decompress"; + }; - # Trash Mappings - dd = "trash"; - jc = "trash_clear"; - jr = "trash_restore"; + D = { + D = "delete"; + }; + d = { + # Trash Mappings + d = "trash"; - # Dragon Mapping - dr = "dragon"; - ds = "dragon_stay"; - di = "dragon_individual"; + # Dragon Mapping + i = "dragon_individual"; + r = "dragon"; + s = "dragon_stay"; + }; - cs = "stripspace"; + j = { + c = "trash_clear"; + r = "trash_restore"; + }; # Vim keys h = "updir"; @@ -67,31 +116,48 @@ s = "open"; # Basic Functions - "." = "set hidden!"; - DD = "delete"; p = "paste"; x = "cut"; y = "copy"; "<enter>" = "open"; - mk = "mk_link"; - mf = "mk_file"; - md = "mk_directory"; - ms = "mk_script"; - - ch = "chmod"; - bg = "set_wallpaper"; - r = ":rename; cmd-end"; - R = "reload"; + # Selecting + v = "invert"; + V = "visual"; + "<space>" = ":{{ toggle; down; }}"; C = "clear"; U = "unselect"; - # Movement - nu = "cd /run/user/${builtins.toString uid}"; - ne = "cd /etc"; - nd = "cd ${downloadDir}"; - nt = "cd /tmp"; - nh = "cd_project_root"; + m = { + d = "mk_directory"; + f = "mk_file"; + l = "mk_link"; + s = "mk_script"; + }; + + b = { + g = "set_wallpaper"; + }; + + r = ":{{ rename; cmd-end; }}"; + "<c-r>" = "reload"; + R = "reload"; + "<c-l>" = "redraw"; + + # Change cursor position + G = "bottom"; + H = "high"; + M = "middle"; + + # (walking) Movement + w = { + d = "cd ${downloadDir}"; + 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 daa236e6..4205771e 100644 --- a/modules/by-name/lf/lf/module.nix +++ b/modules/by-name/lf/lf/module.nix @@ -14,10 +14,35 @@ shell_library, system, lib, + libraries, ... }: let - commands = import ./commands {inherit pkgs sysLib shell_library system;}; - keybindings = import ./keybindings {inherit (cfg.keymaps) uid downloadDir;}; + 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) + then + (process name value) + ++ [(lib.nameValuePair name null)] + else if prefix == null + then (lib.nameValuePair name value) + else (lib.nameValuePair (prefix + name) value)) + attrs; + keybindings = builtins.listToAttrs (lib.lists.flatten (process null keybindings_raw)); packages = import ./wrappers {inherit pkgs;}; diff --git a/modules/by-name/lu/lutris/module.nix b/modules/by-name/lu/lutris/module.nix new file mode 100644 index 00000000..eabc11fb --- /dev/null +++ b/modules/by-name/lu/lutris/module.nix @@ -0,0 +1,55 @@ +# 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>. +{ + lib, + config, + libraries, + pkgs, + ... +}: let + cfg = config.soispha.programs.lutris; +in { + options.soispha.programs.lutris = { + enable = libraries.base.options.mkEnable "Lutris"; + }; + + 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; + 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/ly/ly/module.nix b/modules/by-name/ly/ly/module.nix index dedabe81..e2d3b0ae 100644 --- a/modules/by-name/ly/ly/module.nix +++ b/modules/by-name/ly/ly/module.nix @@ -31,6 +31,7 @@ Terminal=true ''; + # TODO: This could use the `services.display-manager.sessionPackages` option <2026-06-23> customSessionsDir = pkgs.runCommand "custom-sessions" {} /* @@ -39,8 +40,22 @@ '' mkdir "$out"; cp "${riverDesktop}/share/applications/river.desktop" "$out" - cp "${shellDesktop}" "$out" + cp "${shellDesktop}" "$out/zsh.desktop" ''; + + setup = pkgs.writeShellApplication { + name = "setup"; + + bashOptions = []; + + runtimeInputs = [ + pkgs.findutils + pkgs.systemd + ]; + inheritPath = true; + + text = builtins.readFile ./setup.sh; + }; in { options.soispha.programs.ly = { enable = lib.mkEnableOption "ly"; @@ -84,6 +99,11 @@ in { dur_file_path = "${./blackhole-smooth-240x67.dur}"; full_color = true; + # NOTE: This does the same as the default nixos setup cmd, but we don't + # immidiately start the `graphical-session.target`. That is started by river's + # init. <2026-06-23> + setup_cmd = "${lib.getExe setup}"; + custom_sessions = "${customSessionsDir}"; # Clear the screen before starting up (otherwise error messages might linger on @@ -98,12 +118,12 @@ in { clock = "%c"; hibernate_cmd = "systemctl hibernate"; - inactivity_cmd = "systmectl suspend-then-hibernate"; + inactivity_cmd = "systemctl suspend-then-hibernate"; restart_cmd = "reboot"; shutdown_cmd = "shutdown $PLATFORM_SHUTDOWN_ARG now"; sleep_cmd = "systemctl suspend"; - inactivity_delay = 30; # unit is seconds + inactivity_delay = 120; # unit is seconds }; }; }; diff --git a/modules/by-name/ly/ly/setup.sh b/modules/by-name/ly/ly/setup.sh new file mode 100644 index 00000000..6e8bed2b --- /dev/null +++ b/modules/by-name/ly/ly/setup.sh @@ -0,0 +1,47 @@ +#! /usr/bin/env bash + +# Shared environment setup for graphical sessions. + +# shellcheck disable=1091 +. /etc/profile + +cd "$HOME" || { + echo 1>&2 "No HOME :(" + exit 1 +} + +if [ -z "$_DID_SYSTEMD_CAT" ]; then + export _DID_SYSTEMD_CAT=1 + exec systemd-cat -t xsession "$0" "$@" +fi + + +# Import environment variables into the systemd user environment. +/run/current-system/systemd/bin/systemctl --user import-environment DBUS_SESSION_BUS_ADDRESS DISPLAY XAUTHORITY XDG_SESSION_ID + +# Speed up application start by 50-150ms according to +# https://kdemonkey.blogspot.com/2008/04/magic-trick.html +compose_cache="${XCOMPOSECACHE:-$HOME/.compose-cache}" +mkdir -p "$compose_cache" +# To avoid accidentally deleting a wrongly set up XCOMPOSECACHE directory, +# defensively try to delete cache *files* only, following the file format specified in +# https://gitlab.freedesktop.org/xorg/lib/libx11/-/blob/master/modules/im/ximcp/imLcIm.c#L353-358 +# sprintf (*res, "%s/%c%d_%03x_%08x_%08x", dir, _XimGetMyEndian(), XIM_CACHE_VERSION, (unsigned int)sizeof (DefTree), hash, hash2); +find "$compose_cache" -maxdepth 1 -regextype posix-extended -regex '.*/[Bl][0-9]+_[0-9a-f]{3}_[0-9a-f]{8}_[0-9a-f]{8}' -delete +unset compose_cache + +# Work around KDE errors when a user first logs in and +# .local/share doesn't exist yet. +mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}" + +unset _DID_SYSTEMD_CAT + + +if test "$1"; then + # Run the supplied session command. + exec "$@" +else + # TODO: Do we need this? Should not the session always exist? + echo "error: unknown session $1" 1>&2 + exit 1 +fi 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..7caa8a8e 100644 --- a/modules/by-name/ni/nix/module.nix +++ b/modules/by-name/ni/nix/module.nix @@ -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/nixpkgs/module.nix b/modules/by-name/ni/nixpkgs/module.nix index 84d8e074..1ded8444 100644 --- a/modules/by-name/ni/nixpkgs/module.nix +++ b/modules/by-name/ni/nixpkgs/module.nix @@ -22,7 +22,13 @@ in { example = "x86_64-linux"; type = lib.types.str; }; + unfreePackageNames = lib.mkOption { + description = "Names of unfree packages to allow"; + example = "[ steam steam-unwrapped ]"; + type = lib.types.listOf lib.types.str; + }; }; + config = let myPkgsOverlay = self: super: packageSets.soispha; in @@ -39,11 +45,7 @@ in { hostSystem = cfg.systemName; allowUnfreePredicate = pkg: - builtins.elem (lib.getName pkg) [ - # the plugin is lacking an license and is thus unfree, effectively - # its okay though (TODO: investigate <2026-05-11>)? - "cmp-calc" - ]; + builtins.elem (lib.getName pkg) cfg.unfreePackageNames; }; }; }; 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/nv/nvim/plgs/nvim-cmp/default.nix b/modules/by-name/nv/nvim/plgs/nvim-cmp/default.nix index 315f3fc7..48883bd3 100644 --- a/modules/by-name/nv/nvim/plgs/nvim-cmp/default.nix +++ b/modules/by-name/nv/nvim/plgs/nvim-cmp/default.nix @@ -14,6 +14,12 @@ }: let cfg = config.soispha.programs.nvim; in { + soispha.nixpkgs.unfreePackageNames = [ + # the plugin is lacking an license and is thus unfree, effectively + # its okay though (TODO: investigate <2026-05-11>)? + "cmp-calc" + ]; + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { opts.completeopt = [ "menu" # Show completions in a menu diff --git a/modules/by-name/qu/qutebrowser/settings/default.nix b/modules/by-name/qu/qutebrowser/settings/default.nix index 282c5816..b0259c22 100644 --- a/modules/by-name/qu/qutebrowser/settings/default.nix +++ b/modules/by-name/qu/qutebrowser/settings/default.nix @@ -502,11 +502,11 @@ in { "@du" = duckduckgo; # NIX - "@np" = "https://search.nixos.org/packages?type=packages&query={}"; # Nix packages + "@np" = "https://search.nixos.org/packages?channel=unstable&type=packages&query={}"; # Nix packages "@ng" = "https://noogle.dev/q?term={}"; # Nix functions - "@no" = "https://search.nixos.org/options?type=options&query={}"; # NixOS options + "@no" = "https://search.nixos.org/options?channel=unstable&type=options&query={}"; # NixOS options "@nh" = "https://home-manager-options.extranix.com/?query={}&release=master"; # Home-Manager options "@ni" = "https://github.com/NixOS/nixpkgs/issues?q=is%3Aissue+is%3Aopen+{}"; # Nixpkgs issues diff --git a/modules/by-name/ri/river/keymap.nix b/modules/by-name/ri/river/keymap.nix index eacfd75b..897d11df 100644 --- a/modules/by-name/ri/river/keymap.nix +++ b/modules/by-name/ri/river/keymap.nix @@ -44,7 +44,7 @@ in { "<LEFT_SUPER>" = { # Spawn standard programs "r" = { - "a" = mkSpawn pkgs.alacritty "" {}; + "a" = mkSpawn' pkgs.foot "footclient" "" {}; "b" = mkSpawn pkgs.tskm "open select" {once = true;}; "k" = mkSpawn pkgs.keepassxc "" {once = true;}; # "s" = mkSpawn pkgs.signal-desktop "" {once = true;}; @@ -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 bafaf0a3..f9ecea0f 100644 --- a/modules/by-name/ri/river/module.nix +++ b/modules/by-name/ri/river/module.nix @@ -35,7 +35,9 @@ else builtins.map esa input ); in "err_fail ${program} &"; - longRunningPrograms = builtins.concatStringsSep "\n" (builtins.map mkLrProgram cfg.init.backgroundStart); + longRunningPrograms = + builtins.concatStringsSep "\n" (builtins.map mkLrProgram + cfg.init.autoStart); keymapFormat = pkgs.formats.json {}; keymapGenerate = name: value: @@ -163,12 +165,14 @@ in { ''; }; - backgroundStart = lib.mkOption { - type = lib.types.listOf (lib.types.either lib.types.package (lib.types.listOf lib.types.str)); - description = "List of programs to start in the background"; + autoStart = lib.mkOption { + type = + lib.types.listOf (lib.types.either lib.types.package (lib.types.listOf + lib.types.str)); + description = "List of programs to be started at river start"; example = '' [ - pkgs.gammastep + ''${lib.getExe pkgs.foot} ] ''; }; @@ -225,7 +229,7 @@ in { home.packages = [ river-start - pkgs.swallow + pkgs.sw ]; xdg.configFile."river/init" = { @@ -235,14 +239,49 @@ in { # ${text} ${other_stuff} ''; + + sessionVars = + (builtins.attrNames config.environment.sessionVariables) + ++ (builtins.attrNames config.home-manager.users.soispha.home.sessionVariables) + ++ [ + "WAYLAND_DISPLAY" + "DISPLAY" + "XDG_RUNTIME_DIR" + ]; + + part = acc: vars: let + firstTen = lib.lists.take 5 vars; + in + if firstTen == [] + then acc + else part (acc ++ [firstTen]) (lib.lists.removePrefix firstTen vars); + + partedSessionVars = part [] sessionVars; + + mkEnvSet = prefix: vars: let + stringVars = builtins.concatStringsSep " " vars; + in ''err_fail ${riverctl} spawn "${prefix} ${stringVars}"''; + + dbusEnvs = + builtins.map + (mkEnvSet "${lib.getExe' pkgs.dbus "dbus-update-activation-environment"} --verbose --systemd") + partedSessionVars; + systemdUserEnvs = + builtins.map + (mkEnvSet "systemctl --user --verbose import-environment") + partedSessionVars; in builtins.readFile ./init_base.sh + # bash mkHeading "Environment variables" '' - err_fail ${riverctl} spawn "${lib.getExe' pkgs.dbus "dbus-update-activation-environment"} --verbose --systemd SEATD_SOCK DISPLAY WAYLAND_DISPLAY DESKTOP_SESSION=river XDG_CURRENT_DESKTOP=river" export XDG_CURRENT_DESKTOP=river DESKTOP_SESSION=river; '' + + mkHeading "Informing dbus about changed env-vars" (builtins.concatStringsSep "\n" dbusEnvs) + + mkHeading "Informing systemd user about changed env-vars" (builtins.concatStringsSep "\n" systemdUserEnvs) + + mkHeading "Starting graphical-session-target" '' + err_fail systemctl --user start nixos-fake-graphical-session.target + '' + mkHeading "Key Mappings" keymappings + mkHeading "Rules" ruleSetup + mkHeading "General Settings" generalSettings 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 87cdc709..f44aa0dd 100644 --- a/modules/by-name/st/steam/module.nix +++ b/modules/by-name/st/steam/module.nix @@ -19,15 +19,17 @@ in { }; config = lib.mkIf cfg.enable { - nixpkgs.config.allowUnfreePredicate = pkg: - builtins.elem (lib.getName pkg) [ - # NOTE: These are not really applied. Needs to be at - # <modules/by-name/ni/nixpkgs/config.nix> for some reason. <2025-04-25> - "steam" - "steam-unwrapped" - "steam-original" - "steam-run" - ]; + soispha.nixpkgs.unfreePackageNames = [ + "steam" + "steam-unwrapped" + "steam-original" + "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/common/abstract-nord.png b/modules/by-name/sw/swaybg/images/abstract-nord.png Binary files differindex 5ef498bf..5ef498bf 100644 --- a/modules/common/abstract-nord.png +++ b/modules/by-name/sw/swaybg/images/abstract-nord.png diff --git a/modules/common/abstract-nord.png.license b/modules/by-name/sw/swaybg/images/abstract-nord.png.license index eae6a84c..eae6a84c 100644 --- a/modules/common/abstract-nord.png.license +++ b/modules/by-name/sw/swaybg/images/abstract-nord.png.license diff --git a/modules/by-name/sw/swaybg/module.nix b/modules/by-name/sw/swaybg/module.nix new file mode 100644 index 00000000..fa6a079a --- /dev/null +++ b/modules/by-name/sw/swaybg/module.nix @@ -0,0 +1,35 @@ +# 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, + pkgs, + libraries, + ... +}: let + cfg = config.soispha.programs.swaybg; +in { + options.soispha.programs.swaybg = { + enable = libraries.base.options.mkEnable "swaybg"; + }; + + config = lib.mkIf cfg.enable { + systemd.user.services."swaybg" = { + description = "Background display for river"; + partOf = ["graphical-session.target"]; + after = ["graphical-session.target"]; + requisite = ["graphical-session.target"]; + serviceConfig = { + ExecStart = "${lib.getExe pkgs.swaybg} --image ${./images/abstract-nord.png}"; + }; + wantedBy = ["graphical-session.target"]; + }; + }; +} diff --git a/modules/by-name/sw/swayidle/module.nix b/modules/by-name/sw/swayidle/module.nix new file mode 100644 index 00000000..9bda534f --- /dev/null +++ b/modules/by-name/sw/swayidle/module.nix @@ -0,0 +1,45 @@ +# 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, + libraries, + ... +}: let + cfg = config.soispha.programs.swayidle; + swaylock = lib.getExe pkgs.swaylock; +in { + options.soispha.programs.swayidle = { + enable = libraries.base.options.mkEnable "swayidle"; + }; + + config = lib.mkIf cfg.enable { + home-manager.users.soispha = { + services.swayidle = { + enable = true; + events = { + "before-sleep" = "${swaylock} -f "; + }; + + timeouts = [ + { + timeout = 180; + command = "${swaylock} -fF"; + } + { + timeout = 360; + command = "systemctl suspend-then-hibernate"; + } + ]; + }; + }; + }; +} 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..2219a134 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; + + nixpkgs = sources.loadFlake "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 = { + text = nixpkgs.sourceInfo.rev; }; }; } diff --git a/modules/by-name/xd/xdg/module.nix b/modules/by-name/xd/xdg/module.nix index c2d60f3b..9430d82f 100644 --- a/modules/by-name/xd/xdg/module.nix +++ b/modules/by-name/xd/xdg/module.nix @@ -41,15 +41,15 @@ }; cfg = config.soispha.xdg; + + inherit (config.home-manager.users.soispha.home) homeDirectory; in { options.soispha.xdg = { enable = lib.mkEnableOption "xdg"; }; config = lib.mkIf cfg.enable { - home-manager.users.soispha.xdg = let - inherit (config.home-manager.users.soispha.home) homeDirectory; - in { + home-manager.users.soispha.xdg = { enable = true; configFile."xdg-desktop-portal-termfilechooser/config".source = tfcConfigFile; diff --git a/modules/by-name/yt/yt/module.nix b/modules/by-name/yt/yt/module.nix index 81bacf44..f001c030 100644 --- a/modules/by-name/yt/yt/module.nix +++ b/modules/by-name/yt/yt/module.nix @@ -113,6 +113,10 @@ in { config = { home-manager.users.soispha = lib.mkIf cfg.enable { + home.packages = [ + pkgs.yt + ]; + xdg.configFile = { "yt/mpv.conf".text = renderOptions mpvConf; "yt/mpv.input.conf".text = renderBindings mpvInputConfig; |
