mirror of
https://gitlab.com/TECHNOFAB/coder-templates.git
synced 2025-12-11 17:50:06 +01:00
feat(nix-kubernetes): add startup and shutdown tasks with home-manager
This commit is contained in:
parent
c4b30329cb
commit
9bbb4b9298
1 changed files with 18 additions and 0 deletions
|
|
@ -77,6 +77,12 @@
|
|||
if [ ! -z "$DOTFILES_REPO" ]; then
|
||||
echo "Dotfiles present, reloading home-manager profile"
|
||||
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
|
||||
echo "No dotfiles repo specified, skipping..."
|
||||
fi
|
||||
|
|
@ -84,5 +90,17 @@
|
|||
run_on_start = 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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue