[Backport release-25.11] nixos: remove optional builtins prefixes from prelude functions#480781
Merged
bjornfor merged 1 commit intoJan 17, 2026
Merged
Conversation
Remove optional builtins prefixes from prelude functions by running:
builtins=(
abort
baseNameOf
break
derivation
derivationStrict
dirOf
false
fetchGit
fetchMercurial
fetchTarball
fetchTree
fromTOML
import
isNull
map
null
placeholder
removeAttrs
scopedImport
throw
toString
true
)
fd \
--exclude doc/manual/release-notes \
--type file \
. \
nixos \
--exec-batch sed --in-place --regexp-extended "
s/\<builtins\.($(
printf '%s\n' "${builtins[@]}" |
paste --delimiter '|' --serial -
))\>/\1/g
"
nix fmt
(cherry picked from commit a2ed7e8)
Contributor
There was a problem hiding this comment.
This report is automatically generated by the PR / Check / cherry-pick CI workflow.
Some of the commits in this PR require the author's and reviewer's attention.
Sometimes it is not possible to cherry-pick exactly the same patch.
This most frequently happens when resolving merge conflicts.
The range-diff will help to review the resolution of conflicts.
If you need to merge this PR despite the warnings, please dismiss this review shortly before merging.
Warning
Difference between f48f9dd and original a2ed7e8 may warrant inspection.
Show diff
@@ Commit message
"
nix fmt
+ (cherry picked from commit a2ed7e8d882c2b9deba7b7c2cc8e1a97b29aa415)
## nixos/lib/eval-config-minimal.nix ##
@@ nixos/lib/eval-config-minimal.nix: let
@@ nixos/modules/services/audio/lavalink.nix: in
"extraConfig"
"hash"
- ## nixos/modules/services/audio/mpd.nix ##
-@@ nixos/modules/services/audio/mpd.nix: let
- )
- ) a;
- nonBlockSettings = lib.filterAttrs (n: v: !(builtins.isAttrs v || builtins.isList v)) cfg.settings;
-- pureBlockSettings = builtins.removeAttrs cfg.settings (builtins.attrNames nonBlockSettings);
-+ pureBlockSettings = removeAttrs cfg.settings (builtins.attrNames nonBlockSettings);
- blocks =
- pureBlockSettings
- // lib.optionalAttrs cfg.fluidsynth {
-
## nixos/modules/services/audio/pulseaudio.nix ##
@@ nixos/modules/services/audio/pulseaudio.nix: in
(lib.mkIf (cfg.extraModules != [ ]) {
@@ nixos/modules/services/databases/postgresql.nix: let
# The main PostgreSQL configuration file.
configFile = pkgs.writeTextDir "postgresql.conf" (
-@@ nixos/modules/services/databases/postgresql.nix: let
- else if builtins.isString v then
- "${directive} '${v}'"
- else
-- "${directive} ${builtins.toString v}"
-+ "${directive} ${toString v}"
- ) user.ensureClauses;
-
- generateAlterRoleSQL =
@@ nixos/modules/services/databases/postgresql.nix: in
};
@@ nixos/modules/services/network-filesystems/kubo.nix: let
"Pinning"
];
- ## nixos/modules/services/network-filesystems/openafs/server.nix ##
-@@ nixos/modules/services/network-filesystems/openafs/server.nix: in
-
- warnings =
- lib.optional ((builtins.attrNames cfg.cellServDB) != [ cfg.cellName ]) ''
-- config.services.openafsServer.cellServDB should normally only contain servers for one cell. It currently contains servers for ${builtins.toString (builtins.attrNames cfg.cellServDB)}.
-+ config.services.openafsServer.cellServDB should normally only contain servers for one cell. It currently contains servers for ${toString (builtins.attrNames cfg.cellServDB)}.
- ''
- ++
- lib.optional (useBuCellServDB && (builtins.attrNames cfg.backup.cellServDB) != [ cfg.cellName ])
- ''
-- config.services.openafsServer.backup.cellServDB should normally only contain servers for one cell. It currently contains servers for ${builtins.toString (builtins.attrNames cfg.cellServDB)}.
-+ config.services.openafsServer.backup.cellServDB should normally only contain servers for one cell. It currently contains servers for ${toString (builtins.attrNames cfg.cellServDB)}.
- '';
-
- assertions = [
-
## nixos/modules/services/networking/aria2.nix ##
@@ nixos/modules/services/networking/aria2.nix: let
portRangesToString =
@@ nixos/modules/services/networking/iodine.nix: in
serviceConfig = {
# Filesystem access
- ## nixos/modules/services/networking/meshtasticd.nix ##
-@@ nixos/modules/services/networking/meshtasticd.nix: in
- AmbientCapabilities = [
- "CAP_NET_BIND_SERVICE"
- ];
-- ExecStart = "${lib.getExe cfg.package} --port=${builtins.toString cfg.port} --fsdir=${cfg.dataDir} --config=${configFile} --verbose";
-+ ExecStart = "${lib.getExe cfg.package} --port=${toString cfg.port} --fsdir=${cfg.dataDir} --config=${configFile} --verbose";
- Restart = "always";
- RestartSec = "3";
- };
-
## nixos/modules/services/networking/nat-iptables.nix ##
@@ nixos/modules/services/networking/nat-iptables.nix: let
${concatMapStrings (fwd: ''
@@ nixos/modules/services/networking/wireguard-networkd.nix: let
privateKeyCredential = interfaceName: escapeCredentialName "wireguard-${interfaceName}-private-key";
presharedKeyCredential =
+ ## nixos/modules/services/networking/yggdrasil.nix ##
+@@ nixos/modules/services/networking/yggdrasil.nix: in
+ script = ''
+ if [ ! -e ${keysPath} ]
+ then
+- mkdir --mode=700 -p ${builtins.dirOf keysPath}
++ mkdir --mode=700 -p ${dirOf keysPath}
+ ${binYggdrasil} -genconf -json \
+ | ${pkgs.jq}/bin/jq \
+ 'to_entries|map(select(.key|endswith("Key")))|from_entries' \
+
## nixos/modules/services/printing/cups-pdf.nix ##
@@ nixos/modules/services/printing/cups-pdf.nix: let
};
@@ nixos/modules/services/security/sks.nix: in
{
sks-db = {
- ## nixos/modules/services/system/nix-daemon-firewall.nix ##
-@@ nixos/modules/services/system/nix-daemon-firewall.nix: in
-
- # TCP
- ${lib.optionalString (cfg.allowedTCPPorts != [ ]) ''
-- tcp dport { ${lib.concatStringsSep ", " (map builtins.toString cfg.allowedTCPPorts)} } accept
-+ tcp dport { ${lib.concatStringsSep ", " (map toString cfg.allowedTCPPorts)} } accept
- ip protocol tcp counter drop
- ip6 nexthdr tcp counter drop
- ''}
-
- # UDP
- ${lib.optionalString (cfg.allowedUDPPorts != [ ]) ''
-- udp dport { ${lib.concatStringsSep ", " (map builtins.toString cfg.allowedUDPPorts)} } accept
-+ udp dport { ${lib.concatStringsSep ", " (map toString cfg.allowedUDPPorts)} } accept
- ip protocol udp counter drop
- ip6 nexthdr udp counter drop
- ''}
-
## nixos/modules/services/web-apps/akkoma.nix ##
@@ nixos/modules/services/web-apps/akkoma.nix: in
type = types.nonEmptyStr;
@@ nixos/modules/services/web-apps/artalk.nix: in
RestartSec = "5s";
ConfigurationDirectory = [ "artalk" ];
+ ## nixos/modules/services/web-apps/crabfit.nix ##
+@@ nixos/modules/services/web-apps/crabfit.nix: in
+ };
+
+ environment = {
+- API_LISTEN = "127.0.0.1:${builtins.toString cfg.api.port}";
++ API_LISTEN = "127.0.0.1:${toString cfg.api.port}";
+ DATABASE_URL = "postgres:///crabfit?host=/run/postgresql";
+ FRONTEND_URL = "https://${cfg.frontend.host}";
+ }
+@@ nixos/modules/services/web-apps/crabfit.nix: in
+
+ environment = {
+ NEXT_PUBLIC_API_URL = "https://${cfg.api.host}";
+- PORT = builtins.toString cfg.frontend.port;
++ PORT = toString cfg.frontend.port;
+ }
+ // cfg.frontend.environment;
+ };
+
## nixos/modules/services/web-apps/cryptpad.nix ##
@@ nixos/modules/services/web-apps/cryptpad.nix: in
RestrictSUIDSGID = true;
@@ nixos/modules/services/web-apps/komga.nix: in
};
- ## nixos/modules/services/web-apps/librechat.nix ##
-@@ nixos/modules/services/web-apps/librechat.nix: in
- Type = "simple";
- User = cfg.user;
- Group = cfg.group;
-- StateDirectory = builtins.baseNameOf cfg.dataDir;
-+ StateDirectory = baseNameOf cfg.dataDir;
- WorkingDirectory = cfg.dataDir;
- LoadCredential = getLoadCredentialList;
- EnvironmentFile = cfg.credentialsFile;
-
## nixos/modules/services/web-apps/mastodon.nix ##
@@ nixos/modules/services/web-apps/mastodon.nix: let
name: processCfg:
@@ nixos/tests/galene.nix: in
machine.wait_for_window("Test — Mozilla Firefox")
machine.send_key("ctrl-minus")
- ## nixos/tests/gitlab/runner/podman-runner/nix-image.nix ##
-@@ nixos/tests/gitlab/runner/podman-runner/nix-image.nix: let
- cat > $out <<EOF
- [
- ${lib.concatStringsSep "\n" (
-- builtins.map (
-+ map (
- drv:
- let
- outputs = drv.outputsToInstall or [ "out" ];
-@@ nixos/tests/gitlab/runner/podman-runner/nix-image.nix: let
- ''
- {
- ${lib.concatStringsSep "\n" (
-- builtins.map (output: ''
-+ map (output: ''
- ${output} = { outPath = "${lib.getOutput output drv}"; };
- '') outputs
- )}
-- outputs = [ ${lib.concatStringsSep " " (builtins.map (x: "\"${x}\"") outputs)} ];
-+ outputs = [ ${lib.concatStringsSep " " (map (x: "\"${x}\"") outputs)} ];
- name = "${drv.name}";
- outPath = "${drv}";
- system = "${drv.system}";
-
## nixos/tests/glance.nix ##
@@
let
@@ nixos/tests/ncps.nix
);
};
- ## nixos/tests/networking/meshtasticd.nix ##
-@@ nixos/tests/networking/meshtasticd.nix: in
- testScript = ''
- with subtest("Test meshtasticd service"):
- machine.wait_for_unit("meshtasticd.service")
-- machine.wait_for_open_port(${builtins.toString mainPort})
-- machine.wait_for_open_port(${builtins.toString webPort})
-- machine.succeed("curl -fvvv -Ls http://localhost:${builtins.toString webPort} | grep -q 'Meshtastic Web Client'")
-+ machine.wait_for_open_port(${toString mainPort})
-+ machine.wait_for_open_port(${toString webPort})
-+ machine.succeed("curl -fvvv -Ls http://localhost:${toString webPort} | grep -q 'Meshtastic Web Client'")
- '';
- }
-
## nixos/tests/networking/networkd-and-scripted.nix ##
@@ nixos/tests/networking/networkd-and-scripted.nix: let
nodes.machine = {
Hint: The full diffs are also available in the runner logs with slightly better highlighting.
13 tasks
bjornfor
approved these changes
Jan 16, 2026
Merged
via the queue into
NixOS:release-25.11
with commit Jan 17, 2026
ee95821
43 of 45 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a semi-manual backport of #447403, as proposed in #447403 (comment). The diff has been generated by running the provided script against this branch.
For convenience, here is the relevant diff against the original commit:
diffagainst the original commitThings done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.