Flake checks
nix flake update '.' treats . as an input name, not a path. When flake-dir is empty, omit the argument entirely instead of passing '.' to nix commands. |
||
|---|---|---|
| health | ||
| update | ||
| README.md | ||
checks
Reusable Forgejo Actions for Nix flake health checks and lockfile updates.
Usage
Health check
Run on every push and PR:
# .forgejo/workflows/flake-check.yml
name: Flake check
on:
push:
branches: [main]
pull_request:
jobs:
check:
runs-on: nix
steps:
- uses: actions/checkout@v4
- uses: https://git.simple.fast/simplefast/checks/health@v1
Update flake.lock
Run on a schedule:
# .forgejo/workflows/update-flake.yml
name: Update flake.lock
on:
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
jobs:
update:
runs-on: nix
steps:
- uses: actions/checkout@v4
- uses: https://git.simple.fast/simplefast/checks/update@v1
Actions
simplefast/checks/health
Validates that your flake and lockfile are in good shape:
- Confirms
flake.lockexists - Warns if any flake input is older than N days
- Checks that the nixpkgs input owner is
NixOS - Checks that the nixpkgs input points to a supported branch
- Runs
nix flake check --no-build(evaluation only) - Runs
nix flake check -L(all checks)
| Input | Default | Description |
|---|---|---|
max-input-age-days |
30 |
Warn if any flake input is older than this |
nixpkgs-input-name |
nixpkgs |
Name of the nixpkgs input (empty to skip) |
flake-dir |
"" |
Relative path to the flake directory (empty for repo root) |
fail-mode |
false |
Fail the job on warnings, not just errors |
- uses: https://git.simple.fast/simplefast/checks/health@v1
with:
max-input-age-days: 14
fail-mode: "true"
Flake in a subdirectory:
- uses: https://git.simple.fast/simplefast/checks/health@v1
with:
flake-dir: "nix"
simplefast/checks/update
Runs nix flake update, validates evaluation, builds all packages, and only commits + pushes if builds pass. If the build fails, the lockfile is reverted and the job fails.
| Input | Default | Description |
|---|---|---|
flake-dir |
"" |
Relative path to the flake directory (empty for repo root) |
commit-message |
chore: update flake.lock |
Commit message |
git-author-name |
Forgejo Actions |
Git author name |
git-author-email |
forgejo@simple.fast |
Git author email |
- uses: https://git.simple.fast/simplefast/checks/update@v1
with:
commit-message: "chore: update nix flake inputs"
Flake in a subdirectory:
- uses: https://git.simple.fast/simplefast/checks/update@v1
with:
flake-dir: "nix"