Skip to content

Commit c02c23d

Browse files
authored
add nix flake (#64)
* add nix flake * add CI
1 parent 0b9cc58 commit c02c23d

File tree

4 files changed

+119
-0
lines changed

4 files changed

+119
-0
lines changed

.github/workflows/nix-check.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Nix tests
2+
3+
on:
4+
pull_request:
5+
paths:
6+
'**/*.nix'
7+
8+
jobs:
9+
nix-tests:
10+
name: nix-tests
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Check out the repository
15+
uses: actions/checkout@v4
16+
17+
- name:
18+
uses: DeterminateSystems/nix-installer-action@main
19+
20+
- name: Test formatting of nix files
21+
run: |
22+
nix fmt -- -c .

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,7 @@ index.pb
132132
.idea
133133
*.iml
134134
.vscode/
135+
136+
# Direnv
137+
.envrc
138+
.direnv/

flake.lock

Lines changed: 58 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
description = "dapla-statbank-authenticator ";
3+
4+
inputs = {
5+
flake-parts.url = "github:hercules-ci/flake-parts";
6+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
7+
};
8+
9+
outputs = inputs @ {flake-parts, ...}:
10+
flake-parts.lib.mkFlake {inherit inputs;} {
11+
systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"];
12+
perSystem = {
13+
config,
14+
self',
15+
inputs',
16+
pkgs,
17+
system,
18+
...
19+
}: {
20+
devShells.default = pkgs.mkShell {
21+
name = "statbank-authenticator env";
22+
23+
packages = with pkgs; [
24+
bump2version
25+
poetry
26+
python312
27+
ruff-lsp
28+
yaml-language-server
29+
];
30+
};
31+
32+
formatter = pkgs.alejandra;
33+
};
34+
};
35+
}

0 commit comments

Comments
 (0)