This repository has been archived by the owner on Apr 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
55 lines (53 loc) · 1.67 KB
/
flake.nix
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
{
description = "Application packaged using poetry2nix";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
poetry2nix = {
url =
"github:nix-community/poetry2nix/626111646fe236cb1ddc8191a48c75e072a82b7c";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.follows = "poetry2nix/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, poetry2nix }:
{
# Nixpkgs overlay providing the application
overlay = final: prev:
let
mkPyk = python:
let
p2n = poetry2nix.lib.mkPoetry2Nix { pkgs = prev; };
in p2n.mkPoetryApplication {
python = python;
projectDir = ./.;
groups = [ ];
# We remove `"dev"` from `checkGroups`, so that poetry2nix does not try to resolve dev dependencies.
checkGroups = [ ];
overrides = p2n.defaultPoetryOverrides.extend
(self: super: {
pygments = super.pygments.overridePythonAttrs
(
old: {
buildInputs = (old.buildInputs or [ ]) ++ [ super.hatchling ];
}
);
});
};
in rec {
pyk = pyk-python310;
pyk-python310 = mkPyk prev.python310;
pyk-python311 = mkPyk prev.python311;
};
} // (flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlay ];
};
in {
packages = {
inherit (pkgs) pyk pyk-python310 pyk-python311;
default = pkgs.pyk;
};
}));
}