treewide: deprecate isNull
https://nixos.org/manual/nix/stable/language/builtins.html#builtins-isNull
This commit is contained in:
@@ -422,7 +422,7 @@ ${expr "" v}
|
|||||||
(if v then "True" else "False")
|
(if v then "True" else "False")
|
||||||
else if isFunction v then
|
else if isFunction v then
|
||||||
abort "generators.toDhall: cannot convert a function to Dhall"
|
abort "generators.toDhall: cannot convert a function to Dhall"
|
||||||
else if isNull v then
|
else if v == null then
|
||||||
abort "generators.toDhall: cannot convert a null to Dhall"
|
abort "generators.toDhall: cannot convert a null to Dhall"
|
||||||
else
|
else
|
||||||
builtins.toJSON v;
|
builtins.toJSON v;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ let
|
|||||||
pkgs = import ../../.. {};
|
pkgs = import ../../.. {};
|
||||||
inherit (pkgs) lib;
|
inherit (pkgs) lib;
|
||||||
getDeps = _: pkg: {
|
getDeps = _: pkg: {
|
||||||
deps = builtins.filter (x: !isNull x) (map (x: x.pname or null) (pkg.propagatedBuildInputs or []));
|
deps = builtins.filter (x: x != null) (map (x: x.pname or null) (pkg.propagatedBuildInputs or []));
|
||||||
broken = (pkg.meta.hydraPlatforms or [null]) == [];
|
broken = (pkg.meta.hydraPlatforms or [null]) == [];
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ let
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
filterDTBs = src: if isNull cfg.filter
|
filterDTBs = src: if cfg.filter == null
|
||||||
then "${src}/dtbs"
|
then "${src}/dtbs"
|
||||||
else
|
else
|
||||||
pkgs.runCommand "dtbs-filtered" {} ''
|
pkgs.runCommand "dtbs-filtered" {} ''
|
||||||
@@ -93,8 +93,8 @@ let
|
|||||||
# Fill in `dtboFile` for each overlay if not set already.
|
# Fill in `dtboFile` for each overlay if not set already.
|
||||||
# Existence of one of these is guarded by assertion below
|
# Existence of one of these is guarded by assertion below
|
||||||
withDTBOs = xs: flip map xs (o: o // { dtboFile =
|
withDTBOs = xs: flip map xs (o: o // { dtboFile =
|
||||||
if isNull o.dtboFile then
|
if o.dtboFile == null then
|
||||||
if !isNull o.dtsFile then compileDTS o.name o.dtsFile
|
if o.dtsFile != null then compileDTS o.name o.dtsFile
|
||||||
else compileDTS o.name (pkgs.writeText "dts" o.dtsText)
|
else compileDTS o.name (pkgs.writeText "dts" o.dtsText)
|
||||||
else o.dtboFile; } );
|
else o.dtboFile; } );
|
||||||
|
|
||||||
@@ -181,7 +181,7 @@ in
|
|||||||
config = mkIf (cfg.enable) {
|
config = mkIf (cfg.enable) {
|
||||||
|
|
||||||
assertions = let
|
assertions = let
|
||||||
invalidOverlay = o: isNull o.dtsFile && isNull o.dtsText && isNull o.dtboFile;
|
invalidOverlay = o: (o.dtsFile == null) && (o.dtsText == null) && (o.dtboFile == null);
|
||||||
in lib.singleton {
|
in lib.singleton {
|
||||||
assertion = lib.all (o: !invalidOverlay o) cfg.overlays;
|
assertion = lib.all (o: !invalidOverlay o) cfg.overlays;
|
||||||
message = ''
|
message = ''
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ let
|
|||||||
];
|
];
|
||||||
|
|
||||||
mkArgs = rule:
|
mkArgs = rule:
|
||||||
if (isNull rule.args) then ""
|
if (rule.args == null) then ""
|
||||||
else if (length rule.args == 0) then "args"
|
else if (length rule.args == 0) then "args"
|
||||||
else "args ${concatStringsSep " " rule.args}";
|
else "args ${concatStringsSep " " rule.args}";
|
||||||
|
|
||||||
@@ -27,9 +27,9 @@ let
|
|||||||
let
|
let
|
||||||
opts = mkOpts rule;
|
opts = mkOpts rule;
|
||||||
|
|
||||||
as = optionalString (!isNull rule.runAs) "as ${rule.runAs}";
|
as = optionalString (rule.runAs != null) "as ${rule.runAs}";
|
||||||
|
|
||||||
cmd = optionalString (!isNull rule.cmd) "cmd ${rule.cmd}";
|
cmd = optionalString (rule.cmd != null) "cmd ${rule.cmd}";
|
||||||
|
|
||||||
args = mkArgs rule;
|
args = mkArgs rule;
|
||||||
in
|
in
|
||||||
|
|||||||
@@ -793,7 +793,7 @@ let
|
|||||||
};
|
};
|
||||||
}));
|
}));
|
||||||
|
|
||||||
motd = if isNull config.users.motdFile
|
motd = if config.users.motdFile == null
|
||||||
then pkgs.writeText "motd" config.users.motd
|
then pkgs.writeText "motd" config.users.motd
|
||||||
else config.users.motdFile;
|
else config.users.motdFile;
|
||||||
|
|
||||||
@@ -1233,7 +1233,7 @@ in
|
|||||||
config = {
|
config = {
|
||||||
assertions = [
|
assertions = [
|
||||||
{
|
{
|
||||||
assertion = isNull config.users.motd || isNull config.users.motdFile;
|
assertion = config.users.motd == null || config.users.motdFile == null;
|
||||||
message = ''
|
message = ''
|
||||||
Only one of users.motd and users.motdFile can be set.
|
Only one of users.motd and users.motdFile can be set.
|
||||||
'';
|
'';
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ in
|
|||||||
'';
|
'';
|
||||||
})]);
|
})]);
|
||||||
|
|
||||||
environment.etc.${cfg.etcClusterAdminKubeconfig}.source = mkIf (!isNull cfg.etcClusterAdminKubeconfig)
|
environment.etc.${cfg.etcClusterAdminKubeconfig}.source = mkIf (cfg.etcClusterAdminKubeconfig != null)
|
||||||
clusterAdminKubeconfig;
|
clusterAdminKubeconfig;
|
||||||
|
|
||||||
environment.systemPackages = mkIf (top.kubelet.enable || top.proxy.enable) [
|
environment.systemPackages = mkIf (top.kubelet.enable || top.proxy.enable) [
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ let
|
|||||||
cfg = config.services.undervolt;
|
cfg = config.services.undervolt;
|
||||||
|
|
||||||
mkPLimit = limit: window:
|
mkPLimit = limit: window:
|
||||||
if (isNull limit && isNull window) then null
|
if (limit == null && window == null) then null
|
||||||
else assert asserts.assertMsg (!isNull limit && !isNull window) "Both power limit and window must be set";
|
else assert asserts.assertMsg (limit != null && window != null) "Both power limit and window must be set";
|
||||||
"${toString limit} ${toString window}";
|
"${toString limit} ${toString window}";
|
||||||
cliArgs = lib.cli.toGNUCommandLine {} {
|
cliArgs = lib.cli.toGNUCommandLine {} {
|
||||||
inherit (cfg)
|
inherit (cfg)
|
||||||
|
|||||||
@@ -362,7 +362,7 @@ in {
|
|||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
assertions = [
|
assertions = [
|
||||||
{
|
{
|
||||||
assertion = cfg.openFirewall -> !isNull cfg.config;
|
assertion = cfg.openFirewall -> cfg.config != null;
|
||||||
message = "openFirewall can only be used with a declarative config";
|
message = "openFirewall can only be used with a declarative config";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -513,22 +513,22 @@ in {
|
|||||||
${indentLines 2 devices}
|
${indentLines 2 devices}
|
||||||
}
|
}
|
||||||
|
|
||||||
${optionalString (!isNull defaults) ''
|
${optionalString (defaults != null) ''
|
||||||
defaults {
|
defaults {
|
||||||
${indentLines 2 defaults}
|
${indentLines 2 defaults}
|
||||||
}
|
}
|
||||||
''}
|
''}
|
||||||
${optionalString (!isNull blacklist) ''
|
${optionalString (blacklist != null) ''
|
||||||
blacklist {
|
blacklist {
|
||||||
${indentLines 2 blacklist}
|
${indentLines 2 blacklist}
|
||||||
}
|
}
|
||||||
''}
|
''}
|
||||||
${optionalString (!isNull blacklist_exceptions) ''
|
${optionalString (blacklist_exceptions != null) ''
|
||||||
blacklist_exceptions {
|
blacklist_exceptions {
|
||||||
${indentLines 2 blacklist_exceptions}
|
${indentLines 2 blacklist_exceptions}
|
||||||
}
|
}
|
||||||
''}
|
''}
|
||||||
${optionalString (!isNull overrides) ''
|
${optionalString (overrides != null) ''
|
||||||
overrides {
|
overrides {
|
||||||
${indentLines 2 overrides}
|
${indentLines 2 overrides}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ let
|
|||||||
listToValue = concatMapStringsSep ", " (generators.mkValueStringDefault { });
|
listToValue = concatMapStringsSep ", " (generators.mkValueStringDefault { });
|
||||||
};
|
};
|
||||||
|
|
||||||
pkg = if isNull cfg.package then
|
pkg = if cfg.package == null then
|
||||||
pkgs.radicale
|
pkgs.radicale
|
||||||
else
|
else
|
||||||
cfg.package;
|
cfg.package;
|
||||||
@@ -117,13 +117,13 @@ in {
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
warnings = optional (isNull cfg.package && versionOlder config.system.stateVersion "17.09") ''
|
warnings = optional (cfg.package == null && versionOlder config.system.stateVersion "17.09") ''
|
||||||
The configuration and storage formats of your existing Radicale
|
The configuration and storage formats of your existing Radicale
|
||||||
installation might be incompatible with the newest version.
|
installation might be incompatible with the newest version.
|
||||||
For upgrade instructions see
|
For upgrade instructions see
|
||||||
https://radicale.org/2.1.html#documentation/migration-from-1xx-to-2xx.
|
https://radicale.org/2.1.html#documentation/migration-from-1xx-to-2xx.
|
||||||
Set services.radicale.package to suppress this warning.
|
Set services.radicale.package to suppress this warning.
|
||||||
'' ++ optional (isNull cfg.package && versionOlder config.system.stateVersion "20.09") ''
|
'' ++ optional (cfg.package == null && versionOlder config.system.stateVersion "20.09") ''
|
||||||
The configuration format of your existing Radicale installation might be
|
The configuration format of your existing Radicale installation might be
|
||||||
incompatible with the newest version. For upgrade instructions see
|
incompatible with the newest version. For upgrade instructions see
|
||||||
https://github.com/Kozea/Radicale/blob/3.0.6/NEWS.md#upgrade-checklist.
|
https://github.com/Kozea/Radicale/blob/3.0.6/NEWS.md#upgrade-checklist.
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ in
|
|||||||
|
|
||||||
requires = lib.mkIf (!(isPathType cfg.repository)) [ "network-online.target" ];
|
requires = lib.mkIf (!(isPathType cfg.repository)) [ "network-online.target" ];
|
||||||
|
|
||||||
environment.GIT_SSH_COMMAND = lib.mkIf (!(isNull cfg.sshKeyFile))
|
environment.GIT_SSH_COMMAND = lib.mkIf (cfg.sshKeyFile != null)
|
||||||
"${pkgs.openssh}/bin/ssh -i ${lib.escapeShellArg cfg.sshKeyFile}";
|
"${pkgs.openssh}/bin/ssh -i ${lib.escapeShellArg cfg.sshKeyFile}";
|
||||||
|
|
||||||
restartIfChanged = false;
|
restartIfChanged = false;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ let
|
|||||||
if (any (str: k == str) secretKeys) then v
|
if (any (str: k == str) secretKeys) then v
|
||||||
else if isString v then "'${v}'"
|
else if isString v then "'${v}'"
|
||||||
else if isBool v then boolToString v
|
else if isBool v then boolToString v
|
||||||
else if isNull v then "null"
|
else if v == null then "null"
|
||||||
else toString v
|
else toString v
|
||||||
;
|
;
|
||||||
in
|
in
|
||||||
|
|||||||
@@ -10,12 +10,11 @@ let
|
|||||||
format = pkgs.formats.ini {
|
format = pkgs.formats.ini {
|
||||||
mkKeyValue = key: value:
|
mkKeyValue = key: value:
|
||||||
let
|
let
|
||||||
value' = if builtins.isNull value then
|
value' = lib.optionalString (value != null)
|
||||||
""
|
(if builtins.isBool value then
|
||||||
else if builtins.isBool value then
|
|
||||||
if value == true then "true" else "false"
|
if value == true then "true" else "false"
|
||||||
else
|
else
|
||||||
toString value;
|
toString value);
|
||||||
in "${key} = ${value'}";
|
in "${key} = ${value'}";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -73,28 +73,28 @@ in {
|
|||||||
error = sourceArgs.error or args.error or null;
|
error = sourceArgs.error or args.error or null;
|
||||||
hasSource = lib.hasAttr variant args;
|
hasSource = lib.hasAttr variant args;
|
||||||
pname = builtins.replaceStrings [ "@" ] [ "at" ] ename;
|
pname = builtins.replaceStrings [ "@" ] [ "at" ] ename;
|
||||||
broken = ! isNull error;
|
broken = error != null;
|
||||||
in
|
in
|
||||||
if hasSource then
|
if hasSource then
|
||||||
lib.nameValuePair ename (
|
lib.nameValuePair ename (
|
||||||
self.callPackage ({ melpaBuild, fetchurl, ... }@pkgargs:
|
self.callPackage ({ melpaBuild, fetchurl, ... }@pkgargs:
|
||||||
melpaBuild {
|
melpaBuild {
|
||||||
inherit pname ename commit;
|
inherit pname ename commit;
|
||||||
version = if isNull version then "" else
|
version = lib.optionalString (version != null)
|
||||||
lib.concatStringsSep "." (map toString
|
(lib.concatStringsSep "." (map toString
|
||||||
# Hack: Melpa archives contains versions with parse errors such as [ 4 4 -4 413 ] which should be 4.4-413
|
# Hack: Melpa archives contains versions with parse errors such as [ 4 4 -4 413 ] which should be 4.4-413
|
||||||
# This filter method is still technically wrong, but it's computationally cheap enough and tapers over the issue
|
# This filter method is still technically wrong, but it's computationally cheap enough and tapers over the issue
|
||||||
(builtins.filter (n: n >= 0) version));
|
(builtins.filter (n: n >= 0) version)));
|
||||||
# TODO: Broken should not result in src being null (hack to avoid eval errors)
|
# TODO: Broken should not result in src being null (hack to avoid eval errors)
|
||||||
src = if (isNull sha256 || broken) then null else
|
src = if (sha256 == null || broken) then null else
|
||||||
lib.getAttr fetcher (fetcherGenerators args sourceArgs);
|
lib.getAttr fetcher (fetcherGenerators args sourceArgs);
|
||||||
recipe = if isNull commit then null else
|
recipe = if commit == null then null else
|
||||||
fetchurl {
|
fetchurl {
|
||||||
name = pname + "-recipe";
|
name = pname + "-recipe";
|
||||||
url = "https://raw.githubusercontent.com/melpa/melpa/${commit}/recipes/${ename}";
|
url = "https://raw.githubusercontent.com/melpa/melpa/${commit}/recipes/${ename}";
|
||||||
inherit sha256;
|
inherit sha256;
|
||||||
};
|
};
|
||||||
packageRequires = lib.optionals (! isNull deps)
|
packageRequires = lib.optionals (deps != null)
|
||||||
(map (dep: pkgargs.${dep} or self.${dep} or null)
|
(map (dep: pkgargs.${dep} or self.${dep} or null)
|
||||||
deps);
|
deps);
|
||||||
meta = (sourceArgs.meta or {}) // {
|
meta = (sourceArgs.meta or {}) // {
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ let
|
|||||||
substituteInPlace plugins/micromega/sos.ml --replace "; csdp" "; ${csdp}/bin/csdp"
|
substituteInPlace plugins/micromega/sos.ml --replace "; csdp" "; ${csdp}/bin/csdp"
|
||||||
substituteInPlace plugins/micromega/coq_micromega.ml --replace "System.is_in_system_path \"csdp\"" "true"
|
substituteInPlace plugins/micromega/coq_micromega.ml --replace "System.is_in_system_path \"csdp\"" "true"
|
||||||
'';
|
'';
|
||||||
ocamlPackages = if !isNull customOCamlPackages then customOCamlPackages
|
ocamlPackages = if customOCamlPackages != null then customOCamlPackages
|
||||||
else with versions; switch coq-version [
|
else with versions; switch coq-version [
|
||||||
{ case = range "8.16" "8.17"; out = ocamlPackages_4_14; }
|
{ case = range "8.16" "8.17"; out = ocamlPackages_4_14; }
|
||||||
{ case = range "8.14" "8.15"; out = ocamlPackages_4_12; }
|
{ case = range "8.14" "8.15"; out = ocamlPackages_4_12; }
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ in
|
|||||||
|
|
||||||
let
|
let
|
||||||
defaultPathOriginal = "/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin";
|
defaultPathOriginal = "/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin";
|
||||||
privileged-un-utils = if ((isNull newuidmapPath) && (isNull newgidmapPath)) then null else
|
privileged-un-utils = if ((newuidmapPath == null) && (newgidmapPath == null)) then null else
|
||||||
(runCommandLocal "privileged-un-utils" { } ''
|
(runCommandLocal "privileged-un-utils" { } ''
|
||||||
mkdir -p "$out/bin"
|
mkdir -p "$out/bin"
|
||||||
ln -s ${lib.escapeShellArg newuidmapPath} "$out/bin/newuidmap"
|
ln -s ${lib.escapeShellArg newuidmapPath} "$out/bin/newuidmap"
|
||||||
@@ -212,10 +212,10 @@ buildGoModule {
|
|||||||
rm "$file"
|
rm "$file"
|
||||||
done
|
done
|
||||||
''}
|
''}
|
||||||
${lib.optionalString enableSuid (lib.warnIf (isNull starterSuidPath) "${projectName}: Null starterSuidPath when enableSuid produces non-SUID-ed starter-suid and run-time permission denial." ''
|
${lib.optionalString enableSuid (lib.warnIf (starterSuidPath == null) "${projectName}: Null starterSuidPath when enableSuid produces non-SUID-ed starter-suid and run-time permission denial." ''
|
||||||
chmod +x $out/libexec/${projectName}/bin/starter-suid
|
chmod +x $out/libexec/${projectName}/bin/starter-suid
|
||||||
'')}
|
'')}
|
||||||
${lib.optionalString (enableSuid && !isNull starterSuidPath) ''
|
${lib.optionalString (enableSuid && (starterSuidPath != null)) ''
|
||||||
mv "$out"/libexec/${projectName}/bin/starter-suid{,.orig}
|
mv "$out"/libexec/${projectName}/bin/starter-suid{,.orig}
|
||||||
ln -s ${lib.escapeShellArg starterSuidPath} "$out/libexec/${projectName}/bin/starter-suid"
|
ln -s ${lib.escapeShellArg starterSuidPath} "$out/libexec/${projectName}/bin/starter-suid"
|
||||||
''}
|
''}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ let
|
|||||||
inherit release releaseRev;
|
inherit release releaseRev;
|
||||||
location = { inherit domain owner repo; };
|
location = { inherit domain owner repo; };
|
||||||
} // optionalAttrs (args?fetcher) {inherit fetcher;});
|
} // optionalAttrs (args?fetcher) {inherit fetcher;});
|
||||||
fetched = fetch (if !isNull version then version else defaultVersion);
|
fetched = fetch (if version != null then version else defaultVersion);
|
||||||
display-pkg = n: sep: v:
|
display-pkg = n: sep: v:
|
||||||
let d = displayVersion.${n} or (if sep == "" then ".." else true); in
|
let d = displayVersion.${n} or (if sep == "" then ".." else true); in
|
||||||
n + optionalString (v != "" && v != null) (switch d [
|
n + optionalString (v != "" && v != null) (switch d [
|
||||||
|
|||||||
@@ -8,13 +8,13 @@ let
|
|||||||
fmt = if args?sha256 then "zip" else "tarball";
|
fmt = if args?sha256 then "zip" else "tarball";
|
||||||
pr = match "^#(.*)$" rev;
|
pr = match "^#(.*)$" rev;
|
||||||
url = switch-if [
|
url = switch-if [
|
||||||
{ cond = isNull pr && !isNull (match "^github.*" domain);
|
{ cond = pr == null && (match "^github.*" domain) != null;
|
||||||
out = "https://${domain}/${owner}/${repo}/archive/${rev}.${ext}"; }
|
out = "https://${domain}/${owner}/${repo}/archive/${rev}.${ext}"; }
|
||||||
{ cond = !isNull pr && !isNull (match "^github.*" domain);
|
{ cond = pr != null && (match "^github.*" domain) != null;
|
||||||
out = "https://api.${domain}/repos/${owner}/${repo}/${fmt}/pull/${head pr}/head"; }
|
out = "https://api.${domain}/repos/${owner}/${repo}/${fmt}/pull/${head pr}/head"; }
|
||||||
{ cond = isNull pr && !isNull (match "^gitlab.*" domain);
|
{ cond = pr == null && (match "^gitlab.*" domain) != null;
|
||||||
out = "https://${domain}/${owner}/${repo}/-/archive/${rev}/${repo}-${rev}.${ext}"; }
|
out = "https://${domain}/${owner}/${repo}/-/archive/${rev}/${repo}-${rev}.${ext}"; }
|
||||||
{ cond = !isNull (match "(www.)?mpi-sws.org" domain);
|
{ cond = (match "(www.)?mpi-sws.org" domain) != null;
|
||||||
out = "https://www.mpi-sws.org/~${owner}/${repo}/download/${repo}-${rev}.${ext}";}
|
out = "https://www.mpi-sws.org/~${owner}/${repo}/download/${repo}-${rev}.${ext}";}
|
||||||
] (throw "meta-fetch: no fetcher found for domain ${domain} on ${rev}");
|
] (throw "meta-fetch: no fetcher found for domain ${domain} on ${rev}");
|
||||||
fetch = x: if args?sha256 then fetchzip (x // { inherit sha256; }) else fetchTarball x;
|
fetch = x: if args?sha256 then fetchzip (x // { inherit sha256; }) else fetchTarball x;
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ let
|
|||||||
renderSection = sectionName: attrs:
|
renderSection = sectionName: attrs:
|
||||||
lib.pipe attrs [
|
lib.pipe attrs [
|
||||||
(lib.mapAttrsToList renderLine)
|
(lib.mapAttrsToList renderLine)
|
||||||
(builtins.filter (v: !isNull v))
|
(builtins.filter (v: v != null))
|
||||||
(builtins.concatStringsSep "\n")
|
(builtins.concatStringsSep "\n")
|
||||||
(section: ''
|
(section: ''
|
||||||
[${sectionName}]
|
[${sectionName}]
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ rec {
|
|||||||
runHook preInstall
|
runHook preInstall
|
||||||
bash install.sh -d $out/share/themes -t all \
|
bash install.sh -d $out/share/themes -t all \
|
||||||
${lib.optionalString (tweaks != []) "--tweaks " + builtins.toString tweaks} \
|
${lib.optionalString (tweaks != []) "--tweaks " + builtins.toString tweaks} \
|
||||||
${lib.optionalString (!isNull border-radius) ("--round " + builtins.toString border-radius + "px")}
|
${lib.optionalString (border-radius != null) ("--round " + builtins.toString border-radius + "px")}
|
||||||
${lib.optionalString withWallpapers ''
|
${lib.optionalString withWallpapers ''
|
||||||
mkdir -p $out/share/backgrounds
|
mkdir -p $out/share/backgrounds
|
||||||
cp src/wallpaper/{1080p,2k,4k}.jpg $out/share/backgrounds
|
cp src/wallpaper/{1080p,2k,4k}.jpg $out/share/backgrounds
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ stdenv.mkDerivation (attrs // {
|
|||||||
depsBuildBuild = [ nim_builder ] ++ depsBuildBuild;
|
depsBuildBuild = [ nim_builder ] ++ depsBuildBuild;
|
||||||
nativeBuildInputs = [ nim ] ++ nativeBuildInputs;
|
nativeBuildInputs = [ nim ] ++ nativeBuildInputs;
|
||||||
|
|
||||||
configurePhase = if isNull configurePhase then ''
|
configurePhase = if (configurePhase == null) then ''
|
||||||
runHook preConfigure
|
runHook preConfigure
|
||||||
export NIX_NIM_BUILD_INPUTS=''${pkgsHostTarget[@]} $NIX_NIM_BUILD_INPUTS
|
export NIX_NIM_BUILD_INPUTS=''${pkgsHostTarget[@]} $NIX_NIM_BUILD_INPUTS
|
||||||
nim_builder --phase:configure
|
nim_builder --phase:configure
|
||||||
@@ -17,21 +17,21 @@ stdenv.mkDerivation (attrs // {
|
|||||||
'' else
|
'' else
|
||||||
configurePhase;
|
configurePhase;
|
||||||
|
|
||||||
buildPhase = if isNull buildPhase then ''
|
buildPhase = if (buildPhase == null) then ''
|
||||||
runHook preBuild
|
runHook preBuild
|
||||||
nim_builder --phase:build
|
nim_builder --phase:build
|
||||||
runHook postBuild
|
runHook postBuild
|
||||||
'' else
|
'' else
|
||||||
buildPhase;
|
buildPhase;
|
||||||
|
|
||||||
checkPhase = if isNull checkPhase then ''
|
checkPhase = if (checkPhase == null) then ''
|
||||||
runHook preCheck
|
runHook preCheck
|
||||||
nim_builder --phase:check
|
nim_builder --phase:check
|
||||||
runHook postCheck
|
runHook postCheck
|
||||||
'' else
|
'' else
|
||||||
checkPhase;
|
checkPhase;
|
||||||
|
|
||||||
installPhase = if isNull installPhase then ''
|
installPhase = if (installPhase == null) then ''
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
nim_builder --phase:install
|
nim_builder --phase:install
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ buildPythonPackage rec {
|
|||||||
cffi
|
cffi
|
||||||
] ++ lib.optionals gurobiSupport ([
|
] ++ lib.optionals gurobiSupport ([
|
||||||
gurobipy
|
gurobipy
|
||||||
] ++ lib.optional (builtins.isNull gurobiHome) gurobi);
|
] ++ lib.optional (gurobiHome == null) gurobi);
|
||||||
|
|
||||||
# Source files have CRLF terminators, which make patch error out when supplied
|
# Source files have CRLF terminators, which make patch error out when supplied
|
||||||
# with diffs made on *nix machines
|
# with diffs made on *nix machines
|
||||||
@@ -58,7 +58,7 @@ buildPythonPackage rec {
|
|||||||
|
|
||||||
# Make MIP use the Gurobi solver, if configured to do so
|
# Make MIP use the Gurobi solver, if configured to do so
|
||||||
makeWrapperArgs = lib.optional gurobiSupport
|
makeWrapperArgs = lib.optional gurobiSupport
|
||||||
"--set GUROBI_HOME ${if builtins.isNull gurobiHome then gurobi.outPath else gurobiHome}";
|
"--set GUROBI_HOME ${if gurobiHome == null then gurobi.outPath else gurobiHome}";
|
||||||
|
|
||||||
# Tests that rely on Gurobi are activated only when Gurobi support is enabled
|
# Tests that rely on Gurobi are activated only when Gurobi support is enabled
|
||||||
disabledTests = lib.optional (!gurobiSupport) "gurobi";
|
disabledTests = lib.optional (!gurobiSupport) "gurobi";
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
wafToolsArg = with lib.strings;
|
wafToolsArg = with lib.strings;
|
||||||
optionalString (!isNull withTools) " --tools=\"${concatStringsSep "," withTools}\"";
|
optionalString (withTools != null) " --tools=\"${concatStringsSep "," withTools}\"";
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "waf";
|
pname = "waf";
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ let
|
|||||||
{
|
{
|
||||||
nativeBuildInputs =
|
nativeBuildInputs =
|
||||||
(old.nativeBuildInputs or [ ])
|
(old.nativeBuildInputs or [ ])
|
||||||
++ lib.optionals (!(builtins.isNull buildSystem)) [ buildSystem ]
|
++ lib.optionals (buildSystem != null) [ buildSystem ]
|
||||||
++ map (a: self.${a}) extraAttrs;
|
++ map (a: self.${a}) extraAttrs;
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ let
|
|||||||
pkgs' = lib.mapAttrs (_: mods: lib.filterAttrs isAvailable mods) pkgs;
|
pkgs' = lib.mapAttrs (_: mods: lib.filterAttrs isAvailable mods) pkgs;
|
||||||
|
|
||||||
isAvailable = _: mod:
|
isAvailable = _: mod:
|
||||||
if isNull build then
|
if (build == null) then
|
||||||
true
|
true
|
||||||
else if build.isTiles then
|
else if build.isTiles then
|
||||||
mod.forTiles or false
|
mod.forTiles or false
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
|
|||||||
SDL
|
SDL
|
||||||
];
|
];
|
||||||
|
|
||||||
makeFlags = (if isNull SDL then [] else [ "SDL=yes" ]) ++ [
|
makeFlags = (lib.optionals (SDL != null) [ "SDL=yes" ]) ++ [
|
||||||
"PREFIX=$(out)"
|
"PREFIX=$(out)"
|
||||||
# force platform's cc on darwin, otherwise gcc is used
|
# force platform's cc on darwin, otherwise gcc is used
|
||||||
"CC=${stdenv.cc.targetPrefix}cc"
|
"CC=${stdenv.cc.targetPrefix}cc"
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ let
|
|||||||
else "core";
|
else "core";
|
||||||
|
|
||||||
targetArch =
|
targetArch =
|
||||||
if isNull targetArchitecture
|
if targetArchitecture == null
|
||||||
then defaultTargetArchitecture
|
then defaultTargetArchitecture
|
||||||
else targetArchitecture;
|
else targetArchitecture;
|
||||||
in
|
in
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ let
|
|||||||
|
|
||||||
checkDependencyList = checkDependencyList' [];
|
checkDependencyList = checkDependencyList' [];
|
||||||
checkDependencyList' = positions: name: deps: lib.flip lib.imap1 deps (index: dep:
|
checkDependencyList' = positions: name: deps: lib.flip lib.imap1 deps (index: dep:
|
||||||
if lib.isDerivation dep || isNull dep || builtins.typeOf dep == "string" || builtins.typeOf dep == "path" then dep
|
if lib.isDerivation dep || dep == null || builtins.typeOf dep == "string" || builtins.typeOf dep == "path" then dep
|
||||||
else if lib.isList dep then checkDependencyList' ([index] ++ positions) name dep
|
else if lib.isList dep then checkDependencyList' ([index] ++ positions) name dep
|
||||||
else throw "Dependency is not of a valid type: ${lib.concatMapStrings (ix: "element ${toString ix} of ") ([index] ++ positions)}${name} for ${attrs.name or attrs.pname}");
|
else throw "Dependency is not of a valid type: ${lib.concatMapStrings (ix: "element ${toString ix} of ") ([index] ++ positions)}${name} for ${attrs.name or attrs.pname}");
|
||||||
in if builtins.length erroneousHardeningFlags != 0
|
in if builtins.length erroneousHardeningFlags != 0
|
||||||
|
|||||||
@@ -20,14 +20,14 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
cmake
|
cmake
|
||||||
] ++ lib.optionals (!isNull python) [
|
] ++ lib.optionals (python != null) [
|
||||||
python
|
python
|
||||||
swig
|
swig
|
||||||
];
|
];
|
||||||
|
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
"-DPLFIT_USE_OPENMP=ON"
|
"-DPLFIT_USE_OPENMP=ON"
|
||||||
] ++ lib.optionals (!isNull python) [
|
] ++ lib.optionals (python != null) [
|
||||||
"-DPLFIT_COMPILE_PYTHON_MODULE=ON"
|
"-DPLFIT_COMPILE_PYTHON_MODULE=ON"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
let
|
let
|
||||||
buildExtension = lib.makeOverridable
|
buildExtension = lib.makeOverridable
|
||||||
({ name, gawkextlib, extraBuildInputs ? [ ], doCheck ? true }:
|
({ name, gawkextlib, extraBuildInputs ? [ ], doCheck ? true }:
|
||||||
let is_extension = !isNull gawkextlib;
|
let is_extension = gawkextlib != null;
|
||||||
in stdenv.mkDerivation rec {
|
in stdenv.mkDerivation rec {
|
||||||
pname = "gawkextlib-${name}";
|
pname = "gawkextlib-${name}";
|
||||||
version = "unstable-2019-11-21";
|
version = "unstable-2019-11-21";
|
||||||
|
|||||||
Reference in New Issue
Block a user