Regenerated

This commit is contained in:
2026-03-27 08:55:47 +00:00
parent 38be2a2af6
commit 3dc3c4d833
2 changed files with 2 additions and 2 deletions
@@ -0,0 +1,42 @@
{ config, pkgs, lib, flakeRoot, ... }:
let
username = config.users.users.defaultUser or "henrov";
configDir = "/home/${username}/.config";
assetPath = "${flakeRoot}/.config";
in
{
environment.systemPackages = [ pkgs.rsync ];
systemd.services.copyAssets = {
description = "Copy assets to ${username}'s .config directory";
wantedBy = [ "multi-user.target" ];
# oneshot service runs once at boot
serviceConfig.Type = "oneshot";
# Always use /bin/sh -c for multi-line commands
serviceConfig.ExecStart = ''
/bin/sh -c '
echo "Copying assets from ${assetPath} to ${configDir} ..."
if [ ! -d "${assetPath}" ]; then
echo "ERROR: ${assetPath} does not exist"
exit 1
fi
mkdir -p "${configDir}"
chown -R u+rwx ${username}:${username} "${configDir}"
${pkgs.rsync}/bin/rsync -a --no-owner --no-group "${assetPath}/" "${configDir}/"
# Fix .config permissions
mkdir -p "${configDir}"
chown -R ${username}:${username} "${configDir}"
chmod -R u+rwx "${configDir}"
echo "Done copying config files."
'
'';
};
}