feat(mach-nix): use fetch-pip and set defaults

This commit is contained in:
DavHau 2023-03-23 14:41:22 +08:00
parent 1e4e1cdaf5
commit 96873569bf
2 changed files with 13 additions and 8 deletions

View File

@ -157,6 +157,11 @@ in {
];
config = {
# use lock file to manage hash for fetchPip
lock.fields.fetchPipHash =
config.lock.lib.computeFODHash
config.mach-nix.pythonSources;
mach-nix.drvs = (l.mapAttrs makeModuleFromDerivation preparedWheels.patchedWheels) // preparedWheels.builtWheels;
mach-nix.dists =
l.mapAttrs
@ -165,6 +170,14 @@ in {
mach-nix.dependencyTree = dependencyTree;
mach-nix.pythonSources = {
imports = [../../drv-parts/fetch-pip];
deps.python = config.deps.python;
fetch-pip = {
hash = config.lock.content.fetchPipHash;
};
};
deps = {nixpkgs, ...}:
l.mapAttrs (_: l.mkDefault) {
inherit

View File

@ -10,11 +10,6 @@ in {
../../drv-parts/mach-nix-xs
];
# use lock file to manage hash for fetchPip
lock.fields.fetchPipHash =
config.lock.lib.computeFODHash
config.mach-nix.pythonSources;
deps = {nixpkgs, ...}: {
python = nixpkgs.python39;
inherit (nixpkgs.writers) writePython3;
@ -38,12 +33,9 @@ in {
};
mach-nix.pythonSources = {
imports = [../../drv-parts/fetch-pip];
deps.python = config.deps.python;
fetch-pip = {
maxDate = "2023-01-01";
requirementsList = ["${config.name}==${config.version}"];
hash = config.lock.content.fetchPipHash;
};
};
}