How NixActions compares to other CI/CD solutions.
| Feature | GitHub Actions | NixActions |
|---|---|---|
| Execution model | Parallel + needs | Same |
| Dependencies | needs: [...] |
Same |
| Conditions | if: success() etc |
Same (condition) |
| Step conditions | steps[].if |
Same (actions[].condition) |
| Continue on error | continue-on-error |
Same (continueOnError) |
| Actions | JavaScript/Docker | Nix derivations |
| Configuration | YAML | Nix DSL (composable) |
| Environment | Container images | Nix derivations (hermetic) |
| Dependencies mgmt | Cached layers | Nix store (content-addressed) |
| Composition | Reusable workflows | Nix functions |
| Infrastructure | GitHub.com | None (agentless) |
| Local execution | act (partial compat) |
Native nix run |
| Test without push | Must push to repo | nix run .#ci locally |
| Build environments | Variable (network, time) | Reproducible (Nix store) |
| Cost | $21/month+ | $0 |
GitHub Actions:
name: CI
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm test
deploy:
needs: test
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- run: deploy.shNixActions:
nixactions.mkWorkflow {
name = "ci";
jobs = {
test = {
executor = nixactions.executors.local;
steps = [
{ bash = "npm test"; deps = [ pkgs.nodejs ]; }
];
};
deploy = {
needs = [ "test" ];
condition = ''[ "$GITHUB_REF" = "refs/heads/main" ]'';
executor = nixactions.executors.local;
steps = [
{ bash = "deploy.sh"; }
];
};
};
}| Feature | GitLab CI | NixActions |
|---|---|---|
| Execution | Sequential by default | Parallel by default |
| Configuration | YAML | Nix DSL |
| Infrastructure | GitLab instance | None |
| Local testing | Limited | Native |
| Test without push | Must push | Local nix run |
| Runners | Requires registration | Agentless |
GitLab CI:
stages:
- test
- deploy
test:
stage: test
script:
- npm test
deploy:
stage: deploy
script:
- deploy.sh
only:
- mainNixActions:
nixactions.mkWorkflow {
name = "ci";
jobs = {
test = {
executor = nixactions.executors.local;
steps = [{ bash = "npm test"; }];
};
deploy = {
needs = [ "test" ];
condition = ''[ "$BRANCH" = "main" ]'';
executor = nixactions.executors.local;
steps = [{ bash = "deploy.sh"; }];
};
};
}| Feature | Jenkins | NixActions |
|---|---|---|
| Configuration | Groovy/GUI | Nix |
| Infrastructure | Jenkins server | None |
| Plugins | 1800+ plugins | Nix packages |
| Maintenance | High | None |
| Local testing | Difficult | Native |
| Reproducibility | Variable | Guaranteed |
| Feature | CircleCI | NixActions |
|---|---|---|
| Configuration | YAML | Nix |
| Orbs | Marketplace | Nix functions |
| Local testing | CLI tool | Native nix run |
| Infrastructure | circleci.com | None |
| Cost | Usage-based | $0 |
# Test your CI locally before pushing
$ nix run .#ci
# No more "fix CI" commits# Same derivation = same environment everywhere
deps = [ pkgs.nodejs_20 pkgs.git pkgs.curl ]# Reuse as functions, not copy-paste
let
commonTest = {
bash = "npm test";
deps = [ pkgs.nodejs ];
retry = { max_attempts = 3; };
};
in {
jobs = {
test-unit = { steps = [ (commonTest // { bash = "npm run test:unit"; }) ]; };
test-e2e = { steps = [ (commonTest // { bash = "npm run test:e2e"; }) ]; };
};
}# Run anywhere with Nix
$ nix run .#ci # Local
$ ssh server < result # Remote
$ kubectl exec pod -- /workflow # K8s$ nix build .#ci
error: builder for '/nix/store/xxx-test.drv' failed
# Catch errors before runtimeGitHub Actions has 1000s of marketplace actions. NixActions relies on:
- Nix packages (80,000+)
- Custom actions (Nix derivations)
- Standard library
No built-in integration with GitHub/GitLab. You need to:
- Run workflows manually or via cron
- Set up your own triggering mechanism
- Handle notifications yourself
Nix has a steeper learning curve than YAML:
# Nix syntax
{ pkgs, ... }: { bash = "npm test"; deps = [ pkgs.nodejs ]; }
# vs YAML
run: npm test- Already using Nix/NixOS
- Need reproducible builds
- Want local CI testing
- Complex build pipelines
- Self-hosted infrastructure
- Cost-sensitive
- Quick prototype projects
- Team unfamiliar with Nix
- Heavy reliance on marketplace actions
- Simple single-step builds
- Need native GitHub integration
- Map
jobs->jobs - Map
steps->actions - Map
needs->needs - Map
if->condition - Replace
useswith Nix derivations
- Map
stagesto dependency graph vianeeds - Map
script->actions - Map
only/except->condition
- Philosophy - Why NixActions
- User Guide - Getting started
- Architecture - How it works