about summary refs log tree commit diff
path: root/.gitlab-ci.yml
blob: c5067a4b75860e02ef6599ae681a947c545b8248 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
---
image: nixpkgs/nix-flakes:latest

variables:
  NIX_PATH: "nixpkgs=channel:nixpkgs-unstable"

before_script:
  - nix --version

stages:
  - env
  - check
  - cache

show:
  stage: env
  script:
    - env
    - nix show-config |
      tee show-config.log
    - nix show-derivation |
      tee show-derivation.log
  artifacts:
    paths:
      - show-config.log
      - show-derivation.log
    expire_in: 1 week
    when: on_success

check:
  stage: check
  script:
    - nix flake check --show-trace
  allow_failure: true

cache:
  stage: cache
  script:
    - >
        nix build --show-trace --json |
        jq -r '.[].outputs | to_entries[].value' |
        nix shell nixpkgs#cachix
        --command cachix push $CACHIX_CACHE_NAME
  artifacts:
    paths:
      - result
    expire_in: 1 week
    when: on_success

Consider giving Nix/NixOS a try! <3