Skip to content

Commit 77a342b

Browse files
committed
Add a GitHub CI workflow for testing the nix flake
1 parent e85b78d commit 77a342b

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/nix-build.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Nix Build
2+
3+
on:
4+
pull_request:
5+
push:
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Install nix
17+
uses: cachix/install-nix-action@v31
18+
with:
19+
nix_path: nixpkgs=channel:nixos-unstable
20+
21+
- name: Configure nix
22+
run: echo 'accept-flake-config = true' >>~/.config/nix/nix.conf
23+
24+
- name: Check nix build
25+
run: nix build
26+
27+
- name: Check nix develop
28+
run: |
29+
SYSTEM=$(nix eval --impure --expr builtins.currentSystem)
30+
SHELLS=$(nix eval --raw ".#devShells.$SYSTEM" \
31+
--apply 's: builtins.toString (builtins.attrNames s)')
32+
for NAME in $SHELLS
33+
do
34+
echo ">>>> $NAME <<<<"
35+
nix develop ".#$NAME" -c true
36+
done

0 commit comments

Comments
 (0)