-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjustfile
More file actions
83 lines (63 loc) · 1.83 KB
/
Copy pathjustfile
File metadata and controls
83 lines (63 loc) · 1.83 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# list recipes
help:
just --list
now := `date +"%Y-%m-%d_%H.%M.%S"`
hostname := `uname -n`
# echo hostname (uname -n)
echo:
@echo "{{ hostname }}"
# Update the flake lock file
update:
nix flake update
# Run `sudo nixos-rebuild switch`
switch:
sudo nixos-rebuild switch --flake .
# Run `sudo nixos-rebuild boot --flake .`
boot:
sudo nixos-rebuild boot --flake .
# garbage collect
gc:
nix-store --gc
# prompt/echo for fwupd commands
fwupd:
@echo "run 'fwupdmgr refresh' to refresh firmware list"
@echo "run 'fwupdmgr get-updates' to check for updates"
@echo "Run 'fwupdmgr update' to update firmware"
# Lint all files (similar to GitHub Actions), setup nix-shell
lint:
nix develop --accept-flake-config .#lint
# Load ansible
galaxy:
# nix develop --accept-flake-config .#ansible
cd ansible && uv run ansible-galaxy install -r requirements.yml
tailscale:
# nix develop --accept-flake-config .#ansible
cd ansible && uv run ansible-playbook playbook_tailscale.yml --ask-vault-pass
odroid:
# nix develop --accept-flake-config .#ansible
cd ansible && uv run ansible-playbook playbook_odroid.yml --ask-vault-pass
edit:
# nix develop --accept-flake-config .#ansible
cd ansible && uv run ansible-vault edit group_vars/all/vault.yml
view:
# nix develop --accept-flake-config .#ansible
cd ansible && uv run ansible-vault view group_vars/all/vault.yml
# format all the files, when in a nix-shell
format:
nixpkgs-fmt .
statix fix
# check all files (similar to GitHub Actions), when in a nix-shell
check:
actionlint
yamllint .
statix check
nixpkgs-fmt --check .
# Check flake evaluation
flake:
nix flake check --no-build --all-systems
# Test the configuration
test:
nix flake check --no-build --all-systems
# Open the github repo in default web browser
open:
xdg-open https://github.com/iancleary/infra & disown