Nixos-Configuration/justfile
Jermeiah S 05bca5b139
All checks were successful
/ check (push) Successful in 1m46s
/ deploy (push) Has been skipped
improved just file
added just ssh for ygg services
2025-06-23 13:42:49 -04:00

56 lines
958 B
Makefile

# Like GNU `make`, but `just` rustier.
# https://just.systems/
# run `just` from this directory to see available commands
# Default command when 'just' is run without arguments
default:
@just --list
# Update nix flake
[group('Main')]
update:
nix flake update
# Lint nix files
[group('dev')]
lint:
nix fmt
# gather ips
[group('dev')]
gather:
ip-gather
# gather ips
[group('dev')]
get-key machine:
ssh-keyscan -t ed25519 olympus 2>/dev/null | ssh-to-age
# Auto SSH resolution
[group('dev')]
ssh host:
#!/usr/bin/env bash
set -euo pipefail
addr=$(jq -r --arg host "{{host}}" '.[$host] // empty' hosts.json)
if [ -n "$addr" ]; then
echo "Connecting to $addr for {{host}}"
ssh "$addr"
else
echo "Hostname '{{host}}' not found in hosts.json"
exit 1
fi
# Check nix flake
[group('dev')]
check:
nix flake check
# Manually enter dev shell
[group('dev')]
dev:
nix develop
# Activate the configuration
[group('Main')]
run:
nix run