{ pkgs, config, lib, ... }: let user = config.home.username; in { home.activation.getNotes = lib.hm.dag.entryAfter [ "writeBoundary" ] '' touch /tmp/notes notes_dir=/home/${user}/.local/share/notes remote=git@git.bitlab21.com:sam/notes if [ -d "$notes_dir" ]; then cd "$notes_dir" [ ! -d .git ] && PATH="${pkgs.git}/bin:${pkgs.openssh}/bin:$PATH" git clone "$remote" "$notes_dir" else mkdir -p "$notes_dir" && PATH="${pkgs.git}/bin:${pkgs.openssh}/bin:$PATH" git clone "$remote" "$notes_dir" fi ''; home.activation.foo = lib.hm.dag.entryAfter [ "writeBoundary" ] '' touch /tmp/foo ''; }