Skip to content

Commit e8bda02

Browse files
authored
Merge pull request #14 from hrenard/main
Add nix flake
2 parents d9d6dd0 + 08760c5 commit e8bda02

File tree

3 files changed

+213
-0
lines changed

3 files changed

+213
-0
lines changed

.github/workflows/tests.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,13 @@ jobs:
6565
- name: Install dependencies
6666
run: uv sync --group doc
6767
- run: uv run sphinx-build doc build/sphinx/html
68+
69+
nix:
70+
runs-on: ubuntu-latest
71+
steps:
72+
- uses: actions/checkout@v4
73+
- uses: cachix/install-nix-action@v27
74+
with:
75+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
76+
- run: nix build
77+
- run: nix flake check

flake.lock

Lines changed: 133 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: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
inputs = {
3+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
4+
flake-utils.url = "github:numtide/flake-utils";
5+
pyproject-nix = {
6+
url = "github:pyproject-nix/pyproject.nix";
7+
inputs.nixpkgs.follows = "nixpkgs";
8+
};
9+
uv2nix = {
10+
url = "github:pyproject-nix/uv2nix";
11+
inputs.pyproject-nix.follows = "pyproject-nix";
12+
inputs.nixpkgs.follows = "nixpkgs";
13+
};
14+
pyproject-build-systems = {
15+
url = "github:pyproject-nix/build-system-pkgs";
16+
inputs.pyproject-nix.follows = "pyproject-nix";
17+
inputs.uv2nix.follows = "uv2nix";
18+
inputs.nixpkgs.follows = "nixpkgs";
19+
};
20+
};
21+
22+
outputs =
23+
{
24+
self,
25+
nixpkgs,
26+
flake-utils,
27+
uv2nix,
28+
pyproject-nix,
29+
pyproject-build-systems,
30+
...
31+
}:
32+
flake-utils.lib.eachDefaultSystem (
33+
system:
34+
let
35+
inherit (nixpkgs) lib;
36+
37+
workspace = uv2nix.lib.workspace.loadWorkspace { workspaceRoot = ./.; };
38+
39+
overlay = workspace.mkPyprojectOverlay {
40+
sourcePreference = "wheel";
41+
};
42+
43+
pkgs = nixpkgs.legacyPackages.${system};
44+
45+
python = pkgs.python312;
46+
47+
pythonSet =
48+
(pkgs.callPackage pyproject-nix.build.packages {
49+
inherit python;
50+
}).overrideScope
51+
(
52+
lib.composeManyExtensions [
53+
pyproject-build-systems.overlays.default
54+
overlay
55+
]
56+
);
57+
58+
in
59+
{
60+
packages.default = pythonSet.mkVirtualEnv "scim-cli-env" workspace.deps.default;
61+
62+
apps = {
63+
default = {
64+
type = "app";
65+
program = "${self.packages.${system}.default}/bin/scim2";
66+
};
67+
};
68+
}
69+
);
70+
}

0 commit comments

Comments
 (0)