Merge pull request #219747 from Stunkymonkey/deprecate-isNull

Changed files
+62 -63
lib
maintainers
scripts
nixos
modules
hardware
security
services
cluster
kubernetes
hardware
home-automation
networking
system
web-apps
pkgs
applications
editors
emacs
elisp-packages
science
logic
virtualization
singularity
build-support
coq
make-desktopitem
data
themes
orchis-theme
development
nim-packages
build-nim-package
python-modules
tools
build-managers
poetry2nix
poetry2nix
overrides
games
cataclysm-dda
curseofwar
servers
nosql
arangodb
stdenv
tools
misc
plfit
text
+1 -1
lib/generators.nix
···
(if v then "True" else "False")
else if isFunction v then
abort "generators.toDhall: cannot convert a function to Dhall"
-
else if isNull v then
abort "generators.toDhall: cannot convert a null to Dhall"
else
builtins.toJSON v;
···
(if v then "True" else "False")
else if isFunction v then
abort "generators.toDhall: cannot convert a function to Dhall"
+
else if v == null then
abort "generators.toDhall: cannot convert a null to Dhall"
else
builtins.toJSON v;
+1 -1
maintainers/scripts/haskell/dependencies.nix
···
pkgs = import ../../.. {};
inherit (pkgs) lib;
getDeps = _: pkg: {
-
deps = builtins.filter (x: !isNull x) (map (x: x.pname or null) (pkg.propagatedBuildInputs or []));
broken = (pkg.meta.hydraPlatforms or [null]) == [];
};
in
···
pkgs = import ../../.. {};
inherit (pkgs) lib;
getDeps = _: pkg: {
+
deps = builtins.filter (x: x != null) (map (x: x.pname or null) (pkg.propagatedBuildInputs or []));
broken = (pkg.meta.hydraPlatforms or [null]) == [];
};
in
+4 -4
nixos/modules/hardware/device-tree.nix
···
};
};
-
filterDTBs = src: if isNull cfg.filter
then "${src}/dtbs"
else
pkgs.runCommand "dtbs-filtered" {} ''
···
# Fill in `dtboFile` for each overlay if not set already.
# Existence of one of these is guarded by assertion below
withDTBOs = xs: flip map xs (o: o // { dtboFile =
-
if isNull o.dtboFile then
-
if !isNull o.dtsFile then compileDTS o.name o.dtsFile
else compileDTS o.name (pkgs.writeText "dts" o.dtsText)
else o.dtboFile; } );
···
config = mkIf (cfg.enable) {
assertions = let
-
invalidOverlay = o: isNull o.dtsFile && isNull o.dtsText && isNull o.dtboFile;
in lib.singleton {
assertion = lib.all (o: !invalidOverlay o) cfg.overlays;
message = ''
···
};
};
+
filterDTBs = src: if cfg.filter == null
then "${src}/dtbs"
else
pkgs.runCommand "dtbs-filtered" {} ''
···
# Fill in `dtboFile` for each overlay if not set already.
# Existence of one of these is guarded by assertion below
withDTBOs = xs: flip map xs (o: o // { dtboFile =
+
if o.dtboFile == null then
+
if o.dtsFile != null then compileDTS o.name o.dtsFile
else compileDTS o.name (pkgs.writeText "dts" o.dtsText)
else o.dtboFile; } );
···
config = mkIf (cfg.enable) {
assertions = let
+
invalidOverlay = o: (o.dtsFile == null) && (o.dtsText == null) && (o.dtboFile == null);
in lib.singleton {
assertion = lib.all (o: !invalidOverlay o) cfg.overlays;
message = ''
+3 -3
nixos/modules/security/doas.nix
···
];
mkArgs = rule:
-
if (isNull rule.args) then ""
else if (length rule.args == 0) then "args"
else "args ${concatStringsSep " " rule.args}";
···
let
opts = mkOpts rule;
-
as = optionalString (!isNull rule.runAs) "as ${rule.runAs}";
-
cmd = optionalString (!isNull rule.cmd) "cmd ${rule.cmd}";
args = mkArgs rule;
in
···
];
mkArgs = rule:
+
if (rule.args == null) then ""
else if (length rule.args == 0) then "args"
else "args ${concatStringsSep " " rule.args}";
···
let
opts = mkOpts rule;
+
as = optionalString (rule.runAs != null) "as ${rule.runAs}";
+
cmd = optionalString (rule.cmd != null) "cmd ${rule.cmd}";
args = mkArgs rule;
in
+2 -2
nixos/modules/security/pam.nix
···
};
}));
-
motd = if isNull config.users.motdFile
then pkgs.writeText "motd" config.users.motd
else config.users.motdFile;
···
config = {
assertions = [
{
-
assertion = isNull config.users.motd || isNull config.users.motdFile;
message = ''
Only one of users.motd and users.motdFile can be set.
'';
···
};
}));
+
motd = if config.users.motdFile == null
then pkgs.writeText "motd" config.users.motd
else config.users.motdFile;
···
config = {
assertions = [
{
+
assertion = config.users.motd == null || config.users.motdFile == null;
message = ''
Only one of users.motd and users.motdFile can be set.
'';
+1 -1
nixos/modules/services/cluster/kubernetes/pki.nix
···
'';
})]);
-
environment.etc.${cfg.etcClusterAdminKubeconfig}.source = mkIf (!isNull cfg.etcClusterAdminKubeconfig)
clusterAdminKubeconfig;
environment.systemPackages = mkIf (top.kubelet.enable || top.proxy.enable) [
···
'';
})]);
+
environment.etc.${cfg.etcClusterAdminKubeconfig}.source = mkIf (cfg.etcClusterAdminKubeconfig != null)
clusterAdminKubeconfig;
environment.systemPackages = mkIf (top.kubelet.enable || top.proxy.enable) [
+2 -2
nixos/modules/services/hardware/undervolt.nix
···
cfg = config.services.undervolt;
mkPLimit = limit: window:
-
if (isNull limit && isNull window) then null
-
else assert asserts.assertMsg (!isNull limit && !isNull window) "Both power limit and window must be set";
"${toString limit} ${toString window}";
cliArgs = lib.cli.toGNUCommandLine {} {
inherit (cfg)
···
cfg = config.services.undervolt;
mkPLimit = limit: window:
+
if (limit == null && window == null) then null
+
else assert asserts.assertMsg (limit != null && window != null) "Both power limit and window must be set";
"${toString limit} ${toString window}";
cliArgs = lib.cli.toGNUCommandLine {} {
inherit (cfg)
+1 -1
nixos/modules/services/home-automation/home-assistant.nix
···
config = mkIf cfg.enable {
assertions = [
{
-
assertion = cfg.openFirewall -> !isNull cfg.config;
message = "openFirewall can only be used with a declarative config";
}
];
···
config = mkIf cfg.enable {
assertions = [
{
+
assertion = cfg.openFirewall -> cfg.config != null;
message = "openFirewall can only be used with a declarative config";
}
];
+4 -4
nixos/modules/services/networking/multipath.nix
···
${indentLines 2 devices}
}
-
${optionalString (!isNull defaults) ''
defaults {
${indentLines 2 defaults}
}
''}
-
${optionalString (!isNull blacklist) ''
blacklist {
${indentLines 2 blacklist}
}
''}
-
${optionalString (!isNull blacklist_exceptions) ''
blacklist_exceptions {
${indentLines 2 blacklist_exceptions}
}
''}
-
${optionalString (!isNull overrides) ''
overrides {
${indentLines 2 overrides}
}
···
${indentLines 2 devices}
}
+
${optionalString (defaults != null) ''
defaults {
${indentLines 2 defaults}
}
''}
+
${optionalString (blacklist != null) ''
blacklist {
${indentLines 2 blacklist}
}
''}
+
${optionalString (blacklist_exceptions != null) ''
blacklist_exceptions {
${indentLines 2 blacklist_exceptions}
}
''}
+
${optionalString (overrides != null) ''
overrides {
${indentLines 2 overrides}
}
+3 -3
nixos/modules/services/networking/radicale.nix
···
listToValue = concatMapStringsSep ", " (generators.mkValueStringDefault { });
};
-
pkg = if isNull cfg.package then
pkgs.radicale
else
cfg.package;
···
}
];
-
warnings = optional (isNull cfg.package && versionOlder config.system.stateVersion "17.09") ''
The configuration and storage formats of your existing Radicale
installation might be incompatible with the newest version.
For upgrade instructions see
https://radicale.org/2.1.html#documentation/migration-from-1xx-to-2xx.
Set services.radicale.package to suppress this warning.
-
'' ++ optional (isNull cfg.package && versionOlder config.system.stateVersion "20.09") ''
The configuration format of your existing Radicale installation might be
incompatible with the newest version. For upgrade instructions see
https://github.com/Kozea/Radicale/blob/3.0.6/NEWS.md#upgrade-checklist.
···
listToValue = concatMapStringsSep ", " (generators.mkValueStringDefault { });
};
+
pkg = if cfg.package == null then
pkgs.radicale
else
cfg.package;
···
}
];
+
warnings = optional (cfg.package == null && versionOlder config.system.stateVersion "17.09") ''
The configuration and storage formats of your existing Radicale
installation might be incompatible with the newest version.
For upgrade instructions see
https://radicale.org/2.1.html#documentation/migration-from-1xx-to-2xx.
Set services.radicale.package to suppress this warning.
+
'' ++ optional (cfg.package == null && versionOlder config.system.stateVersion "20.09") ''
The configuration format of your existing Radicale installation might be
incompatible with the newest version. For upgrade instructions see
https://github.com/Kozea/Radicale/blob/3.0.6/NEWS.md#upgrade-checklist.
+1 -1
nixos/modules/services/system/self-deploy.nix
···
requires = lib.mkIf (!(isPathType cfg.repository)) [ "network-online.target" ];
-
environment.GIT_SSH_COMMAND = lib.mkIf (!(isNull cfg.sshKeyFile))
"${pkgs.openssh}/bin/ssh -i ${lib.escapeShellArg cfg.sshKeyFile}";
restartIfChanged = false;
···
requires = lib.mkIf (!(isPathType cfg.repository)) [ "network-online.target" ];
+
environment.GIT_SSH_COMMAND = lib.mkIf (cfg.sshKeyFile != null)
"${pkgs.openssh}/bin/ssh -i ${lib.escapeShellArg cfg.sshKeyFile}";
restartIfChanged = false;
+1 -1
nixos/modules/services/web-apps/dolibarr.nix
···
if (any (str: k == str) secretKeys) then v
else if isString v then "'${v}'"
else if isBool v then boolToString v
-
else if isNull v then "null"
else toString v
;
in
···
if (any (str: k == str) secretKeys) then v
else if isString v then "'${v}'"
else if isBool v then boolToString v
+
else if v == null then "null"
else toString v
;
in
+5 -6
nixos/modules/services/web-apps/writefreely.nix
···
format = pkgs.formats.ini {
mkKeyValue = key: value:
let
-
value' = if builtins.isNull value then
-
""
-
else if builtins.isBool value then
-
if value == true then "true" else "false"
-
else
-
toString value;
in "${key} = ${value'}";
};
···
format = pkgs.formats.ini {
mkKeyValue = key: value:
let
+
value' = lib.optionalString (value != null)
+
(if builtins.isBool value then
+
if value == true then "true" else "false"
+
else
+
toString value);
in "${key} = ${value'}";
};
+7 -7
pkgs/applications/editors/emacs/elisp-packages/libgenerated.nix
···
error = sourceArgs.error or args.error or null;
hasSource = lib.hasAttr variant args;
pname = builtins.replaceStrings [ "@" ] [ "at" ] ename;
-
broken = ! isNull error;
in
if hasSource then
lib.nameValuePair ename (
self.callPackage ({ melpaBuild, fetchurl, ... }@pkgargs:
melpaBuild {
inherit pname ename commit;
-
version = if isNull version then "" else
-
lib.concatStringsSep "." (map toString
# 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
-
(builtins.filter (n: n >= 0) version));
# TODO: Broken should not result in src being null (hack to avoid eval errors)
-
src = if (isNull sha256 || broken) then null else
lib.getAttr fetcher (fetcherGenerators args sourceArgs);
-
recipe = if isNull commit then null else
fetchurl {
name = pname + "-recipe";
url = "https://raw.githubusercontent.com/melpa/melpa/${commit}/recipes/${ename}";
inherit sha256;
};
-
packageRequires = lib.optionals (! isNull deps)
(map (dep: pkgargs.${dep} or self.${dep} or null)
deps);
meta = (sourceArgs.meta or {}) // {
···
error = sourceArgs.error or args.error or null;
hasSource = lib.hasAttr variant args;
pname = builtins.replaceStrings [ "@" ] [ "at" ] ename;
+
broken = error != null;
in
if hasSource then
lib.nameValuePair ename (
self.callPackage ({ melpaBuild, fetchurl, ... }@pkgargs:
melpaBuild {
inherit pname ename commit;
+
version = lib.optionalString (version != null)
+
(lib.concatStringsSep "." (map toString
# 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
+
(builtins.filter (n: n >= 0) version)));
# TODO: Broken should not result in src being null (hack to avoid eval errors)
+
src = if (sha256 == null || broken) then null else
lib.getAttr fetcher (fetcherGenerators args sourceArgs);
+
recipe = if commit == null then null else
fetchurl {
name = pname + "-recipe";
url = "https://raw.githubusercontent.com/melpa/melpa/${commit}/recipes/${ename}";
inherit sha256;
};
+
packageRequires = lib.optionals (deps != null)
(map (dep: pkgargs.${dep} or self.${dep} or null)
deps);
meta = (sourceArgs.meta or {}) // {
+1 -1
pkgs/applications/science/logic/coq/default.nix
···
substituteInPlace plugins/micromega/sos.ml --replace "; csdp" "; ${csdp}/bin/csdp"
substituteInPlace plugins/micromega/coq_micromega.ml --replace "System.is_in_system_path \"csdp\"" "true"
'';
-
ocamlPackages = if !isNull customOCamlPackages then customOCamlPackages
else with versions; switch coq-version [
{ case = range "8.16" "8.17"; out = ocamlPackages_4_14; }
{ case = range "8.14" "8.15"; out = ocamlPackages_4_12; }
···
substituteInPlace plugins/micromega/sos.ml --replace "; csdp" "; ${csdp}/bin/csdp"
substituteInPlace plugins/micromega/coq_micromega.ml --replace "System.is_in_system_path \"csdp\"" "true"
'';
+
ocamlPackages = if customOCamlPackages != null then customOCamlPackages
else with versions; switch coq-version [
{ case = range "8.16" "8.17"; out = ocamlPackages_4_14; }
{ case = range "8.14" "8.15"; out = ocamlPackages_4_12; }
+3 -3
pkgs/applications/virtualization/singularity/generic.nix
···
let
defaultPathOriginal = "/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin";
-
privileged-un-utils = if ((isNull newuidmapPath) && (isNull newgidmapPath)) then null else
(runCommandLocal "privileged-un-utils" { } ''
mkdir -p "$out/bin"
ln -s ${lib.escapeShellArg newuidmapPath} "$out/bin/newuidmap"
···
rm "$file"
done
''}
-
${lib.optionalString enableSuid (lib.warnIf (isNull starterSuidPath) "${projectName}: Null starterSuidPath when enableSuid produces non-SUID-ed starter-suid and run-time permission denial." ''
chmod +x $out/libexec/${projectName}/bin/starter-suid
'')}
-
${lib.optionalString (enableSuid && !isNull starterSuidPath) ''
mv "$out"/libexec/${projectName}/bin/starter-suid{,.orig}
ln -s ${lib.escapeShellArg starterSuidPath} "$out/libexec/${projectName}/bin/starter-suid"
''}
···
let
defaultPathOriginal = "/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin";
+
privileged-un-utils = if ((newuidmapPath == null) && (newgidmapPath == null)) then null else
(runCommandLocal "privileged-un-utils" { } ''
mkdir -p "$out/bin"
ln -s ${lib.escapeShellArg newuidmapPath} "$out/bin/newuidmap"
···
rm "$file"
done
''}
+
${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
'')}
+
${lib.optionalString (enableSuid && (starterSuidPath != null)) ''
mv "$out"/libexec/${projectName}/bin/starter-suid{,.orig}
ln -s ${lib.escapeShellArg starterSuidPath} "$out/libexec/${projectName}/bin/starter-suid"
''}
+1 -1
pkgs/build-support/coq/default.nix
···
inherit release releaseRev;
location = { inherit domain owner repo; };
} // optionalAttrs (args?fetcher) {inherit fetcher;});
-
fetched = fetch (if !isNull version then version else defaultVersion);
display-pkg = n: sep: v:
let d = displayVersion.${n} or (if sep == "" then ".." else true); in
n + optionalString (v != "" && v != null) (switch d [
···
inherit release releaseRev;
location = { inherit domain owner repo; };
} // optionalAttrs (args?fetcher) {inherit fetcher;});
+
fetched = fetch (if version != null then version else defaultVersion);
display-pkg = n: sep: v:
let d = displayVersion.${n} or (if sep == "" then ".." else true); in
n + optionalString (v != "" && v != null) (switch d [
+4 -4
pkgs/build-support/coq/meta-fetch/default.nix
···
fmt = if args?sha256 then "zip" else "tarball";
pr = match "^#(.*)$" rev;
url = switch-if [
-
{ cond = isNull pr && !isNull (match "^github.*" domain);
out = "https://${domain}/${owner}/${repo}/archive/${rev}.${ext}"; }
-
{ cond = !isNull pr && !isNull (match "^github.*" domain);
out = "https://api.${domain}/repos/${owner}/${repo}/${fmt}/pull/${head pr}/head"; }
-
{ cond = isNull pr && !isNull (match "^gitlab.*" domain);
out = "https://${domain}/${owner}/${repo}/-/archive/${rev}/${repo}-${rev}.${ext}"; }
-
{ cond = !isNull (match "(www.)?mpi-sws.org" domain);
out = "https://www.mpi-sws.org/~${owner}/${repo}/download/${repo}-${rev}.${ext}";}
] (throw "meta-fetch: no fetcher found for domain ${domain} on ${rev}");
fetch = x: if args?sha256 then fetchzip (x // { inherit sha256; }) else fetchTarball x;
···
fmt = if args?sha256 then "zip" else "tarball";
pr = match "^#(.*)$" rev;
url = switch-if [
+
{ cond = pr == null && (match "^github.*" domain) != null;
out = "https://${domain}/${owner}/${repo}/archive/${rev}.${ext}"; }
+
{ cond = pr != null && (match "^github.*" domain) != null;
out = "https://api.${domain}/repos/${owner}/${repo}/${fmt}/pull/${head pr}/head"; }
+
{ cond = pr == null && (match "^gitlab.*" domain) != null;
out = "https://${domain}/${owner}/${repo}/-/archive/${rev}/${repo}-${rev}.${ext}"; }
+
{ cond = (match "(www.)?mpi-sws.org" domain) != null;
out = "https://www.mpi-sws.org/~${owner}/${repo}/download/${repo}-${rev}.${ext}";}
] (throw "meta-fetch: no fetcher found for domain ${domain} on ${rev}");
fetch = x: if args?sha256 then fetchzip (x // { inherit sha256; }) else fetchTarball x;
+1 -1
pkgs/build-support/make-desktopitem/default.nix
···
renderSection = sectionName: attrs:
lib.pipe attrs [
(lib.mapAttrsToList renderLine)
-
(builtins.filter (v: !isNull v))
(builtins.concatStringsSep "\n")
(section: ''
[${sectionName}]
···
renderSection = sectionName: attrs:
lib.pipe attrs [
(lib.mapAttrsToList renderLine)
+
(builtins.filter (v: v != null))
(builtins.concatStringsSep "\n")
(section: ''
[${sectionName}]
+1 -1
pkgs/data/themes/orchis-theme/default.nix
···
runHook preInstall
bash install.sh -d $out/share/themes -t all \
${lib.optionalString (tweaks != []) "--tweaks " + builtins.toString tweaks} \
-
${lib.optionalString (!isNull border-radius) ("--round " + builtins.toString border-radius + "px")}
${lib.optionalString withWallpapers ''
mkdir -p $out/share/backgrounds
cp src/wallpaper/{1080p,2k,4k}.jpg $out/share/backgrounds
···
runHook preInstall
bash install.sh -d $out/share/themes -t all \
${lib.optionalString (tweaks != []) "--tweaks " + builtins.toString tweaks} \
+
${lib.optionalString (border-radius != null) ("--round " + builtins.toString border-radius + "px")}
${lib.optionalString withWallpapers ''
mkdir -p $out/share/backgrounds
cp src/wallpaper/{1080p,2k,4k}.jpg $out/share/backgrounds
+4 -4
pkgs/development/nim-packages/build-nim-package/default.nix
···
depsBuildBuild = [ nim_builder ] ++ depsBuildBuild;
nativeBuildInputs = [ nim ] ++ nativeBuildInputs;
-
configurePhase = if isNull configurePhase then ''
runHook preConfigure
export NIX_NIM_BUILD_INPUTS=''${pkgsHostTarget[@]} $NIX_NIM_BUILD_INPUTS
nim_builder --phase:configure
···
'' else
configurePhase;
-
buildPhase = if isNull buildPhase then ''
runHook preBuild
nim_builder --phase:build
runHook postBuild
'' else
buildPhase;
-
checkPhase = if isNull checkPhase then ''
runHook preCheck
nim_builder --phase:check
runHook postCheck
'' else
checkPhase;
-
installPhase = if isNull installPhase then ''
runHook preInstall
nim_builder --phase:install
runHook postInstall
···
depsBuildBuild = [ nim_builder ] ++ depsBuildBuild;
nativeBuildInputs = [ nim ] ++ nativeBuildInputs;
+
configurePhase = if (configurePhase == null) then ''
runHook preConfigure
export NIX_NIM_BUILD_INPUTS=''${pkgsHostTarget[@]} $NIX_NIM_BUILD_INPUTS
nim_builder --phase:configure
···
'' else
configurePhase;
+
buildPhase = if (buildPhase == null) then ''
runHook preBuild
nim_builder --phase:build
runHook postBuild
'' else
buildPhase;
+
checkPhase = if (checkPhase == null) then ''
runHook preCheck
nim_builder --phase:check
runHook postCheck
'' else
checkPhase;
+
installPhase = if (installPhase == null) then ''
runHook preInstall
nim_builder --phase:install
runHook postInstall
+2 -2
pkgs/development/python-modules/mip/default.nix
···
cffi
] ++ lib.optionals gurobiSupport ([
gurobipy
-
] ++ lib.optional (builtins.isNull gurobiHome) gurobi);
# Source files have CRLF terminators, which make patch error out when supplied
# with diffs made on *nix machines
···
# Make MIP use the Gurobi solver, if configured to do so
makeWrapperArgs = lib.optional gurobiSupport
-
"--set GUROBI_HOME ${if builtins.isNull gurobiHome then gurobi.outPath else gurobiHome}";
# Tests that rely on Gurobi are activated only when Gurobi support is enabled
disabledTests = lib.optional (!gurobiSupport) "gurobi";
···
cffi
] ++ lib.optionals gurobiSupport ([
gurobipy
+
] ++ lib.optional (gurobiHome == null) gurobi);
# Source files have CRLF terminators, which make patch error out when supplied
# with diffs made on *nix machines
···
# Make MIP use the Gurobi solver, if configured to do so
makeWrapperArgs = lib.optional gurobiSupport
+
"--set GUROBI_HOME ${if gurobiHome == null then gurobi.outPath else gurobiHome}";
# Tests that rely on Gurobi are activated only when Gurobi support is enabled
disabledTests = lib.optional (!gurobiSupport) "gurobi";
+1 -1
pkgs/development/tools/build-managers/waf/default.nix
···
}:
let
wafToolsArg = with lib.strings;
-
optionalString (!isNull withTools) " --tools=\"${concatStringsSep "," withTools}\"";
in
stdenv.mkDerivation rec {
pname = "waf";
···
}:
let
wafToolsArg = with lib.strings;
+
optionalString (withTools != null) " --tools=\"${concatStringsSep "," withTools}\"";
in
stdenv.mkDerivation rec {
pname = "waf";
+1 -1
pkgs/development/tools/poetry2nix/poetry2nix/overrides/default.nix
···
{
nativeBuildInputs =
(old.nativeBuildInputs or [ ])
-
++ lib.optionals (!(builtins.isNull buildSystem)) [ buildSystem ]
++ map (a: self.${a}) extraAttrs;
}
)
···
{
nativeBuildInputs =
(old.nativeBuildInputs or [ ])
+
++ lib.optionals (buildSystem != null) [ buildSystem ]
++ map (a: self.${a}) extraAttrs;
}
)
+1 -1
pkgs/games/cataclysm-dda/pkgs/default.nix
···
pkgs' = lib.mapAttrs (_: mods: lib.filterAttrs isAvailable mods) pkgs;
isAvailable = _: mod:
-
if isNull build then
true
else if build.isTiles then
mod.forTiles or false
···
pkgs' = lib.mapAttrs (_: mods: lib.filterAttrs isAvailable mods) pkgs;
isAvailable = _: mod:
+
if (build == null) then
true
else if build.isTiles then
mod.forTiles or false
+1 -1
pkgs/games/curseofwar/default.nix
···
SDL
];
-
makeFlags = (if isNull SDL then [] else [ "SDL=yes" ]) ++ [
"PREFIX=$(out)"
# force platform's cc on darwin, otherwise gcc is used
"CC=${stdenv.cc.targetPrefix}cc"
···
SDL
];
+
makeFlags = (lib.optionals (SDL != null) [ "SDL=yes" ]) ++ [
"PREFIX=$(out)"
# force platform's cc on darwin, otherwise gcc is used
"CC=${stdenv.cc.targetPrefix}cc"
+1 -1
pkgs/servers/nosql/arangodb/default.nix
···
else "core";
targetArch =
-
if isNull targetArchitecture
then defaultTargetArchitecture
else targetArchitecture;
in
···
else "core";
targetArch =
+
if targetArchitecture == null
then defaultTargetArchitecture
else targetArchitecture;
in
+1 -1
pkgs/stdenv/generic/make-derivation.nix
···
checkDependencyList = checkDependencyList' [];
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
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}");
in if builtins.length erroneousHardeningFlags != 0
···
checkDependencyList = checkDependencyList' [];
checkDependencyList' = positions: name: deps: lib.flip lib.imap1 deps (index: 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 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
+2 -2
pkgs/tools/misc/plfit/default.nix
···
nativeBuildInputs = [
cmake
-
] ++ lib.optionals (!isNull python) [
python
swig
];
cmakeFlags = [
"-DPLFIT_USE_OPENMP=ON"
-
] ++ lib.optionals (!isNull python) [
"-DPLFIT_COMPILE_PYTHON_MODULE=ON"
];
···
nativeBuildInputs = [
cmake
+
] ++ lib.optionals (python != null) [
python
swig
];
cmakeFlags = [
"-DPLFIT_USE_OPENMP=ON"
+
] ++ lib.optionals (python != null) [
"-DPLFIT_COMPILE_PYTHON_MODULE=ON"
];
+1 -1
pkgs/tools/text/gawk/gawkextlib.nix
···
let
buildExtension = lib.makeOverridable
({ name, gawkextlib, extraBuildInputs ? [ ], doCheck ? true }:
-
let is_extension = !isNull gawkextlib;
in stdenv.mkDerivation rec {
pname = "gawkextlib-${name}";
version = "unstable-2019-11-21";
···
let
buildExtension = lib.makeOverridable
({ name, gawkextlib, extraBuildInputs ? [ ], doCheck ? true }:
+
let is_extension = gawkextlib != null;
in stdenv.mkDerivation rec {
pname = "gawkextlib-${name}";
version = "unstable-2019-11-21";