use latest nixpkgs and poetry2nix

This commit is contained in:
Dmitriy Pleshevskiy 2023-03-22 14:13:36 +03:00
parent 88e2a5beb9
commit deac6def79
Signed by: pleshevskiy
GPG key ID: 79C4487B44403985
3 changed files with 43 additions and 28 deletions

View file

@ -17,22 +17,47 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1678875422,
"narHash": "sha256-T3o6NcQPwXjxJMn2shz86Chch4ljXgZn746c2caGxd8=",
"lastModified": 1679477347,
"narHash": "sha256-0Vpbt5q4QG3XHVcUA9ifWxUg1eqcz0fdcQdNdiK4ZrM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "126f49a01de5b7e35a43fd43f891ecf6d3a51459",
"rev": "4dc8a5c2dcb80cbdd00b4010d41a75dd26379e86",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"poetry2nix": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1679445660,
"narHash": "sha256-yhO+5d5Ilxybmt3/oGI7KJ/kjnDq50MLrPIvjc40qeg=",
"owner": "nix-community",
"repo": "poetry2nix",
"rev": "50ec694c27a12bc178fff961c4dd927fa6a47f18",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "poetry2nix",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs",
"poetry2nix": "poetry2nix"
}
}
},

View file

@ -1,9 +1,13 @@
{
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs";
poetry2nix.url = "github:nix-community/poetry2nix";
poetry2nix.inputs.nixpkgs.follows = "nixpkgs";
poetry2nix.inputs.flake-utils.follows = "flake-utils";
};
outputs = { self, nixpkgs, flake-utils, ... }:
outputs = { self, nixpkgs, flake-utils, poetry2nix, ... }:
let
inherit (builtins) listToAttrs mapAttrs;
@ -25,7 +29,8 @@
mkApp = drv: flake-utils.lib.mkApp { inherit drv; };
mkOverlay = name:
final: prev:
final.filterAttrs (n: v: n == name) (mkAllPackages prev);
final.filterAttrs (n: v: n == name) (mkAllPackages prev)
// { poetry2nix = nixpkgs.packages.${final.system}.poetry2nix; };
in
{
overlays = (listToAttrs
@ -34,12 +39,15 @@
allPackageNames
)
) // {
all = final: prev: mkAllPackages prev;
all = final: prev:
mkAllPackages prev
// { poetry2nix = nixpkgs.packages.${final.system}.poetry2nix; };
};
}
// flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
overlays = [ poetry2nix.overlay ];
pkgs = import nixpkgs { inherit system overlays; };
packages = mkAllPackages pkgs;
in
{

View file

@ -6,27 +6,9 @@
let
poetryOverrides = poetry2nix.defaultPoetryOverrides.extend (full: prev: {
colorama = prev.colorama.overridePythonAttrs (old: {
buildInputs = old.buildInputs ++ [ prev.hatchling ];
});
iniconfig = prev.iniconfig.overridePythonAttrs (old: {
buildInputs = old.buildInputs ++ [ prev.hatchling prev.hatch-vcs ];
});
filelock = prev.filelock.overridePythonAttrs (old: {
buildInputs = old.buildInputs ++ [ prev.hatchling prev.hatch-vcs ];
});
packaging = prev.packaging.overridePythonAttrs (old: {
buildInputs = old.buildInputs ++ [ prev.flit-core ];
});
pathspec = prev.pathspec.overridePythonAttrs (old: {
buildInputs = old.buildInputs ++ [ prev.flit-core ];
});
nox = prev.nox.overridePythonAttrs (old: {
buildInputs = old.buildInputs ++ [ prev.setuptools ];
});
exceptiongroup = prev.exceptiongroup.overridePythonAttrs (old: {
buildInputs = old.buildInputs ++ [ prev.flit-scm ];
});
pip-requirements-parser = prev.pip-requirements-parser.overridePythonAttrs (old: {
dontConfigure = true;
});