{ lib
, ...
}:
# $FLAKE should be configured to where your repository is located
# Preferably using direnv, you can also set it into your sessionVariables
let
dot_path = "${builtins.getEnv("FLAKE")}/sub/dir/";
dot_paths = lib.filesystem.listFilesRecursive dot_path;
dot_strings = builtins.map (x: builtins.toString x) dot_paths;
dot_prefixDeleted = builtins.map (x: builtins.replaceStrings [ dot_path ] [ "" ] x) dot_strings;
dotfile_outOfStoreLinked = lib.attrsets.genAttrs dot_prefixDeleted (name: {
source = config.lib.file.mkOutOfStoreSymlink (dot_path + name);
});
in
{
home.file = dotfile_outOfStoreLinked;
}
I know I mentioned linking things from $FLAKE repo into $HOME which I'm quite happy with. This is the implementation I'm using. It'll replicate a tree subdir into $HOME for you, nothing using home.file.x.recursive so you won't get collisions with folders and stuff 😄
|