-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevshell.toml
67 lines (67 loc) · 1.52 KB
/
devshell.toml
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
[devshell]
name = "nix-config"
packages = [
'libnotify',
'vim',
'git',
'alejandra',
'deadnix',
'statix',
]
[[commands]]
help = "Rebuilds nixos system. First arg is the target hostname"
name = "rebuild"
command = """
#!/usr/bin/env bash
if [ "$#" -eq 0 ]; then
TARGET="$HOSTNAME"
else
TARGET="$1"
fi
echo "--- Git Status ---"
git status -s
echo "$TARGET rebuilding"
sudo nixos-rebuild switch --flake .#$TARGET --show-trace
nix fmt
doom sync
deadnix
statix check -i hardware-configuration.nix
notify-send 'Praise the rebuild' -t 10000
"""
[[commands]]
help = "Update and rebuild the nixos system. First arg is the target hostname"
name = "upbuild"
command = """
#!/usr/bin/env bash
nix flake update
if [ "$#" -eq 0 ]; then
TARGET="$HOSTNAME"
else
TARGET="$1"
fi
echo "--- Git Status ---"
git status -s
echo "$TARGET rebuilding"
sudo nixos-rebuild switch --flake .#$TARGET --show-trace
nix fmt
doom sync
deadnix
statix check -i hardware-configuration.nix
notify-send 'Praise the update' -t 10000
"""
[[commands]]
help = "Rebuilds a remote system, with most recent git pull"
name = "sync"
command = """
#!/usr/bin/env bash
if [ "$#" -eq 0 ]; then
echo "First argument must be the remote system hostname/ip"
else
TARGET="$1"
fi
echo "--- Git Status ---"
git status -s
echo "$TARGET rebuilding"
ssh $TARGET -t "cd nix-config/; git reset --hard && git pull && sudo nixos-rebuild switch --flake . --show-trace"
notify-send '$TARGET synced' -t 10000
"""