34 lines
868 B
Nix
34 lines
868 B
Nix
# --- This file has been auto-generated. For permanent changes alter the appropriate block in the README.org. ---
|
|
{ lib, config, pkgs, flakeRoot, ... }:
|
|
let
|
|
username = config.defaultUser or "henrov";
|
|
configPath = flakeRoot + "/generated/.config/scripts";
|
|
allFiles = lib.filesystem.listFilesRecursive configPath;
|
|
|
|
toRelative = file:
|
|
let
|
|
base = toString flakeRoot + "/generated/";
|
|
relative = lib.removePrefix base (toString file);
|
|
in
|
|
builtins.unsafeDiscardStringContext relative;
|
|
|
|
isShellScript = file:
|
|
lib.hasSuffix ".sh" (toString file);
|
|
|
|
toFileEntry = file: {
|
|
name = toRelative file;
|
|
value = {
|
|
source = file;
|
|
executable = isShellScript file;
|
|
force = true;
|
|
};
|
|
};
|
|
in
|
|
{
|
|
home-manager.users = {
|
|
${username} = {
|
|
home.file = builtins.listToAttrs (map toFileEntry allFiles);
|
|
};
|
|
};
|
|
}
|