27 lines
703 B
Nix
27 lines
703 B
Nix
{ lib, config, pkgs, ... }:
|
|
|
|
let
|
|
username = config.defaultUser or "henrov";
|
|
homeDir = config.home.homeDirectory or "/home/${username}";
|
|
|
|
# Use relative path from the module file; Home Manager will expand at activation
|
|
assetPath = builtins.toString (./../../../assets/copy_2_home);
|
|
|
|
in
|
|
{
|
|
_module.args.hmUsers = {
|
|
${username} = {
|
|
home.activation.copyAssets = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
|
echo "Copying assets from ${assetPath} to ${homeDir} ..."
|
|
|
|
mkdir -p "${homeDir}"
|
|
|
|
# Recursively copy all files, overwrite existing, preserve symlinks
|
|
cp -a "${assetPath}/." "${homeDir}/"
|
|
|
|
echo "Done copying assets."
|
|
'';
|
|
};
|
|
};
|
|
}
|