-
Notifications
You must be signed in to change notification settings - Fork 1
/
justfile
66 lines (51 loc) · 1.32 KB
/
justfile
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
# 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:
echo "nix-flatpak initial build may take a while..."
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
ansible:
nix develop --accept-flake-config .#ansible
# 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/nixos-config & disown