Regenerated

This commit is contained in:
2026-04-11 09:55:08 +02:00
parent b0a13a2b23
commit 489830ce90
5 changed files with 541 additions and 339 deletions
@@ -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);
};
};
}