add-nixos-rebuild-test #24

Merged
torjus merged 5 commits from add-nixos-rebuild-test into master 2026-02-05 23:26:34 +00:00
Owner

Summary

  • Add nixos-rebuild-test helper script deployed to all hosts for easier branch testing
  • Replace all writeShellScript and writeShellScriptBin usages with writeShellApplication for automatic shellcheck validation and strict bash options

New helper script

# Instead of:
nixos-rebuild boot --flake "git+https://git.t-juice.club/torjus/nixos-servers.git?ref=my-feature"

# Now:
nixos-rebuild-test boot my-feature

Files changed

File Change
system/nix.nix Added nixos-rebuild-test script
hosts/template/scripts.nix Converted prepare-host.sh to writeShellApplication
hosts/template2/scripts.nix Converted prepare-host.sh to writeShellApplication
services/monitoring/prometheus.nix Converted fetchOpenbaoToken to writeShellApplication
hosts/vaulttest01/configuration.nix Converted vault-test to writeShellApplication
system/vault-secrets.nix Created mkFetchScript helper using writeShellApplication
CLAUDE.md Added guidance to prefer writeShellApplication

Test plan

  • Build template1, template2, vaulttest01, monitoring01, ns1
## Summary - Add `nixos-rebuild-test` helper script deployed to all hosts for easier branch testing - Replace all `writeShellScript` and `writeShellScriptBin` usages with `writeShellApplication` for automatic shellcheck validation and strict bash options ### New helper script ```bash # Instead of: nixos-rebuild boot --flake "git+https://git.t-juice.club/torjus/nixos-servers.git?ref=my-feature" # Now: nixos-rebuild-test boot my-feature ``` ### Files changed | File | Change | |------|--------| | `system/nix.nix` | Added `nixos-rebuild-test` script | | `hosts/template/scripts.nix` | Converted `prepare-host.sh` to writeShellApplication | | `hosts/template2/scripts.nix` | Converted `prepare-host.sh` to writeShellApplication | | `services/monitoring/prometheus.nix` | Converted `fetchOpenbaoToken` to writeShellApplication | | `hosts/vaulttest01/configuration.nix` | Converted `vault-test` to writeShellApplication | | `system/vault-secrets.nix` | Created `mkFetchScript` helper using writeShellApplication | | `CLAUDE.md` | Added guidance to prefer writeShellApplication | ## Test plan - [x] Build template1, template2, vaulttest01, monitoring01, ns1
torjus added 3 commits 2026-02-05 23:19:14 +00:00
Adds a helper script deployed to all hosts for testing feature branches.
Usage: nixos-rebuild-test <action> <branch>

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
system: replace writeShellScript with writeShellApplication
Some checks failed
Run nix flake check / flake-check (pull_request) Successful in 2m3s
Run nix flake check / flake-check (push) Failing after 5m57s
bbb22e588e
Convert remaining writeShellScript usages to writeShellApplication for
shellcheck validation and strict bash options.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
torjus added 2 commits 2026-02-05 23:26:23 +00:00
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
system: add MOTD banner with hostname and commit info
Some checks failed
Run nix flake check / flake-check (pull_request) Successful in 2m8s
Run nix flake check / flake-check (push) Failing after 3m53s
258e350b89
Displays FQDN and flake commit hash with timestamp on login.
Templates can override with their own MOTD via mkDefault.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
torjus merged commit aa6e00a327 into master 2026-02-05 23:26:34 +00:00
torjus deleted branch add-nixos-rebuild-test 2026-02-05 23:26:34 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: torjus/nixos-servers#24