chore(v1): move name & version to top-level

This commit is contained in:
DavHau 2023-03-19 14:46:59 +07:00
parent fa5668eef3
commit 4aa6e86907
9 changed files with 31 additions and 42 deletions

View File

@ -6,7 +6,7 @@
l = lib // builtins;
cfg = config.eval-cache;
packageName = config.public.name;
packageName = config.name;
filterTrue = l.filterAttrsRecursive (key: val: l.isAttrs val || val == true);
@ -106,7 +106,7 @@
;
refresh =
config.deps.writeScript
"refresh-${config.public.name}"
"refresh-${config.name}"
refreshCommand;
};

View File

@ -7,7 +7,7 @@
l = lib // builtins;
python = config.deps.python;
cfg = config.mach-nix;
packageName = config.public.name;
packageName = config.name;
# For a given name, return the path containing the downloaded file
getDistDir = name: "${cfg.pythonSources.names}/${name}";
@ -109,9 +109,8 @@
;
};
public = {
inherit name version;
};
inherit name version;
buildPythonPackage = {
format = "setuptools";
pipInstallFlags =

View File

@ -19,7 +19,7 @@
in
l.filterAttrs (name: _: ! excludedNixpkgsAttrs ? ${name}) pythonAttrs;
extracted = extractPythonAttrs config.deps.python.pkgs.${config.public.name};
extracted = extractPythonAttrs config.deps.python.pkgs.${config.name};
in {
imports = [
./interface.nix

View File

@ -14,14 +14,12 @@ in {
python = nixpkgs.python39;
};
public = {
name = "ansible";
version = "2.7.1";
};
name = "ansible";
version = "2.7.1";
mkDerivation = {
preUnpack = ''
export src=$(ls ${config.mach-nix.pythonSources}/names/${config.public.name}/*);
export src=$(ls ${config.mach-nix.pythonSources}/names/${config.name}/*);
'';
};
@ -29,14 +27,14 @@ in {
format = "setuptools";
pythonImportsCheck = [
config.public.name
config.name
];
};
mach-nix.pythonSources = config.deps.fetchPythonRequirements {
inherit python;
name = config.public.name;
requirementsList = ["${config.public.name}==${config.public.version}"];
name = config.name;
requirementsList = ["${config.name}==${config.version}"];
hash = "sha256-dCo1llHcCiFrBOEd6mWhwqwVglsN2grSbcdBj8OzKDY=";
maxDate = "2023-01-01";
};

View File

@ -26,16 +26,14 @@ in {
;
};
public = {
name = "apache-airflow";
version = "2.5.0";
};
name = "apache-airflow";
version = "2.5.0";
mkDerivation = {
src = config.deps.fetchFromGitHub {
owner = "apache";
repo = "airflow";
rev = "refs/tags/${config.public.version}";
rev = "refs/tags/${config.version}";
# Download using the git protocol rather than using tarballs, because the
# GitHub archive tarballs don't appear to include tests
forceFetchGit = true;
@ -58,7 +56,7 @@ in {
mach-nix.pythonSources = config.deps.fetchPythonRequirements {
inherit (config.deps) python;
name = config.public.name;
name = config.name;
requirementsList = [
"apache-airflow"
];

View File

@ -19,10 +19,8 @@ in {
python = nixpkgs.python38;
};
public = {
name = "odoo";
version = "16.0";
};
name = "odoo";
version = "16.0";
mkDerivation = {
src = config.deps.fetchFromGitHub {
@ -36,7 +34,7 @@ in {
mach-nix.pythonSources = config.deps.fetchPythonRequirements {
inherit (config.deps) python;
name = config.public.name;
name = config.name;
requirementsFiles = ["${config.mkDerivation.src}/requirements.txt"];
hash = "sha256-E9wNvBakm+R5TSsFsnGpSaziYpi2otm0iBiyphUVSFI=";
maxDate = "2023-01-01";

View File

@ -22,10 +22,8 @@ in {
;
};
public = {
name = "pillow";
version = "9.3.0";
};
name = "pillow";
version = "9.3.0";
mkDerivation = {
nativeBuildInputs = [
@ -37,7 +35,7 @@ in {
];
preUnpack = ''
export src=$(ls ${config.mach-nix.pythonSources}/names/${config.public.name}/*);
export src=$(ls ${config.mach-nix.pythonSources}/names/${config.name}/*);
'';
};
@ -51,8 +49,8 @@ in {
mach-nix.pythonSources = config.deps.fetchPythonRequirements {
inherit python;
name = config.public.name;
requirementsList = ["${config.public.name}==${config.public.version}"];
name = config.name;
requirementsList = ["${config.name}==${config.version}"];
hash = "sha256-eS81pqSjU6mgBL6tXadSxkGdafsVFThByOQcOf8FkF0=";
maxDate = "2023-01-01";
pipFlags = [

View File

@ -18,28 +18,26 @@ in {
;
};
public = {
name = "tensorflow";
version = "2.11.0";
};
name = "tensorflow";
version = "2.11.0";
mkDerivation = {
preUnpack = ''
export src=$(ls ${config.mach-nix.pythonSources}/names/${config.public.name}/*);
export src=$(ls ${config.mach-nix.pythonSources}/names/${config.name}/*);
'';
};
buildPythonPackage = {
format = "wheel";
pythonImportsCheck = [
config.public.name
config.name
];
};
mach-nix.pythonSources = config.deps.fetchPythonRequirements {
inherit (config.deps) python;
name = config.public.name;
requirementsList = ["${config.public.name}==${config.public.version}"];
name = config.name;
requirementsList = ["${config.name}==${config.version}"];
hash = "sha256-PDUrECFjoPznqXwqi2e1djx63t+kn/kAyM9JqQrTmd0=";
maxDate = "2023-01-01";
};

View File

@ -8,7 +8,7 @@
system = "x86_64-linux";
# A module imported into every package setting up the eval cache
evalCacheSetup = {config, ...}: {
eval-cache.cacheFileRel = "/v1/nix/modules/drvs/${config.public.name}/cache-${system}.json";
eval-cache.cacheFileRel = "/v1/nix/modules/drvs/${config.name}/cache-${system}.json";
eval-cache.repoRoot = self;
eval-cache.enable = true;
};