In-repo Configuration

You can configure nix-ci on a per-commit basis by adding a nix-ci section in your flake.nix .

Validator

You can use this validator to validate your configuration without having to push a commit.

To get your configuration as a JSON string, you can run this command in your repository:

nix eval --json --file ./nix-ci.nix

Reference schema

# SuiteConfiguration
enable: # optional
  # default: true
  # Enable CI
  <boolean>
systems: # optional
  # Only build for these systems. By default these are computed based on which workers are available for the repository.
  # or null
  - <string>
onlyBuild: # optional
  # Only build these attributes.
  # or null
  - <string>
doNotBuild: # optional
  # Exclude these attributes.
  # or null
  - <string>
git-ssh-key: # optional
  # SSH Key to use for git-clone-ing
  # By default no SSH key is used so Nix will fail to clone private dependencies.
  # SshKeyConfiguration
  secret: # required
    # name of the secret on NixCI to use as the private key
    <string>
  public-key: # required
    # public key of the ssh key
    <string>
timeout: # optional
  # Maximum timeout, in seconds. Note that the actual timeout may depend on the workers' configuration.
  <number>
cache: # optional
  # Ssh Cache configuration
  # In order to push to the cache as well, the repository needs to have a SSH_CACHE_PRIVATE_KEY secret.
  # SshCacheConfiguration
  # any of
  [ domain: # required
      # cache domain, example: cache.nix-ci.com
      <string>
  , url: # required
      # cache url, example: ssh://cache.nix-ci.com
      <string>
  ]
  host-key: # optional
    # ssh host key
    <string>
  public-key: # required
    # ssh public key
    <string>
  cache-public-key: # optional
    # cache verification public key
    <string>
cachix: # optional
  # Cachix configuration
  # In order to push to the cache as well, the repository needs to have a CACHIX_AUTH_TOKEN or CACHIX_SIGNING_KEY secret.
  # CachixConfiguration
  name: # required
    # cache name
    <string>
  public-key: # required
    # cache public key (for pulling)
    <string>
allow-import-from-derivation: # optional
  # Show with --allow-import-from-derivation
  # default:  True
  <boolean>
impure: # optional
  # Whether to build with --impure
  # default:  False
  <boolean>
build-logs: # optional
  # Whether to build with --print-build-logs
  # default:  True
  <boolean>
fail-fast: # optional
  # Whether to fail cancel the rest of a suite once one job fails
  <boolean>
deploy: # optional
  # default: {}
  # Deploy Configurations
  <key>: 
    # DeployConfiguration
    enable: # optional
      # default: true
      # enable this deployment
      <boolean>
    package: # required
      # package of which the main program will be run
      <string>
    system: # optional
      # system on which the deployment will be run
      <string>
    branches: # optional
      # default: default
      # branches from which may be deployed
      # any of
      [ # Deploy from any branch
        any
      , # The same as "any"
        all
      , # Only deploy from the default branch
        default
      , # Deploy from any of this list of branches
        - <string>
      ]
    secrets: # optional
      # default: []
      # secrets provided to the deployment
      - <string>
    ssh-keys: # optional
      # default: []
      # ssh keys provided to the deployment
      - # SshKeyConfiguration
        secret: # required
          # name of the secret on NixCI to use as the private key
          <string>
        public-key: # required
          # public key of the ssh key
          <string>