{ lib, config, pkgs, flakeRoot, ... }: let username = config.defaultUser or "henrov"; flakeRootPath = /. + flakeRoot; basePath = lib.path.append flakeRootPath "generated"; scriptsPath = lib.path.append basePath ".config/scripts"; scriptFiles = lib.filesystem.listFilesRecursive scriptsPath; toRelative = file: lib.path.removePrefix basePath file; toFileEntry = file: { name = toRelative file; value = { source = file; executable = true; force = true; }; }; in { home-manager.users = { ${username} = { home.file = builtins.listToAttrs (map toFileEntry scriptFiles); }; }; }