-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJustfile
More file actions
66 lines (51 loc) · 1.93 KB
/
Justfile
File metadata and controls
66 lines (51 loc) · 1.93 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
hostname := `hostname`
cachix-cache-name := "tilde"
attic-cache-name := "tilde"
cache-jobs := "5"
nh-build-flags := "--out-link result"
default:
@just --list
[doc("Builds the current host")]
build: (build-system hostname)
[doc("Build a host by name")]
build-system name:
nh darwin build .#darwinConfigurations.{{ name }} {{ nh-build-flags }}
[doc("Build a specific home-manager user")]
build-home name:
nh home build .#homeConfigurations.{{ name }}.activation-script {{ nh-build-flags }}
[doc("Switch to the current host profile")]
switch:
nh darwin switch .#
[doc("Check flake")]
check:
nix flake check --impure --all-systems
[doc("Open a Nix REPL for this flake")]
repl:
nix repl --expr "builtins.getFlake \"$PWD\""
[doc("Format code")]
format:
treefmt
[doc("Push the `result` to the binary caches")]
push-result-to-cache: (push-to-cache "result")
[doc("Push an arbitrary path to the binary caches")]
push-to-cache path:
cachix push --jobs {{ cache-jobs }} {{ cachix-cache-name }} {{ path }}
attic push --jobs {{ cache-jobs }} {{ attic-cache-name }} {{ path }}
[doc("Move `bashrc` and `zshrc` files so they don't get clobbered")]
move-rc-files:
sudo mv /etc/bashrc /etc/bashrc.before-nix-darwin
sudo mv /etc/zshrc /etc/zshrc.before-nix-darwin
sudo mv /etc/zprofile /etc/zprofile.before-nix-darwin
[doc("Edit a secret file")]
edit-secret file:
EDITOR="zeditor --wait" sops {{ file }}
[doc("Update all secret files with new keys")]
update-secret-files:
find . -regextype egrep -regex '^.*secrets\.(json|yml)' -execdir sops updatekeys {} -y ';'
[doc("Generate an age key for the current user")]
generate-user-age-key:
mkdir -p ~/.config/sops/age
nix shell nixpkgs#age --command sh -c "age-keygen -o ~/.config/sops/age/keys.txt"
[doc("Get the age key for the current host")]
host-age-key:
nix shell nixpkgs#ssh-to-age --command sh -c "sudo cat /etc/ssh/ssh_host_ed25519_key.pub | ssh-to-age"