From 6cd16cfab0e9d8557d8a6e876fffb636da615cc9 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Thu, 24 Oct 2024 15:13:13 +0200 Subject: feat(modules/unison): Auto-ignore all symlinks made with `home.file` This allows us to actually sync symlinks, as most of the unwanted ones are already ignored. And syncing the `.direnv` gc-roots is not that much of a problem, because these are re-generated when they point to a non-existent path. --- flake/nixosConfigurations/common.nix | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'flake') diff --git a/flake/nixosConfigurations/common.nix b/flake/nixosConfigurations/common.nix index 2ff85521..68533bd8 100644 --- a/flake/nixosConfigurations/common.nix +++ b/flake/nixosConfigurations/common.nix @@ -43,16 +43,24 @@ foreign.userName = "soispha"; dataDir = "${config.home-manager.users.soispha.xdg.dataHome}/unison"; userSourceDir = "/srv/home/soispha"; - pathsToIgnore = [ - # already synchronized by the taskserver - "~/.local/share/task" + pathsToIgnore = let + extractTarget = attr: "~/${attr.target}"; + homeManagerSymlinks = + builtins.map extractTarget + (builtins.attrValues + config.home-manager.users.soispha.home.file); + in + [ + # already synchronized by the taskserver + "~/.local/share/task" - # Should not be synchronized - "~/.local/share/unison" + # Should not be synchronized + "~/.local/share/unison" - # Is just to big to be synchronized (# TODO: Work around that <2024-08-31> ) - "~/media/music" - ]; + # Is just to big to be synchronized (# TODO: Work around that <2024-08-31> ) + "~/media/music" + ] + ++ homeManagerSymlinks; pathsToSync = [ "~/.local/state/mpv" -- cgit 1.4.1