fix: make parseParams optional

This commit is contained in:
Yusuf Bera Ertan 2022-10-07 17:40:42 +03:00
parent 10b6663f7b
commit 109e32da9c
No known key found for this signature in database
GPG Key ID: 1D8F8FAF2294D6EA
5 changed files with 10 additions and 9 deletions

View File

@ -186,7 +186,7 @@ in {
fetcher = fetchers."${fetcherName}"; fetcher = fetchers."${fetcherName}";
args = args =
if fetcher ? parseParams if fetcher.parseParams != null
then fetcher.parseParams params then fetcher.parseParams params
else if b.length params != b.length fetcher.inputs else if b.length params != b.length fetcher.inputs
then then

View File

@ -17,7 +17,7 @@ in {
description = "Subsystem of the builder."; description = "Subsystem of the builder.";
}; };
build = lib.mkOption { build = lib.mkOption {
type = t.functionTo t.attrs; type = t.uniq (t.functionTo t.attrs);
default = _: {}; default = _: {};
}; };
type = lib.mkOption { type = lib.mkOption {

View File

@ -17,7 +17,7 @@ in {
description = "Subsystem of the discoverer."; description = "Subsystem of the discoverer.";
}; };
discover = lib.mkOption { discover = lib.mkOption {
type = t.functionTo (t.listOf t.attrs); type = t.uniq (t.functionTo (t.listOf t.attrs));
default = _: {}; default = _: {};
}; };
}; };

View File

@ -41,14 +41,15 @@ in {
''; '';
}; };
parseParams = l.mkOption { parseParams = l.mkOption {
type = t.functionTo t.attrs; type = t.nullOr (t.uniq (t.functionTo t.attrs));
default = null;
}; };
outputs = l.mkOption { outputs = l.mkOption {
type = t.functionTo ( type = t.uniq (t.functionTo (
t.submoduleWith { t.submoduleWith {
modules = [outputsOptions]; modules = [outputsOptions];
} }
); ));
}; };
}; };
} }

View File

@ -8,7 +8,7 @@ in {
default = false; default = false;
}; };
discoverProject = lib.mkOption { discoverProject = lib.mkOption {
type = t.nullOr (t.functionTo (t.anything)); type = t.nullOr (t.uniq (t.functionTo (t.anything)));
default = null; default = null;
}; };
extraArgs = lib.mkOption { extraArgs = lib.mkOption {
@ -43,11 +43,11 @@ in {
type = t.str; type = t.str;
}; };
translate = lib.mkOption { translate = lib.mkOption {
type = t.nullOr (t.functionTo t.attrs); type = t.nullOr (t.uniq (t.functionTo t.attrs));
default = null; default = null;
}; };
finalTranslate = lib.mkOption { finalTranslate = lib.mkOption {
type = t.nullOr (t.functionTo t.attrs); type = t.nullOr (t.uniq (t.functionTo t.attrs));
readOnly = true; readOnly = true;
description = '' description = ''
the final translate that you should use. the final translate that you should use.