[nix] explicit pypi-deps-db flake input

This change will allow for easier fix of the situation when
python dependencies of the project get updated to version that's not
available in current version of "pypi-deps-db", and also not yet
propagated to "mach-nix-src" repo

This way "nix flake lock --update-input pypi-deps-db" will take latest
commit of the db, and it will be used as input for "mach-nix-src" locally
This commit is contained in:
efim 2021-10-14 23:47:59 +03:00 committed by efim
parent fc7e5bcc5b
commit 189b9cf8cb
2 changed files with 31 additions and 18 deletions

13
flake.lock generated
View file

@ -50,7 +50,9 @@
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"pypi-deps-db": "pypi-deps-db" "pypi-deps-db": [
"pypi-deps-db"
]
}, },
"locked": { "locked": {
"lastModified": 1629464241, "lastModified": 1629464241,
@ -99,11 +101,11 @@
"pypi-deps-db": { "pypi-deps-db": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1622970040, "lastModified": 1634243405,
"narHash": "sha256-u//RFnae/XMIhoy83G2uH2Qu/1LiUhVCdwwY1xj4Ufs=", "narHash": "sha256-mopV8eg7VChFcdS0V74wpyWLXBpl5E4zPaKHq/CcgUQ=",
"owner": "DavHau", "owner": "DavHau",
"repo": "pypi-deps-db", "repo": "pypi-deps-db",
"rev": "be6591698c67a86a69c81fef72167e38d038a9fc", "rev": "c00afed61c57a09ba931c4dc264195570db4e943",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -117,7 +119,8 @@
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"mach-nix-src": "mach-nix-src", "mach-nix-src": "mach-nix-src",
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2",
"pypi-deps-db": "pypi-deps-db"
} }
} }
}, },

View file

@ -3,16 +3,20 @@
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs"; nixpkgs.url = "github:NixOS/nixpkgs";
mach-nix-src.url = "github:DavHau/mach-nix";
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
pypi-deps-db = {
url = "github:DavHau/pypi-deps-db";
flake = false;
};
mach-nix-src.url = "github:DavHau/mach-nix";
mach-nix-src.inputs.pypi-deps-db.follows = "pypi-deps-db";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
}; };
inputs.flake-compat = { outputs = { self, nixpkgs, flake-utils, mach-nix-src, pypi-deps-db, ... }:
url = "github:edolstra/flake-compat";
flake = false;
};
outputs = { self, nixpkgs, flake-utils, mach-nix-src, ... }:
let let
# TODO : for some reason `nix flake show` results in error: # TODO : for some reason `nix flake show` results in error:
# ```error: a 'aarch64-darwin' with features {} is required to build '/nix/store/s79ixgs3xy250x1b9vyy90g7dzd6bsh4-conda-channels.json.drv', # ```error: a 'aarch64-darwin' with features {} is required to build '/nix/store/s79ixgs3xy250x1b9vyy90g7dzd6bsh4-conda-channels.json.drv',
@ -25,8 +29,14 @@
nixpkgs.lib.genAttrs supportedSystems (system: f system); nixpkgs.lib.genAttrs supportedSystems (system: f system);
python = "python38"; python = "python38";
pypiDataRev = "18250538b9eeb9484c4e3bdf135bc1f3a2ccd949";
pypiDataSha256 = "01hdjy5rpcjm92fyp8n6lci773rgbsa81h2n08r49zjhk9michrb"; # if updating python dependencies results in error
# "The given requirements might contain package versions which are not yet part of the dependency DB"
# then
# run `nix flake lock --update-input pypi-deps-db` to set lock file to most recent pypi-deps-db
pypiDataRev = pypi-deps-db.rev;
pypiDataSha256 = pypi-deps-db.narHash;
# pypiDataSha256 = "1k66qyivkv6bhhpmddj2sw0i8mcq4fzrsnp6b3rlv7g5a0n1dbdf";
requirements = builtins.readFile ./requirements.txt; requirements = builtins.readFile ./requirements.txt;
nixpkgsFor = forAllSystems ( nixpkgsFor = forAllSystems (
@ -56,10 +66,10 @@
} }
); );
dev-python = dev-python =
mach-nix.mkPython { mach-nix.mkPython {
inherit python; inherit python;
requirements = requirements; requirements = requirements;
}; };
}; };
packages = forAllSystems ( packages = forAllSystems (
system: system: