mirror of
https://github.com/srid/nixos-config.git
synced 2026-05-11 09:28:13 +08:00
justfile: refactor
This commit is contained in:
parent
4bef01787a
commit
0c6a50ebe1
1 changed files with 12 additions and 11 deletions
23
justfile
23
justfile
|
|
@ -4,13 +4,20 @@ default:
|
|||
# Main commands
|
||||
# --------------------------------------------------------------------------------------------------
|
||||
|
||||
# Activate local configuration (home if exists, else system)
|
||||
# Activate the given host or home environment
|
||||
[group('main')]
|
||||
activate:
|
||||
@if [ -f ./configurations/home/$USER@$HOSTNAME.nix ]; then \
|
||||
just deploy $USER@$HOSTNAME; \
|
||||
activate host="":
|
||||
@if [ -z "{{host}}" ]; then \
|
||||
if [ -f ./configurations/home/$USER@$HOSTNAME.nix ]; then \
|
||||
echo "Activating home env $USER@$HOSTNAME ..."; \
|
||||
nix run . $USER@$HOSTNAME; \
|
||||
else \
|
||||
echo "Activating system env $HOSTNAME ..."; \
|
||||
nix run . $HOSTNAME; \
|
||||
fi \
|
||||
else \
|
||||
just deploy $HOSTNAME; \
|
||||
echo "Deploying to {{host}} ..."; \
|
||||
nix run . {{host}}; \
|
||||
fi
|
||||
|
||||
# Update primary flame inputs
|
||||
|
|
@ -18,12 +25,6 @@ activate:
|
|||
update:
|
||||
nix run .#update
|
||||
|
||||
# Deploy to a given host
|
||||
[group('main')]
|
||||
deploy host:
|
||||
@echo "Activating on/Deploying to {{host}} ..."
|
||||
@nix run . {{host}}
|
||||
|
||||
# Run all pre-commit hooks on all files
|
||||
[group('main')]
|
||||
lint:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue