-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathflake.nix
More file actions
66 lines (59 loc) · 2.24 KB
/
flake.nix
File metadata and controls
66 lines (59 loc) · 2.24 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{
description = "Central, Dolphin's CI/CD plumbing infrastructure";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
inputs.uv2nix.url = "github:pyproject-nix/uv2nix";
inputs.uv2nix.inputs.nixpkgs.follows = "nixpkgs";
inputs.uv2nix.inputs.pyproject-nix.follows = "pyproject-nix";
inputs.pyproject-nix.url = "github:pyproject-nix/pyproject.nix";
inputs.pyproject-nix.inputs.nixpkgs.follows = "nixpkgs";
inputs.pyproject-build-systems.url = "github:pyproject-nix/build-system-pkgs";
inputs.pyproject-build-systems.inputs.nixpkgs.follows = "nixpkgs";
inputs.pyproject-build-systems.inputs.pyproject-nix.follows = "pyproject-nix";
outputs = { self, nixpkgs, flake-utils, uv2nix, pyproject-nix, pyproject-build-systems }:
let
perSystem = flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
workspace = uv2nix.lib.workspace.loadWorkspace { workspaceRoot = ./.; };
overlay = workspace.mkPyprojectOverlay {
sourcePreference = "wheel";
};
python = pkgs.python313;
pythonSet =
(pkgs.callPackage pyproject-nix.build.packages { inherit python; })
.overrideScope (pkgs.lib.composeManyExtensions [
pyproject-build-systems.overlays.default
overlay
(final: prev: {
pypeul = prev.pypeul.overrideAttrs (old: {
nativeBuildInputs = (old.nativeBuildInputs or []) ++ (with final; [
hatchling
pathspec
pluggy
packaging
trove-classifiers
]);
});
})
]);
venv = pythonSet.mkVirtualEnv "central-env" workspace.deps.default;
in {
packages.central = venv;
packages.default = venv;
apps.default = {
type = "app";
program = "${venv}/bin/central";
};
devShells.default = pkgs.mkShell {
packages = [ pkgs.uv ];
};
});
in
perSystem // {
overlays.default = final: prev: {
central = self.packages.${final.system}.central;
};
overlay = self.overlays.default;
};
}