treewide: deprecate isNull

https://nixos.org/manual/nix/stable/language/builtins.html#builtins-isNull

+62 -63
+1 -1
lib/generators.nix
··· 422 (if v then "True" else "False") 423 else if isFunction v then 424 abort "generators.toDhall: cannot convert a function to Dhall" 425 - else if isNull v then 426 abort "generators.toDhall: cannot convert a null to Dhall" 427 else 428 builtins.toJSON v;
··· 422 (if v then "True" else "False") 423 else if isFunction v then 424 abort "generators.toDhall: cannot convert a function to Dhall" 425 + else if v == null then 426 abort "generators.toDhall: cannot convert a null to Dhall" 427 else 428 builtins.toJSON v;
+1 -1
maintainers/scripts/haskell/dependencies.nix
··· 3 pkgs = import ../../.. {}; 4 inherit (pkgs) lib; 5 getDeps = _: pkg: { 6 - deps = builtins.filter (x: !isNull x) (map (x: x.pname or null) (pkg.propagatedBuildInputs or [])); 7 broken = (pkg.meta.hydraPlatforms or [null]) == []; 8 }; 9 in
··· 3 pkgs = import ../../.. {}; 4 inherit (pkgs) lib; 5 getDeps = _: pkg: { 6 + deps = builtins.filter (x: x != null) (map (x: x.pname or null) (pkg.propagatedBuildInputs or [])); 7 broken = (pkg.meta.hydraPlatforms or [null]) == []; 8 }; 9 in
+4 -4
nixos/modules/hardware/device-tree.nix
··· 65 }; 66 }; 67 68 - filterDTBs = src: if isNull cfg.filter 69 then "${src}/dtbs" 70 else 71 pkgs.runCommand "dtbs-filtered" {} '' ··· 93 # Fill in `dtboFile` for each overlay if not set already. 94 # Existence of one of these is guarded by assertion below 95 withDTBOs = xs: flip map xs (o: o // { dtboFile = 96 - if isNull o.dtboFile then 97 - if !isNull o.dtsFile then compileDTS o.name o.dtsFile 98 else compileDTS o.name (pkgs.writeText "dts" o.dtsText) 99 else o.dtboFile; } ); 100 ··· 181 config = mkIf (cfg.enable) { 182 183 assertions = let 184 - invalidOverlay = o: isNull o.dtsFile && isNull o.dtsText && isNull o.dtboFile; 185 in lib.singleton { 186 assertion = lib.all (o: !invalidOverlay o) cfg.overlays; 187 message = ''
··· 65 }; 66 }; 67 68 + filterDTBs = src: if cfg.filter == null 69 then "${src}/dtbs" 70 else 71 pkgs.runCommand "dtbs-filtered" {} '' ··· 93 # Fill in `dtboFile` for each overlay if not set already. 94 # Existence of one of these is guarded by assertion below 95 withDTBOs = xs: flip map xs (o: o // { dtboFile = 96 + if o.dtboFile == null then 97 + if o.dtsFile != null then compileDTS o.name o.dtsFile 98 else compileDTS o.name (pkgs.writeText "dts" o.dtsText) 99 else o.dtboFile; } ); 100 ··· 181 config = mkIf (cfg.enable) { 182 183 assertions = let 184 + invalidOverlay = o: (o.dtsFile == null) && (o.dtsText == null) && (o.dtboFile == null); 185 in lib.singleton { 186 assertion = lib.all (o: !invalidOverlay o) cfg.overlays; 187 message = ''
+3 -3
nixos/modules/security/doas.nix
··· 19 ]; 20 21 mkArgs = rule: 22 - if (isNull rule.args) then "" 23 else if (length rule.args == 0) then "args" 24 else "args ${concatStringsSep " " rule.args}"; 25 ··· 27 let 28 opts = mkOpts rule; 29 30 - as = optionalString (!isNull rule.runAs) "as ${rule.runAs}"; 31 32 - cmd = optionalString (!isNull rule.cmd) "cmd ${rule.cmd}"; 33 34 args = mkArgs rule; 35 in
··· 19 ]; 20 21 mkArgs = rule: 22 + if (rule.args == null) then "" 23 else if (length rule.args == 0) then "args" 24 else "args ${concatStringsSep " " rule.args}"; 25 ··· 27 let 28 opts = mkOpts rule; 29 30 + as = optionalString (rule.runAs != null) "as ${rule.runAs}"; 31 32 + cmd = optionalString (rule.cmd != null) "cmd ${rule.cmd}"; 33 34 args = mkArgs rule; 35 in
+2 -2
nixos/modules/security/pam.nix
··· 793 }; 794 })); 795 796 - motd = if isNull config.users.motdFile 797 then pkgs.writeText "motd" config.users.motd 798 else config.users.motdFile; 799 ··· 1233 config = { 1234 assertions = [ 1235 { 1236 - assertion = isNull config.users.motd || isNull config.users.motdFile; 1237 message = '' 1238 Only one of users.motd and users.motdFile can be set. 1239 '';
··· 793 }; 794 })); 795 796 + motd = if config.users.motdFile == null 797 then pkgs.writeText "motd" config.users.motd 798 else config.users.motdFile; 799 ··· 1233 config = { 1234 assertions = [ 1235 { 1236 + assertion = config.users.motd == null || config.users.motdFile == null; 1237 message = '' 1238 Only one of users.motd and users.motdFile can be set. 1239 '';
+1 -1
nixos/modules/services/cluster/kubernetes/pki.nix
··· 270 ''; 271 })]); 272 273 - environment.etc.${cfg.etcClusterAdminKubeconfig}.source = mkIf (!isNull cfg.etcClusterAdminKubeconfig) 274 clusterAdminKubeconfig; 275 276 environment.systemPackages = mkIf (top.kubelet.enable || top.proxy.enable) [
··· 270 ''; 271 })]); 272 273 + environment.etc.${cfg.etcClusterAdminKubeconfig}.source = mkIf (cfg.etcClusterAdminKubeconfig != null) 274 clusterAdminKubeconfig; 275 276 environment.systemPackages = mkIf (top.kubelet.enable || top.proxy.enable) [
+2 -2
nixos/modules/services/hardware/undervolt.nix
··· 5 cfg = config.services.undervolt; 6 7 mkPLimit = limit: window: 8 - if (isNull limit && isNull window) then null 9 - else assert asserts.assertMsg (!isNull limit && !isNull window) "Both power limit and window must be set"; 10 "${toString limit} ${toString window}"; 11 cliArgs = lib.cli.toGNUCommandLine {} { 12 inherit (cfg)
··· 5 cfg = config.services.undervolt; 6 7 mkPLimit = limit: window: 8 + if (limit == null && window == null) then null 9 + else assert asserts.assertMsg (limit != null && window != null) "Both power limit and window must be set"; 10 "${toString limit} ${toString window}"; 11 cliArgs = lib.cli.toGNUCommandLine {} { 12 inherit (cfg)
+1 -1
nixos/modules/services/home-automation/home-assistant.nix
··· 362 config = mkIf cfg.enable { 363 assertions = [ 364 { 365 - assertion = cfg.openFirewall -> !isNull cfg.config; 366 message = "openFirewall can only be used with a declarative config"; 367 } 368 ];
··· 362 config = mkIf cfg.enable { 363 assertions = [ 364 { 365 + assertion = cfg.openFirewall -> cfg.config != null; 366 message = "openFirewall can only be used with a declarative config"; 367 } 368 ];
+4 -4
nixos/modules/services/networking/multipath.nix
··· 513 ${indentLines 2 devices} 514 } 515 516 - ${optionalString (!isNull defaults) '' 517 defaults { 518 ${indentLines 2 defaults} 519 } 520 ''} 521 - ${optionalString (!isNull blacklist) '' 522 blacklist { 523 ${indentLines 2 blacklist} 524 } 525 ''} 526 - ${optionalString (!isNull blacklist_exceptions) '' 527 blacklist_exceptions { 528 ${indentLines 2 blacklist_exceptions} 529 } 530 ''} 531 - ${optionalString (!isNull overrides) '' 532 overrides { 533 ${indentLines 2 overrides} 534 }
··· 513 ${indentLines 2 devices} 514 } 515 516 + ${optionalString (defaults != null) '' 517 defaults { 518 ${indentLines 2 defaults} 519 } 520 ''} 521 + ${optionalString (blacklist != null) '' 522 blacklist { 523 ${indentLines 2 blacklist} 524 } 525 ''} 526 + ${optionalString (blacklist_exceptions != null) '' 527 blacklist_exceptions { 528 ${indentLines 2 blacklist_exceptions} 529 } 530 ''} 531 + ${optionalString (overrides != null) '' 532 overrides { 533 ${indentLines 2 overrides} 534 }
+3 -3
nixos/modules/services/networking/radicale.nix
··· 9 listToValue = concatMapStringsSep ", " (generators.mkValueStringDefault { }); 10 }; 11 12 - pkg = if isNull cfg.package then 13 pkgs.radicale 14 else 15 cfg.package; ··· 117 } 118 ]; 119 120 - warnings = optional (isNull cfg.package && versionOlder config.system.stateVersion "17.09") '' 121 The configuration and storage formats of your existing Radicale 122 installation might be incompatible with the newest version. 123 For upgrade instructions see 124 https://radicale.org/2.1.html#documentation/migration-from-1xx-to-2xx. 125 Set services.radicale.package to suppress this warning. 126 - '' ++ optional (isNull cfg.package && versionOlder config.system.stateVersion "20.09") '' 127 The configuration format of your existing Radicale installation might be 128 incompatible with the newest version. For upgrade instructions see 129 https://github.com/Kozea/Radicale/blob/3.0.6/NEWS.md#upgrade-checklist.
··· 9 listToValue = concatMapStringsSep ", " (generators.mkValueStringDefault { }); 10 }; 11 12 + pkg = if cfg.package == null then 13 pkgs.radicale 14 else 15 cfg.package; ··· 117 } 118 ]; 119 120 + warnings = optional (cfg.package == null && versionOlder config.system.stateVersion "17.09") '' 121 The configuration and storage formats of your existing Radicale 122 installation might be incompatible with the newest version. 123 For upgrade instructions see 124 https://radicale.org/2.1.html#documentation/migration-from-1xx-to-2xx. 125 Set services.radicale.package to suppress this warning. 126 + '' ++ optional (cfg.package == null && versionOlder config.system.stateVersion "20.09") '' 127 The configuration format of your existing Radicale installation might be 128 incompatible with the newest version. For upgrade instructions see 129 https://github.com/Kozea/Radicale/blob/3.0.6/NEWS.md#upgrade-checklist.
+1 -1
nixos/modules/services/system/self-deploy.nix
··· 132 133 requires = lib.mkIf (!(isPathType cfg.repository)) [ "network-online.target" ]; 134 135 - environment.GIT_SSH_COMMAND = lib.mkIf (!(isNull cfg.sshKeyFile)) 136 "${pkgs.openssh}/bin/ssh -i ${lib.escapeShellArg cfg.sshKeyFile}"; 137 138 restartIfChanged = false;
··· 132 133 requires = lib.mkIf (!(isPathType cfg.repository)) [ "network-online.target" ]; 134 135 + environment.GIT_SSH_COMMAND = lib.mkIf (cfg.sshKeyFile != null) 136 "${pkgs.openssh}/bin/ssh -i ${lib.escapeShellArg cfg.sshKeyFile}"; 137 138 restartIfChanged = false;
+1 -1
nixos/modules/services/web-apps/dolibarr.nix
··· 16 if (any (str: k == str) secretKeys) then v 17 else if isString v then "'${v}'" 18 else if isBool v then boolToString v 19 - else if isNull v then "null" 20 else toString v 21 ; 22 in
··· 16 if (any (str: k == str) secretKeys) then v 17 else if isString v then "'${v}'" 18 else if isBool v then boolToString v 19 + else if v == null then "null" 20 else toString v 21 ; 22 in
+5 -6
nixos/modules/services/web-apps/writefreely.nix
··· 10 format = pkgs.formats.ini { 11 mkKeyValue = key: value: 12 let 13 - value' = if builtins.isNull value then 14 - "" 15 - else if builtins.isBool value then 16 - if value == true then "true" else "false" 17 - else 18 - toString value; 19 in "${key} = ${value'}"; 20 }; 21
··· 10 format = pkgs.formats.ini { 11 mkKeyValue = key: value: 12 let 13 + value' = lib.optionalString (value != null) 14 + (if builtins.isBool value then 15 + if value == true then "true" else "false" 16 + else 17 + toString value); 18 in "${key} = ${value'}"; 19 }; 20
+7 -7
pkgs/applications/editors/emacs/elisp-packages/libgenerated.nix
··· 73 error = sourceArgs.error or args.error or null; 74 hasSource = lib.hasAttr variant args; 75 pname = builtins.replaceStrings [ "@" ] [ "at" ] ename; 76 - broken = ! isNull error; 77 in 78 if hasSource then 79 lib.nameValuePair ename ( 80 self.callPackage ({ melpaBuild, fetchurl, ... }@pkgargs: 81 melpaBuild { 82 inherit pname ename commit; 83 - version = if isNull version then "" else 84 - lib.concatStringsSep "." (map toString 85 # Hack: Melpa archives contains versions with parse errors such as [ 4 4 -4 413 ] which should be 4.4-413 86 # This filter method is still technically wrong, but it's computationally cheap enough and tapers over the issue 87 - (builtins.filter (n: n >= 0) version)); 88 # TODO: Broken should not result in src being null (hack to avoid eval errors) 89 - src = if (isNull sha256 || broken) then null else 90 lib.getAttr fetcher (fetcherGenerators args sourceArgs); 91 - recipe = if isNull commit then null else 92 fetchurl { 93 name = pname + "-recipe"; 94 url = "https://raw.githubusercontent.com/melpa/melpa/${commit}/recipes/${ename}"; 95 inherit sha256; 96 }; 97 - packageRequires = lib.optionals (! isNull deps) 98 (map (dep: pkgargs.${dep} or self.${dep} or null) 99 deps); 100 meta = (sourceArgs.meta or {}) // {
··· 73 error = sourceArgs.error or args.error or null; 74 hasSource = lib.hasAttr variant args; 75 pname = builtins.replaceStrings [ "@" ] [ "at" ] ename; 76 + broken = error != null; 77 in 78 if hasSource then 79 lib.nameValuePair ename ( 80 self.callPackage ({ melpaBuild, fetchurl, ... }@pkgargs: 81 melpaBuild { 82 inherit pname ename commit; 83 + version = lib.optionalString (version != null) 84 + (lib.concatStringsSep "." (map toString 85 # Hack: Melpa archives contains versions with parse errors such as [ 4 4 -4 413 ] which should be 4.4-413 86 # This filter method is still technically wrong, but it's computationally cheap enough and tapers over the issue 87 + (builtins.filter (n: n >= 0) version))); 88 # TODO: Broken should not result in src being null (hack to avoid eval errors) 89 + src = if (sha256 == null || broken) then null else 90 lib.getAttr fetcher (fetcherGenerators args sourceArgs); 91 + recipe = if commit == null then null else 92 fetchurl { 93 name = pname + "-recipe"; 94 url = "https://raw.githubusercontent.com/melpa/melpa/${commit}/recipes/${ename}"; 95 inherit sha256; 96 }; 97 + packageRequires = lib.optionals (deps != null) 98 (map (dep: pkgargs.${dep} or self.${dep} or null) 99 deps); 100 meta = (sourceArgs.meta or {}) // {
+1 -1
pkgs/applications/science/logic/coq/default.nix
··· 70 substituteInPlace plugins/micromega/sos.ml --replace "; csdp" "; ${csdp}/bin/csdp" 71 substituteInPlace plugins/micromega/coq_micromega.ml --replace "System.is_in_system_path \"csdp\"" "true" 72 ''; 73 - ocamlPackages = if !isNull customOCamlPackages then customOCamlPackages 74 else with versions; switch coq-version [ 75 { case = range "8.16" "8.17"; out = ocamlPackages_4_14; } 76 { case = range "8.14" "8.15"; out = ocamlPackages_4_12; }
··· 70 substituteInPlace plugins/micromega/sos.ml --replace "; csdp" "; ${csdp}/bin/csdp" 71 substituteInPlace plugins/micromega/coq_micromega.ml --replace "System.is_in_system_path \"csdp\"" "true" 72 ''; 73 + ocamlPackages = if customOCamlPackages != null then customOCamlPackages 74 else with versions; switch coq-version [ 75 { case = range "8.16" "8.17"; out = ocamlPackages_4_14; } 76 { case = range "8.14" "8.15"; out = ocamlPackages_4_12; }
+3 -3
pkgs/applications/virtualization/singularity/generic.nix
··· 76 77 let 78 defaultPathOriginal = "/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin"; 79 - privileged-un-utils = if ((isNull newuidmapPath) && (isNull newgidmapPath)) then null else 80 (runCommandLocal "privileged-un-utils" { } '' 81 mkdir -p "$out/bin" 82 ln -s ${lib.escapeShellArg newuidmapPath} "$out/bin/newuidmap" ··· 212 rm "$file" 213 done 214 ''} 215 - ${lib.optionalString enableSuid (lib.warnIf (isNull starterSuidPath) "${projectName}: Null starterSuidPath when enableSuid produces non-SUID-ed starter-suid and run-time permission denial." '' 216 chmod +x $out/libexec/${projectName}/bin/starter-suid 217 '')} 218 - ${lib.optionalString (enableSuid && !isNull starterSuidPath) '' 219 mv "$out"/libexec/${projectName}/bin/starter-suid{,.orig} 220 ln -s ${lib.escapeShellArg starterSuidPath} "$out/libexec/${projectName}/bin/starter-suid" 221 ''}
··· 76 77 let 78 defaultPathOriginal = "/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin"; 79 + privileged-un-utils = if ((newuidmapPath == null) && (newgidmapPath == null)) then null else 80 (runCommandLocal "privileged-un-utils" { } '' 81 mkdir -p "$out/bin" 82 ln -s ${lib.escapeShellArg newuidmapPath} "$out/bin/newuidmap" ··· 212 rm "$file" 213 done 214 ''} 215 + ${lib.optionalString enableSuid (lib.warnIf (starterSuidPath == null) "${projectName}: Null starterSuidPath when enableSuid produces non-SUID-ed starter-suid and run-time permission denial." '' 216 chmod +x $out/libexec/${projectName}/bin/starter-suid 217 '')} 218 + ${lib.optionalString (enableSuid && (starterSuidPath != null)) '' 219 mv "$out"/libexec/${projectName}/bin/starter-suid{,.orig} 220 ln -s ${lib.escapeShellArg starterSuidPath} "$out/libexec/${projectName}/bin/starter-suid" 221 ''}
+1 -1
pkgs/build-support/coq/default.nix
··· 52 inherit release releaseRev; 53 location = { inherit domain owner repo; }; 54 } // optionalAttrs (args?fetcher) {inherit fetcher;}); 55 - fetched = fetch (if !isNull version then version else defaultVersion); 56 display-pkg = n: sep: v: 57 let d = displayVersion.${n} or (if sep == "" then ".." else true); in 58 n + optionalString (v != "" && v != null) (switch d [
··· 52 inherit release releaseRev; 53 location = { inherit domain owner repo; }; 54 } // optionalAttrs (args?fetcher) {inherit fetcher;}); 55 + fetched = fetch (if version != null then version else defaultVersion); 56 display-pkg = n: sep: v: 57 let d = displayVersion.${n} or (if sep == "" then ".." else true); in 58 n + optionalString (v != "" && v != null) (switch d [
+4 -4
pkgs/build-support/coq/meta-fetch/default.nix
··· 8 fmt = if args?sha256 then "zip" else "tarball"; 9 pr = match "^#(.*)$" rev; 10 url = switch-if [ 11 - { cond = isNull pr && !isNull (match "^github.*" domain); 12 out = "https://${domain}/${owner}/${repo}/archive/${rev}.${ext}"; } 13 - { cond = !isNull pr && !isNull (match "^github.*" domain); 14 out = "https://api.${domain}/repos/${owner}/${repo}/${fmt}/pull/${head pr}/head"; } 15 - { cond = isNull pr && !isNull (match "^gitlab.*" domain); 16 out = "https://${domain}/${owner}/${repo}/-/archive/${rev}/${repo}-${rev}.${ext}"; } 17 - { cond = !isNull (match "(www.)?mpi-sws.org" domain); 18 out = "https://www.mpi-sws.org/~${owner}/${repo}/download/${repo}-${rev}.${ext}";} 19 ] (throw "meta-fetch: no fetcher found for domain ${domain} on ${rev}"); 20 fetch = x: if args?sha256 then fetchzip (x // { inherit sha256; }) else fetchTarball x;
··· 8 fmt = if args?sha256 then "zip" else "tarball"; 9 pr = match "^#(.*)$" rev; 10 url = switch-if [ 11 + { cond = pr == null && (match "^github.*" domain) != null; 12 out = "https://${domain}/${owner}/${repo}/archive/${rev}.${ext}"; } 13 + { cond = pr != null && (match "^github.*" domain) != null; 14 out = "https://api.${domain}/repos/${owner}/${repo}/${fmt}/pull/${head pr}/head"; } 15 + { cond = pr == null && (match "^gitlab.*" domain) != null; 16 out = "https://${domain}/${owner}/${repo}/-/archive/${rev}/${repo}-${rev}.${ext}"; } 17 + { cond = (match "(www.)?mpi-sws.org" domain) != null; 18 out = "https://www.mpi-sws.org/~${owner}/${repo}/download/${repo}-${rev}.${ext}";} 19 ] (throw "meta-fetch: no fetcher found for domain ${domain} on ${rev}"); 20 fetch = x: if args?sha256 then fetchzip (x // { inherit sha256; }) else fetchTarball x;
+1 -1
pkgs/build-support/make-desktopitem/default.nix
··· 89 renderSection = sectionName: attrs: 90 lib.pipe attrs [ 91 (lib.mapAttrsToList renderLine) 92 - (builtins.filter (v: !isNull v)) 93 (builtins.concatStringsSep "\n") 94 (section: '' 95 [${sectionName}]
··· 89 renderSection = sectionName: attrs: 90 lib.pipe attrs [ 91 (lib.mapAttrsToList renderLine) 92 + (builtins.filter (v: v != null)) 93 (builtins.concatStringsSep "\n") 94 (section: '' 95 [${sectionName}]
+1 -1
pkgs/data/themes/orchis-theme/default.nix
··· 45 runHook preInstall 46 bash install.sh -d $out/share/themes -t all \ 47 ${lib.optionalString (tweaks != []) "--tweaks " + builtins.toString tweaks} \ 48 - ${lib.optionalString (!isNull border-radius) ("--round " + builtins.toString border-radius + "px")} 49 ${lib.optionalString withWallpapers '' 50 mkdir -p $out/share/backgrounds 51 cp src/wallpaper/{1080p,2k,4k}.jpg $out/share/backgrounds
··· 45 runHook preInstall 46 bash install.sh -d $out/share/themes -t all \ 47 ${lib.optionalString (tweaks != []) "--tweaks " + builtins.toString tweaks} \ 48 + ${lib.optionalString (border-radius != null) ("--round " + builtins.toString border-radius + "px")} 49 ${lib.optionalString withWallpapers '' 50 mkdir -p $out/share/backgrounds 51 cp src/wallpaper/{1080p,2k,4k}.jpg $out/share/backgrounds
+4 -4
pkgs/development/nim-packages/build-nim-package/default.nix
··· 9 depsBuildBuild = [ nim_builder ] ++ depsBuildBuild; 10 nativeBuildInputs = [ nim ] ++ nativeBuildInputs; 11 12 - configurePhase = if isNull configurePhase then '' 13 runHook preConfigure 14 export NIX_NIM_BUILD_INPUTS=''${pkgsHostTarget[@]} $NIX_NIM_BUILD_INPUTS 15 nim_builder --phase:configure ··· 17 '' else 18 configurePhase; 19 20 - buildPhase = if isNull buildPhase then '' 21 runHook preBuild 22 nim_builder --phase:build 23 runHook postBuild 24 '' else 25 buildPhase; 26 27 - checkPhase = if isNull checkPhase then '' 28 runHook preCheck 29 nim_builder --phase:check 30 runHook postCheck 31 '' else 32 checkPhase; 33 34 - installPhase = if isNull installPhase then '' 35 runHook preInstall 36 nim_builder --phase:install 37 runHook postInstall
··· 9 depsBuildBuild = [ nim_builder ] ++ depsBuildBuild; 10 nativeBuildInputs = [ nim ] ++ nativeBuildInputs; 11 12 + configurePhase = if (configurePhase == null) then '' 13 runHook preConfigure 14 export NIX_NIM_BUILD_INPUTS=''${pkgsHostTarget[@]} $NIX_NIM_BUILD_INPUTS 15 nim_builder --phase:configure ··· 17 '' else 18 configurePhase; 19 20 + buildPhase = if (buildPhase == null) then '' 21 runHook preBuild 22 nim_builder --phase:build 23 runHook postBuild 24 '' else 25 buildPhase; 26 27 + checkPhase = if (checkPhase == null) then '' 28 runHook preCheck 29 nim_builder --phase:check 30 runHook postCheck 31 '' else 32 checkPhase; 33 34 + installPhase = if (installPhase == null) then '' 35 runHook preInstall 36 nim_builder --phase:install 37 runHook postInstall
+2 -2
pkgs/development/python-modules/mip/default.nix
··· 35 cffi 36 ] ++ lib.optionals gurobiSupport ([ 37 gurobipy 38 - ] ++ lib.optional (builtins.isNull gurobiHome) gurobi); 39 40 # Source files have CRLF terminators, which make patch error out when supplied 41 # with diffs made on *nix machines ··· 58 59 # Make MIP use the Gurobi solver, if configured to do so 60 makeWrapperArgs = lib.optional gurobiSupport 61 - "--set GUROBI_HOME ${if builtins.isNull gurobiHome then gurobi.outPath else gurobiHome}"; 62 63 # Tests that rely on Gurobi are activated only when Gurobi support is enabled 64 disabledTests = lib.optional (!gurobiSupport) "gurobi";
··· 35 cffi 36 ] ++ lib.optionals gurobiSupport ([ 37 gurobipy 38 + ] ++ lib.optional (gurobiHome == null) gurobi); 39 40 # Source files have CRLF terminators, which make patch error out when supplied 41 # with diffs made on *nix machines ··· 58 59 # Make MIP use the Gurobi solver, if configured to do so 60 makeWrapperArgs = lib.optional gurobiSupport 61 + "--set GUROBI_HOME ${if gurobiHome == null then gurobi.outPath else gurobiHome}"; 62 63 # Tests that rely on Gurobi are activated only when Gurobi support is enabled 64 disabledTests = lib.optional (!gurobiSupport) "gurobi";
+1 -1
pkgs/development/tools/build-managers/waf/default.nix
··· 4 }: 5 let 6 wafToolsArg = with lib.strings; 7 - optionalString (!isNull withTools) " --tools=\"${concatStringsSep "," withTools}\""; 8 in 9 stdenv.mkDerivation rec { 10 pname = "waf";
··· 4 }: 5 let 6 wafToolsArg = with lib.strings; 7 + optionalString (withTools != null) " --tools=\"${concatStringsSep "," withTools}\""; 8 in 9 stdenv.mkDerivation rec { 10 pname = "waf";
+1 -1
pkgs/development/tools/poetry2nix/poetry2nix/overrides/default.nix
··· 50 { 51 nativeBuildInputs = 52 (old.nativeBuildInputs or [ ]) 53 - ++ lib.optionals (!(builtins.isNull buildSystem)) [ buildSystem ] 54 ++ map (a: self.${a}) extraAttrs; 55 } 56 )
··· 50 { 51 nativeBuildInputs = 52 (old.nativeBuildInputs or [ ]) 53 + ++ lib.optionals (buildSystem != null) [ buildSystem ] 54 ++ map (a: self.${a}) extraAttrs; 55 } 56 )
+1 -1
pkgs/games/cataclysm-dda/pkgs/default.nix
··· 16 pkgs' = lib.mapAttrs (_: mods: lib.filterAttrs isAvailable mods) pkgs; 17 18 isAvailable = _: mod: 19 - if isNull build then 20 true 21 else if build.isTiles then 22 mod.forTiles or false
··· 16 pkgs' = lib.mapAttrs (_: mods: lib.filterAttrs isAvailable mods) pkgs; 17 18 isAvailable = _: mod: 19 + if (build == null) then 20 true 21 else if build.isTiles then 22 mod.forTiles or false
+1 -1
pkgs/games/curseofwar/default.nix
··· 20 SDL 21 ]; 22 23 - makeFlags = (if isNull SDL then [] else [ "SDL=yes" ]) ++ [ 24 "PREFIX=$(out)" 25 # force platform's cc on darwin, otherwise gcc is used 26 "CC=${stdenv.cc.targetPrefix}cc"
··· 20 SDL 21 ]; 22 23 + makeFlags = (lib.optionals (SDL != null) [ "SDL=yes" ]) ++ [ 24 "PREFIX=$(out)" 25 # force platform's cc on darwin, otherwise gcc is used 26 "CC=${stdenv.cc.targetPrefix}cc"
+1 -1
pkgs/servers/nosql/arangodb/default.nix
··· 25 else "core"; 26 27 targetArch = 28 - if isNull targetArchitecture 29 then defaultTargetArchitecture 30 else targetArchitecture; 31 in
··· 25 else "core"; 26 27 targetArch = 28 + if targetArchitecture == null 29 then defaultTargetArchitecture 30 else targetArchitecture; 31 in
+1 -1
pkgs/stdenv/generic/make-derivation.nix
··· 206 207 checkDependencyList = checkDependencyList' []; 208 checkDependencyList' = positions: name: deps: lib.flip lib.imap1 deps (index: dep: 209 - if lib.isDerivation dep || isNull dep || builtins.typeOf dep == "string" || builtins.typeOf dep == "path" then dep 210 else if lib.isList dep then checkDependencyList' ([index] ++ positions) name dep 211 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}"); 212 in if builtins.length erroneousHardeningFlags != 0
··· 206 207 checkDependencyList = checkDependencyList' []; 208 checkDependencyList' = positions: name: deps: lib.flip lib.imap1 deps (index: dep: 209 + if lib.isDerivation dep || dep == null || builtins.typeOf dep == "string" || builtins.typeOf dep == "path" then dep 210 else if lib.isList dep then checkDependencyList' ([index] ++ positions) name dep 211 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}"); 212 in if builtins.length erroneousHardeningFlags != 0
+2 -2
pkgs/tools/misc/plfit/default.nix
··· 20 21 nativeBuildInputs = [ 22 cmake 23 - ] ++ lib.optionals (!isNull python) [ 24 python 25 swig 26 ]; 27 28 cmakeFlags = [ 29 "-DPLFIT_USE_OPENMP=ON" 30 - ] ++ lib.optionals (!isNull python) [ 31 "-DPLFIT_COMPILE_PYTHON_MODULE=ON" 32 ]; 33
··· 20 21 nativeBuildInputs = [ 22 cmake 23 + ] ++ lib.optionals (python != null) [ 24 python 25 swig 26 ]; 27 28 cmakeFlags = [ 29 "-DPLFIT_USE_OPENMP=ON" 30 + ] ++ lib.optionals (python != null) [ 31 "-DPLFIT_COMPILE_PYTHON_MODULE=ON" 32 ]; 33
+1 -1
pkgs/tools/text/gawk/gawkextlib.nix
··· 6 let 7 buildExtension = lib.makeOverridable 8 ({ name, gawkextlib, extraBuildInputs ? [ ], doCheck ? true }: 9 - let is_extension = !isNull gawkextlib; 10 in stdenv.mkDerivation rec { 11 pname = "gawkextlib-${name}"; 12 version = "unstable-2019-11-21";
··· 6 let 7 buildExtension = lib.makeOverridable 8 ({ name, gawkextlib, extraBuildInputs ? [ ], doCheck ? true }: 9 + let is_extension = gawkextlib != null; 10 in stdenv.mkDerivation rec { 11 pname = "gawkextlib-${name}"; 12 version = "unstable-2019-11-21";