-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
39 lines (34 loc) · 1.24 KB
/
.gitlab-ci.yml
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
image: nixos/nix:latest
variables:
NIX_PATH: "nixpkgs=channel:nixos-unstable"
GIT_STRATEGY: clone
GIT_DEPTH: 1
stages:
- "Update"
- "Checks"
"Update inputs":
stage: "Update"
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
script:
- git clone https://${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git
- cd nixcfg
- git config --global user.email "${GIT_USER_EMAIL:-$GITLAB_USER_EMAIL}"
- git config --global user.name "${GIT_USER_NAME:-$GITLAB_USER_NAME}"
- nix --extra-experimental-features "nix-command flakes" flake update --commit-lock-file
- nix --extra-experimental-features "nix-command flakes" flake check
- git push https://${CI_PROJECT_NAMESPACE}:${CI_JOB_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git "${CI_DEFAULT_BRANCH}" -o ci.skip || echo "No changes to commit"
"Check formatting":
rules:
- if: $CI_PIPELINE_SOURCE == "push"
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
stage: "Checks"
script:
- nix --extra-experimental-features "nix-command flakes" fmt -- -c .
"Check evaluation":
rules:
- if: $CI_PIPELINE_SOURCE == "push"
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
stage: "Checks"
script:
- nix --extra-experimental-features "nix-command flakes" flake check