Files
nixos/Droidnix/generated/modules/traveldroid/system/copy_scripts.nix
T
2026-04-11 09:59:50 +02:00

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);
};
};
}