Regenerated
This commit is contained in:
@@ -1,19 +1,33 @@
|
||||
{ lib, config, pkgs, flakeRoot, ... }:
|
||||
|
||||
let
|
||||
username = config.defaultUser or "henrov";
|
||||
scriptsPath = flakeRoot + "/generated/.config/scripts";
|
||||
|
||||
# Get all files in the scripts directory recursively
|
||||
scriptFiles = lib.filesystem.listFilesRecursive scriptsPath;
|
||||
|
||||
# Convert a file path to a relative string like ".config/scripts/foo.sh"
|
||||
toRelative = file:
|
||||
let
|
||||
fullStr = toString file;
|
||||
baseStr = toString (flakeRoot + "/generated/");
|
||||
in
|
||||
lib.removePrefix baseStr fullStr;
|
||||
|
||||
# Build the attrset entry for each file
|
||||
toFileEntry = file: {
|
||||
name = toRelative file;
|
||||
value = {
|
||||
text = builtins.readFile file;
|
||||
executable = true;
|
||||
force = true;
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
home-manager.users = {
|
||||
${username} = {
|
||||
home.file = {
|
||||
".config/scripts/update.sh" = {
|
||||
text = builtins.readFile (flakeRoot + "/generated/.config/scripts/update.sh");
|
||||
executable = true;
|
||||
force = true;
|
||||
};
|
||||
};
|
||||
home.file = builtins.listToAttrs (map toFileEntry scriptFiles);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user