-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtaskfile.yaml
More file actions
54 lines (48 loc) · 1.38 KB
/
Copy pathtaskfile.yaml
File metadata and controls
54 lines (48 loc) · 1.38 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
version: "3"
tasks:
switch:
desc: switch to new version
cmds:
- cmd: nixos-rebuild switch --flake path:. --show-trace
platforms: [linux]
- cmd: darwin-rebuild switch --flake path:. --show-trace
platforms: [darwin]
update:
desc: update all deps
cmds:
- nix flake update
env:
NIX_CONFIG:
sh: echo "extra-access-tokens = github.com=$(gh auth token)"
# Install stuff
install:*:
desc: install to disks labeled `nix` and `boot`
vars:
HOST: "{{index .MATCH 0}}"
cmds:
- task: password:root
- task: password:zoriya
- mkdir -p /mnt/{boot,nix}
- mount /dev/disk/by-label/boot /mnt/boot
- mount /dev/disk/by-label/nix /mnt/nix
- task: swap
- defer: { task: swap-off }
- mkdir -p /mnt/nix/persist/tmp
- TMPDIR=/mnt/nix/persist/tmp nixos-install --no-channel-copy --no-root-password --flake path:.#{{.HOST}}
password:*:
desc: setup passwords
vars:
USER: "{{index .MATCH 0}}"
cmds:
- nix-shell -p mkpasswd --run 'mkpasswd -m SHA-512 | tr -d \\n > password/{{.USER}}'
status:
- test -f password/{{.USER}}
swap:
desc: setup swap file (for live usb mostly)
cmds:
- mkswap -U clear --size 20G --file /mnt/nix/swap
- swapon /mnt/nix/swap
swap-off:
cmds:
- swapoff /mnt/nix/swap
- rm /mnt/nix/swap