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 .#nix-ci --json

Reference schema

# Configuration
nix-ci: # optional
  # NixCI Configuration
  # SuiteConfiguration
  enable: # optional
    # default: true
    # Enable CI
    <boolean>
  onlyBuild: # optional
    # Only build these attributes.
    # or null
    - <string>
  doNotBuild: # optional
    # default: []
    # Do not build these attributes.
    # or null
    - <string>
  git-ssh-key: # optional
    # SSH Key to use for git-clone-ing
    # SshKeyConfiguration
    secret: # required
      # name of the secret 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>
  impure: # optional
    # Build with --impure
    <boolean>
  build-logs: # optional
    # Build with --print-build-logs
    <boolean>
  auto-update: # optional
    # Whether to schedule 'nix flake update' jobs
    # any of
    [ <boolean>
    , # AutoUpdateConfiguration
      enable: # required
        # Enable auto-update jobs
        # or null
        <boolean>
      base: # optional
        # Base branch to base PRs off
        <string>
      user: # optional
        # Github user who's the owner of the access token
        <string>
    ]
  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
        # branches from which may be deployed
        - <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 to use as the private key
            <string>
          public-key: # required
            # public key of the ssh key
            <string>