-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathJustfile
More file actions
38 lines (31 loc) · 1.15 KB
/
Justfile
File metadata and controls
38 lines (31 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
set shell := ["bash", "-uc"]
set positional-arguments
# List all just recipes available
default:
@just --list
# Deploy select machines
apply machine:
colmena apply --verbose --on {{machine}}
# Build a nixos configuration
build-machine MACHINE *ARGS:
nix build -L .#nixosConfigurations.{{MACHINE}}.config.system.build.toplevel {{ARGS}}
# Build a nixos installer iso
build-iso MACHINE *ARGS:
nix build -L .#nixosConfigurations.{{MACHINE}}.config.system.build.isoImage {{ARGS}}
# Build all nixosConfigurations
build-machines *ARGS:
#!/usr/bin/env nu
let nodes = (nix eval --json '.#nixosConfigurations' --apply builtins.attrNames | from json)
for node in $nodes {just build-machine $node {{ARGS}}}
# Generate age key
generate-age-key:
#!/usr/bin/env bash
mkdir -p ~/.config/sops/age
if [ ! -f ~/.config/sops/age/keys.txt ]; then
echo "Generating private age key..."
age-keygen -o ~/.config/sops/age/keys.txt
echo "Backup ~/.config/sops/age/keys.txt or you will lose access to secrets!!!"
else
echo "Not regenerating key because age key already exists!"
fi
echo "Your public key is: $(age-keygen -y ~/.config/sops/age/keys.txt)"