mirror of
https://gitlab.com/TECHNOFAB/coder-templates.git
synced 2025-12-12 02:00:11 +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
|
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;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue