feat(nix-kubernetes): add startup and shutdown tasks with home-manager

This commit is contained in:
technofab 2025-06-05 19:42:47 +02:00
parent c4b30329cb
commit 9bbb4b9298

View file

@ -77,6 +77,12 @@
if [ ! -z "$DOTFILES_REPO" ]; then if [ ! -z "$DOTFILES_REPO" ]; then
echo "Dotfiles present, reloading home-manager profile" echo "Dotfiles present, reloading home-manager profile"
reload-dotfiles reload-dotfiles
# the homeConfiguration can specify a program "coder_startup", run it
# here if it exists
if command -v coder_startup &> /dev/null; then
echo "Running startup tasks..."
coder_startup
fi
else else
echo "No dotfiles repo specified, skipping..." echo "No dotfiles repo specified, skipping..."
fi fi
@ -84,5 +90,17 @@
run_on_start = true; run_on_start = true;
start_blocks_login = true; start_blocks_login = true;
}; };
coder_script."home-manager-shutdown" = {
agent_id = "\${coder_agent.coder.id}";
display_name = "Home Manager Shutdown";
icon = "/emojis/1f3e0.png";
script = ''
if command -v coder_shutdown &> /dev/null; then
echo "Running shutdown tasks..."
coder_shutdown
fi
'';
run_on_stop = true;
};
}; };
} }