|
2 | 2 | description = "Central, Dolphin's CI/CD plumbing infrastructure"; |
3 | 3 |
|
4 | 4 | inputs.flake-utils.url = "github:numtide/flake-utils"; |
5 | | - inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; |
6 | | - inputs.poetry2nix.url = "github:nix-community/poetry2nix"; |
7 | | - inputs.poetry2nix.inputs.nixpkgs.follows = "nixpkgs"; |
| 5 | + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; |
8 | 6 |
|
9 | | - outputs = { self, nixpkgs, flake-utils, poetry2nix }: { |
10 | | - overlay = nixpkgs.lib.composeManyExtensions [ |
11 | | - poetry2nix.overlays.default |
12 | | - (final: prev: { |
13 | | - central = prev.poetry2nix.mkPoetryApplication { |
14 | | - projectDir = ./.; |
15 | | - overrides = prev.poetry2nix.defaultPoetryOverrides.extend (self: super: { |
16 | | - pypeul = super.pypeul.overridePythonAttrs (old: { buildInputs = (old.buildInputs or []) ++ [ super.poetry-core ]; }); |
17 | | - }); |
| 7 | + inputs.uv2nix.url = "github:pyproject-nix/uv2nix"; |
| 8 | + inputs.uv2nix.inputs.nixpkgs.follows = "nixpkgs"; |
| 9 | + inputs.uv2nix.inputs.pyproject-nix.follows = "pyproject-nix"; |
| 10 | + |
| 11 | + inputs.pyproject-nix.url = "github:pyproject-nix/pyproject.nix"; |
| 12 | + inputs.pyproject-nix.inputs.nixpkgs.follows = "nixpkgs"; |
| 13 | + |
| 14 | + inputs.pyproject-build-systems.url = "github:pyproject-nix/build-system-pkgs"; |
| 15 | + inputs.pyproject-build-systems.inputs.nixpkgs.follows = "nixpkgs"; |
| 16 | + inputs.pyproject-build-systems.inputs.pyproject-nix.follows = "pyproject-nix"; |
| 17 | + |
| 18 | + outputs = { self, nixpkgs, flake-utils, uv2nix, pyproject-nix, pyproject-build-systems }: |
| 19 | + let |
| 20 | + perSystem = flake-utils.lib.eachDefaultSystem (system: |
| 21 | + let |
| 22 | + pkgs = import nixpkgs { inherit system; }; |
| 23 | + workspace = uv2nix.lib.workspace.loadWorkspace { workspaceRoot = ./.; }; |
| 24 | + overlay = workspace.mkPyprojectOverlay { |
| 25 | + sourcePreference = "wheel"; |
18 | 26 | }; |
19 | | - }) |
20 | | - ]; |
21 | | - } // (flake-utils.lib.eachDefaultSystem (system: |
22 | | - let |
23 | | - pkgs = import nixpkgs { |
24 | | - inherit system; |
25 | | - overlays = [ self.overlay ]; |
26 | | - }; |
27 | | - in rec { |
28 | | - packages.central = pkgs.central; |
29 | | - defaultPackage = pkgs.central; |
| 27 | + python = pkgs.python310; |
| 28 | + pythonSet = |
| 29 | + (pkgs.callPackage pyproject-nix.build.packages { inherit python; }) |
| 30 | + .overrideScope (pkgs.lib.composeManyExtensions [ |
| 31 | + pyproject-build-systems.overlays.default |
| 32 | + overlay |
| 33 | + ]); |
| 34 | + venv = pythonSet.mkVirtualEnv "central-env" workspace.deps.default; |
| 35 | + in { |
| 36 | + packages.central = venv; |
| 37 | + packages.default = venv; |
30 | 38 |
|
31 | | - devShells.default = with pkgs; mkShell { |
32 | | - buildInputs = [ poetry ]; |
| 39 | + apps.default = { |
| 40 | + type = "app"; |
| 41 | + program = "${venv}/bin/central"; |
| 42 | + }; |
| 43 | + |
| 44 | + devShells.default = pkgs.mkShell { |
| 45 | + packages = [ pkgs.uv ]; |
| 46 | + }; |
| 47 | + }); |
| 48 | + in |
| 49 | + perSystem // { |
| 50 | + overlays.default = final: prev: { |
| 51 | + central = self.packages.${final.system}.central; |
33 | 52 | }; |
34 | | - } |
35 | | - )); |
| 53 | + overlay = self.overlays.default; |
| 54 | + }; |
36 | 55 | } |
0 commit comments