2024-03-17 05:44:51 -05:00
|
|
|
---
|
|
|
|
version: "3"
|
|
|
|
|
|
|
|
vars:
|
|
|
|
host: $HOSTNAME
|
|
|
|
|
|
|
|
tasks:
|
2024-03-25 01:06:14 -05:00
|
|
|
switch:
|
2024-03-17 05:44:51 -05:00
|
|
|
desc: Build and apply nix configuration
|
|
|
|
silent: true
|
|
|
|
requires:
|
|
|
|
vars:
|
|
|
|
- host
|
|
|
|
cmds:
|
2024-03-25 01:06:14 -05:00
|
|
|
- echo "This will switch your config."
|
2024-03-17 05:44:51 -05:00
|
|
|
- task: .prompt_to_continue
|
|
|
|
- sudo nixos-rebuild switch --flake "{{.ROOT_DIR}}/#{{.host}}" --impure
|
|
|
|
preconditions:
|
|
|
|
- sh: which nix
|
|
|
|
msg: "nix not found"
|
|
|
|
- sh: which nixos-rebuild
|
|
|
|
msg: "nixos-rebuild not found"
|
|
|
|
|
2024-03-25 01:06:14 -05:00
|
|
|
test:
|
|
|
|
desc: Build and apply nix configuration
|
|
|
|
silent: true
|
|
|
|
requires:
|
|
|
|
vars:
|
|
|
|
- host
|
|
|
|
cmds:
|
|
|
|
- echo "This will test your config."
|
|
|
|
- task: .prompt_to_continue
|
|
|
|
- sudo nixos-rebuild test --flake "{{.ROOT_DIR}}/#{{.host}}" --impure
|
|
|
|
preconditions:
|
|
|
|
- sh: which nix
|
|
|
|
msg: "nix not found"
|
|
|
|
- sh: which nixos-rebuild
|
|
|
|
msg: "nixos-rebuild not found"
|
|
|
|
|
|
|
|
dry-run:
|
|
|
|
desc: Build and apply nix configuration
|
|
|
|
silent: true
|
|
|
|
requires:
|
|
|
|
vars:
|
|
|
|
- host
|
|
|
|
cmds:
|
|
|
|
- echo "This will dry-run your config."
|
|
|
|
- nixos-rebuild dry-run --flake "{{.ROOT_DIR}}/#{{.host}}" --impure
|
|
|
|
preconditions:
|
|
|
|
- sh: which nix
|
|
|
|
msg: "nix not found"
|
|
|
|
- sh: which nixos-rebuild
|
|
|
|
msg: "nixos-rebuild not found"
|
|
|
|
|
|
|
|
|
2024-03-17 05:44:51 -05:00
|
|
|
build:
|
|
|
|
desc: Build nix configuration
|
|
|
|
silent: true
|
|
|
|
requires:
|
|
|
|
vars:
|
|
|
|
- host
|
|
|
|
cmds:
|
|
|
|
- nixos-rebuild build --flake "{{.ROOT_DIR}}/#{{.host}}" --impure
|
|
|
|
preconditions:
|
|
|
|
- sh: which nix
|
|
|
|
msg: "nix not found"
|
|
|
|
- sh: which nixos-rebuild
|
|
|
|
msg: "nixos-rebuild not found"
|
|
|
|
- sh: which nvd
|
|
|
|
msg: "nvd not found"
|
2024-03-17 15:42:52 -05:00
|
|
|
|
2024-03-17 05:44:51 -05:00
|
|
|
.prompt_to_continue:
|
|
|
|
internal: true
|
2024-03-17 15:42:52 -05:00
|
|
|
prompt: Do you want to continue applying this configuration?
|
2024-03-18 16:16:39 -05:00
|
|
|
|
|
|
|
build-image-rpi4:
|
|
|
|
desc: Build basic machine build-image
|
|
|
|
silent: true
|
|
|
|
cmds:
|
|
|
|
- nix build .#images.rpi4
|