19 lines
499 B
Nix
19 lines
499 B
Nix
{ pkgs, user, flakeRoot, lib, ... }:
|
|
let
|
|
repoConfDir = flakeRoot + "/assets/conf";
|
|
in
|
|
{
|
|
home.activation.copyWritableConf =
|
|
lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
|
set -eu
|
|
target="$HOME/conf"
|
|
# Start fresh to avoid mixed old/new files
|
|
rm -rf "$target"
|
|
mkdir -p "$target"
|
|
# Copy repo content into a normal writable directory
|
|
cp -a "${repoConfDir}/." "$target/"
|
|
# Ensure the user can edit everything
|
|
chmod -R u+rwX "$target"
|
|
'';
|
|
}
|