28 lines
611 B
Nix
28 lines
611 B
Nix
{ lib, config, pkgs, flakeRoot, ... }:
|
|
let
|
|
username = config.defaultUser or "henrov";
|
|
basePath = flakeRoot + "/generated";
|
|
scriptsPath = basePath + "/.config/scripts";
|
|
|
|
scriptFiles = lib.filesystem.listFilesRecursive scriptsPath;
|
|
|
|
toRelative = file:
|
|
lib.path.removePrefix (lib.path.append flakeRoot "generated") 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);
|
|
};
|
|
};
|
|
}
|