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

29 lines
644 B
Nix

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