diff options
| -rw-r--r-- | modules/by-name/at/atuin/module.nix | 4 | ||||
| -rw-r--r-- | modules/by-name/au/ausweisapp/module.nix | 3 | ||||
| -rw-r--r-- | modules/by-name/gp/gpg/module.nix | 45 | ||||
| -rw-r--r-- | modules/by-name/lu/lutris/module.nix | 3 | ||||
| -rw-r--r-- | modules/by-name/mp/mpv/module.nix | 58 | ||||
| -rw-r--r-- | modules/by-name/nv/nvim/module.nix | 4 | ||||
| -rw-r--r-- | modules/by-name/st/steam/module.nix | 5 | ||||
| -rw-r--r-- | modules/by-name/ta/taskwarrior/module.nix | 5 | ||||
| -rw-r--r-- | modules/by-name/un/unison/module.nix | 11 | ||||
| -rw-r--r-- | modules/common/default.nix | 25 |
10 files changed, 98 insertions, 65 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/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/lu/lutris/module.nix b/modules/by-name/lu/lutris/module.nix index f8f39681..eabc11fb 100644 --- a/modules/by-name/lu/lutris/module.nix +++ b/modules/by-name/lu/lutris/module.nix @@ -24,6 +24,9 @@ in { 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 = { 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/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/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/common/default.nix b/modules/common/default.nix index 91c45040..f2a6b04d 100644 --- a/modules/common/default.nix +++ b/modules/common/default.nix @@ -97,38 +97,17 @@ 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" - "~/.config/lutris" - "~/.config/AusweisApp" - "~/media" "~/documents" "~/repos" |
