Skip to content

nixos: remove optional builtins prefixes from prelude functions#447403

Merged
MattSturgeon merged 1 commit into
NixOS:masterfrom
trueNAHO:nixos-remove-optional-builtins-prefixes-from-prelude-functions
Jan 15, 2026
Merged

nixos: remove optional builtins prefixes from prelude functions#447403
MattSturgeon merged 1 commit into
NixOS:masterfrom
trueNAHO:nixos-remove-optional-builtins-prefixes-from-prelude-functions

Conversation

@trueNAHO

@trueNAHO trueNAHO commented Sep 30, 2025

Copy link
Copy Markdown
Member
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

Related PRs intentionally split up to simplify review and merging:

  1. doc: remove optional builtins prefixes from prelude functions #447401
  2. lib: remove optional builtins prefixes from prelude functions #447402
  3. pkgs: remove optional builtins prefixes from prelude functions #447404
  4. nixos: remove optional builtins prefixes from prelude functions #447403
  5. treewide: remove optional builtins prefixes from prelude functions #444432

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog This PR adds or changes release notes 8.has: module (update) This PR changes an existing module in `nixos/` 6.topic: printing Drivers, CUPS & Co. 6.topic: vim Advanced text editor 6.topic: hardware Drivers, Firmware and Kernels 6.topic: nixos-container Imperative and declarative systemd-nspawn containers 6.topic: testing Tooling for automated testing of packages and modules 6.topic: systemd Software suite that provides an array of system components for Linux operating systems. 6.topic: k3s Kubernates distribution (https://k3s.io/) 8.has: documentation This PR adds or changes documentation labels Sep 30, 2025
@nixpkgs-ci nixpkgs-ci Bot added the 9.needs: reviewer This PR currently has no reviewers requested and needs attention. label Sep 30, 2025
@trueNAHO trueNAHO marked this pull request as draft September 30, 2025 18:31
@nixpkgs-ci nixpkgs-ci Bot added 2.status: merge conflict This PR has merge conflicts with the target branch and removed 9.needs: reviewer This PR currently has no reviewers requested and needs attention. labels Sep 30, 2025
@trueNAHO trueNAHO marked this pull request as ready for review October 4, 2025 17:08
@nixpkgs-ci nixpkgs-ci Bot added the 9.needs: reviewer This PR currently has no reviewers requested and needs attention. label Oct 4, 2025
@trueNAHO trueNAHO force-pushed the nixos-remove-optional-builtins-prefixes-from-prelude-functions branch from f15a8c0 to 6bc130c Compare October 4, 2025 17:15
@nixpkgs-ci nixpkgs-ci Bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Oct 4, 2025

@qweered qweered left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 1 This PR was reviewed and approved by one person. and removed 9.needs: reviewer This PR currently has no reviewers requested and needs attention. labels Oct 4, 2025

@qweered qweered left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skimmed through changes, nothing questionable

@nixpkgs-ci nixpkgs-ci Bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Nov 17, 2025
@MattSturgeon

Copy link
Copy Markdown
Contributor

Should we merge this PR this time after sufficient approval, since there has not really been any activity here?

Seeing as no one seems to be objecting, I'm happy to re-review and merge once rebased.

FYI #480141 is also pulling in the new nixd linting rules into our ci-pinned nixpkgs, although it looks like we'll be disabling them at first to avoid a treewide cleanup.

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
@trueNAHO trueNAHO force-pushed the nixos-remove-optional-builtins-prefixes-from-prelude-functions branch from dc9c0ac to a2ed7e8 Compare January 15, 2026 15:18
@nixpkgs-ci nixpkgs-ci Bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 15, 2026
@trueNAHO

Copy link
Copy Markdown
Member Author

Should we merge this PR this time after sufficient approval, since there has not really been any activity here?

Seeing as no one seems to be objecting, I'm happy to re-review and merge once rebased.

I updated this PR exactly like in #447403 (comment). Like before, here is the relevant diff against the previous diff:

git diff against the previous git diff
--- 2025-11-16 (dc9c0ac7b54813a95edf964b742d6cfe3fc29bcb)
+++ 2026-01-15 (a2ed7e8d882c2b9deba7b7c2cc8e1a97b29aa415)
@@ -661,11 +661,24 @@
                "name"
                "extraConfig"
                "hash"
+diff --git a/nixos/modules/services/audio/mpd.nix b/nixos/modules/services/audio/mpd.nix
+index d21dcdac9b03..1bf0723126ef 100644
+--- a/nixos/modules/services/audio/mpd.nix
++++ b/nixos/modules/services/audio/mpd.nix
+@@ -27,7 +27,7 @@ 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 {
 diff --git a/nixos/modules/services/audio/pulseaudio.nix b/nixos/modules/services/audio/pulseaudio.nix
-index b4ef09f49760..711dbe337a19 100644
+index 8f1bfb98cd08..d6afa095fc3e 100644
 --- a/nixos/modules/services/audio/pulseaudio.nix
 +++ b/nixos/modules/services/audio/pulseaudio.nix
-@@ -262,11 +262,9 @@ in
+@@ -282,11 +282,9 @@ in
        (lib.mkIf (cfg.extraModules != [ ]) {
          services.pulseaudio.daemon.config.dl-search-path =
            let
@@ -753,21 +766,28 @@
    '';
    cfgFile =
      fileName: properties:
-diff --git a/nixos/modules/services/cluster/k3s/default.nix b/nixos/modules/services/cluster/k3s/default.nix
-index c9a69af2fa16..55c5f4dab59a 100644
---- a/nixos/modules/services/cluster/k3s/default.nix
-+++ b/nixos/modules/services/cluster/k3s/default.nix
-@@ -360,8 +360,8 @@ let
-         target = lib.mkDefault (mkManifestTarget name);
-         source = lib.mkIf (config.content != null) (
-           let
--            name' = "k3s-manifest-" + builtins.baseNameOf name;
--            docName = "k3s-manifest-doc-" + builtins.baseNameOf name;
-+            name' = "k3s-manifest-" + baseNameOf name;
-+            docName = "k3s-manifest-doc-" + baseNameOf name;
-             mkSource =
-               value:
-               if builtins.isList value then
+diff --git a/nixos/modules/services/cluster/rancher/default.nix b/nixos/modules/services/cluster/rancher/default.nix
+index 31415945aab6..3ed0f75d081e 100644
+--- a/nixos/modules/services/cluster/rancher/default.nix
++++ b/nixos/modules/services/cluster/rancher/default.nix
+@@ -169,7 +169,7 @@ let
+         # source is a store path containing the complete manifest file
+         source = mkManifestSource "auto-deploy-chart-${name}" (
+           lib.singleton (mkHelmChartCR name value)
+-          ++ builtins.map (x: fromYaml (mkExtraDeployManifest x)) value.extraDeploy
++          ++ map (x: fromYaml (mkExtraDeployManifest x)) value.extraDeploy
+         );
+       };
+
+@@ -384,7 +384,7 @@ let
+             target = lib.mkDefault (mkManifestTarget name);
+             source = lib.mkIf (config.content != null) (
+               let
+-                name' = "${name}-manifest-" + builtins.baseNameOf name;
++                name' = "${name}-manifest-" + baseNameOf name;
+                 mkSource = mkManifestSource name';
+               in
+               lib.mkDerivedConfig options.content mkSource
 diff --git a/nixos/modules/services/continuous-integration/buildkite-agents.nix b/nixos/modules/services/continuous-integration/buildkite-agents.nix
 index f4c868ed6a2f..6c020f8d98dd 100644
 --- a/nixos/modules/services/continuous-integration/buildkite-agents.nix
@@ -833,7 +853,16 @@

    # The main PostgreSQL configuration file.
    configFile = pkgs.writeTextDir "postgresql.conf" (
-@@ -909,7 +909,7 @@ in
+@@ -83,7 +83,7 @@ let
+       else if builtins.isString v then
+         "${directive} '${v}'"
+       else
+-        "${directive} ${builtins.toString v}"
++        "${directive} ${toString v}"
+     ) user.ensureClauses;
+
+   generateAlterRoleSQL =
+@@ -882,7 +882,7 @@ in
        };

        path = [ cfg.finalPackage ];
@@ -890,6 +919,23 @@
              else
                toValue option
            );
+diff --git a/nixos/modules/services/hardware/arsenik.nix b/nixos/modules/services/hardware/arsenik.nix
+index 915c54a9e408..aa6ad4795f8b 100644
+--- a/nixos/modules/services/hardware/arsenik.nix
++++ b/nixos/modules/services/hardware/arsenik.nix
+@@ -114,9 +114,9 @@ in
+         enable = true;
+         keyboards.arsenik.config = ''
+           (defvar
+-            tap_timeout ${builtins.toString cfg.tap_timeout}
+-            hold_timeout ${builtins.toString cfg.hold_timeout}
+-            long_hold_timeout ${builtins.toString cfg.long_hold_timeout}
++            tap_timeout ${toString cfg.tap_timeout}
++            hold_timeout ${toString cfg.hold_timeout}
++            long_hold_timeout ${toString cfg.long_hold_timeout}
+           )
+           (include ${src}/defsrc/${defsrc}.kbd)
+           (include ${src}/deflayer/${base}.kbd)
 diff --git a/nixos/modules/services/hardware/bitbox-bridge.nix b/nixos/modules/services/hardware/bitbox-bridge.nix
 index 483453de339e..e7300803efe6 100644
 --- a/nixos/modules/services/hardware/bitbox-bridge.nix
@@ -1313,8 +1359,21 @@
        in
        {
          name = "lib/${taDir}/${taFile}";
+diff --git a/nixos/modules/services/monitoring/grafana-image-renderer.nix b/nixos/modules/services/monitoring/grafana-image-renderer.nix
+index 759006ec52b8..aa43e38c621e 100644
+--- a/nixos/modules/services/monitoring/grafana-image-renderer.nix
++++ b/nixos/modules/services/monitoring/grafana-image-renderer.nix
+@@ -25,7 +25,7 @@ let
+
+     generate = lib.flip lib.pipe [
+       # Remove legacy option prefixes that only exist for backwards-compat
+-      (lib.flip builtins.removeAttrs [
++      (lib.flip removeAttrs [
+         "service"
+         "rendering"
+         "assertions"
 diff --git a/nixos/modules/services/monitoring/grafana.nix b/nixos/modules/services/monitoring/grafana.nix
-index 46da20bec8ad..6dac5d6fd06d 100644
+index 8c58b0ba70d0..76a4ea088f31 100644
 --- a/nixos/modules/services/monitoring/grafana.nix
 +++ b/nixos/modules/services/monitoring/grafana.nix
 @@ -13,7 +13,7 @@ let
@@ -1413,6 +1472,25 @@
      "Identity"
      "Pinning"
    ];
+diff --git a/nixos/modules/services/network-filesystems/openafs/server.nix b/nixos/modules/services/network-filesystems/openafs/server.nix
+index a9656bafb26d..43370bea3809 100644
+--- a/nixos/modules/services/network-filesystems/openafs/server.nix
++++ b/nixos/modules/services/network-filesystems/openafs/server.nix
+@@ -303,12 +303,12 @@ 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 = [
 diff --git a/nixos/modules/services/networking/aria2.nix b/nixos/modules/services/networking/aria2.nix
 index 24fe3452927e..18edd9efe960 100644
 --- a/nixos/modules/services/networking/aria2.nix
@@ -1488,6 +1566,63 @@
                  extraConfig = ''
                    proxy_pass_header Authorization;
                  '';
+diff --git a/nixos/modules/services/networking/firewalld/service.nix b/nixos/modules/services/networking/firewalld/service.nix
+index 92db5b251d10..c228875bf283 100644
+--- a/nixos/modules/services/networking/firewalld/service.nix
++++ b/nixos/modules/services/networking/firewalld/service.nix
+@@ -105,12 +105,12 @@ in
+               (toXmlAttrs { inherit (value) version; })
+               {
+                 inherit (value) short description;
+-                port = builtins.map toXmlAttrs value.ports;
+-                protocol = builtins.map (mkXmlAttr "value") value.protocols;
+-                source-port = builtins.map toXmlAttrs value.sourcePorts;
++                port = map toXmlAttrs value.ports;
++                protocol = map (mkXmlAttr "value") value.protocols;
++                source-port = map toXmlAttrs value.sourcePorts;
+                 destination = toXmlAttrs value.destination;
+-                include = builtins.map (mkXmlAttr "service") value.includes;
+-                helper = builtins.map (mkXmlAttr "name") value.helpers;
++                include = map (mkXmlAttr "service") value.includes;
++                helper = map (mkXmlAttr "name") value.helpers;
+               }
+             ]
+           );
+diff --git a/nixos/modules/services/networking/firewalld/zone.nix b/nixos/modules/services/networking/firewalld/zone.nix
+index 574c45304dd8..a38c1d934b81 100644
+--- a/nixos/modules/services/networking/firewalld/zone.nix
++++ b/nixos/modules/services/networking/firewalld/zone.nix
+@@ -249,7 +249,7 @@ in
+         source = format.generate "firewalld-zone-${name}.xml" {
+           zone =
+             let
+-              mkXmlAttrList = name: builtins.map (mkXmlAttr name);
++              mkXmlAttrList = name: map (mkXmlAttr name);
+               mkXmlTag = value: if value then "" else null;
+             in
+             filterNullAttrs (
+@@ -259,17 +259,17 @@ in
+                 (mkXmlAttr "egress-priority" value.egressPriority)
+                 {
+                   interface = mkXmlAttrList "name" value.interfaces;
+-                  source = builtins.map toXmlAttrs value.sources;
++                  source = map toXmlAttrs value.sources;
+                   icmp-block-inversion = mkXmlTag value.icmpBlockInversion;
+                   forward = mkXmlTag value.forward;
+                   inherit (value) short description;
+                   service = mkXmlAttrList "name" value.services;
+-                  port = builtins.map toXmlAttrs value.ports;
++                  port = map toXmlAttrs value.ports;
+                   protocol = mkXmlAttrList "value" value.protocols;
+                   icmp-block = mkXmlAttrList "name" value.icmpBlocks;
+                   masquerade = mkXmlTag value.masquerade;
+-                  forward-port = builtins.map toXmlAttrs (builtins.map filterNullAttrs value.forwardPorts);
+-                  source-port = builtins.map toXmlAttrs value.sourcePorts;
++                  forward-port = map toXmlAttrs (map filterNullAttrs value.forwardPorts);
++                  source-port = map toXmlAttrs value.sourcePorts;
+                   rule = value.rules;
+                 }
+               ]
 diff --git a/nixos/modules/services/networking/harmonia.nix b/nixos/modules/services/networking/harmonia.nix
 index 8f495bb0cca1..b8717e5fb0b6 100644
 --- a/nixos/modules/services/networking/harmonia.nix
@@ -1556,6 +1691,19 @@
            } ${cfg.server.ip} ${cfg.server.domain}";
            serviceConfig = {
              # Filesystem access
+diff --git a/nixos/modules/services/networking/meshtasticd.nix b/nixos/modules/services/networking/meshtasticd.nix
+index d72affb8b6df..3afa29a0c0b8 100644
+--- a/nixos/modules/services/networking/meshtasticd.nix
++++ b/nixos/modules/services/networking/meshtasticd.nix
+@@ -115,7 +115,7 @@ 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";
+       };
 diff --git a/nixos/modules/services/networking/nat-iptables.nix b/nixos/modules/services/networking/nat-iptables.nix
 index 16cd8c4686b5..650b71b038cf 100644
 --- a/nixos/modules/services/networking/nat-iptables.nix
@@ -1784,20 +1932,20 @@
        {
          key = i.key;
 diff --git a/nixos/modules/services/networking/ntp/chrony.nix b/nixos/modules/services/networking/ntp/chrony.nix
-index 2002f2eca8c6..0db28f490be6 100644
+index f852d7a8210a..a76a642805bc 100644
 --- a/nixos/modules/services/networking/ntp/chrony.nix
 +++ b/nixos/modules/services/networking/ntp/chrony.nix
-@@ -30,7 +30,7 @@ let
-     ${optionalString (cfg.enableRTCTrimming) "rtcfile ${rtcFile}"}
-     ${optionalString (cfg.enableNTS) "ntsdumpdir ${stateDir}"}
-
--    ${optionalString (cfg.enableRTCTrimming) "rtcautotrim ${builtins.toString cfg.autotrimThreshold}"}
-+    ${optionalString (cfg.enableRTCTrimming) "rtcautotrim ${toString cfg.autotrimThreshold}"}
-     ${optionalString (!config.time.hardwareClockInLocalTime) "rtconutc"}
+@@ -28,7 +28,7 @@ let
+     ${lib.optionalString (cfg.enableRTCTrimming) "rtcfile ${rtcFile}"}
+     ${lib.optionalString (cfg.enableNTS) "ntsdumpdir ${stateDir}"}
+
+-    ${lib.optionalString (cfg.enableRTCTrimming) "rtcautotrim ${builtins.toString cfg.autotrimThreshold}"}
++    ${lib.optionalString (cfg.enableRTCTrimming) "rtcautotrim ${toString cfg.autotrimThreshold}"}
+     ${lib.optionalString (!config.time.hardwareClockInLocalTime) "rtconutc"}

      ${cfg.extraConfig}
 @@ -236,7 +236,7 @@ in
-       unitConfig.ConditionCapability = "CAP_SYS_TIME";
+       };
        serviceConfig = {
          Type = "notify";
 -        ExecStart = "${chronyPkg}/bin/chronyd ${builtins.toString chronyFlags}";
@@ -1968,19 +2116,6 @@

    privateKeyCredential = interfaceName: escapeCredentialName "wireguard-${interfaceName}-private-key";
    presharedKeyCredential =
-diff --git a/nixos/modules/services/networking/yggdrasil.nix b/nixos/modules/services/networking/yggdrasil.nix
-index 5d1ecd7f4797..c773ff3799ef 100644
---- a/nixos/modules/services/networking/yggdrasil.nix
-+++ b/nixos/modules/services/networking/yggdrasil.nix
-@@ -166,7 +166,7 @@ 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' \
 diff --git a/nixos/modules/services/printing/cups-pdf.nix b/nixos/modules/services/printing/cups-pdf.nix
 index 25c5fb8a89b1..a5fd0c3c1f6d 100644
 --- a/nixos/modules/services/printing/cups-pdf.nix
@@ -2190,8 +2325,29 @@
        in
        {
          sks-db = {
+diff --git a/nixos/modules/services/system/nix-daemon-firewall.nix b/nixos/modules/services/system/nix-daemon-firewall.nix
+index 9c3945d3c9ef..d3f89cc50c06 100644
+--- a/nixos/modules/services/system/nix-daemon-firewall.nix
++++ b/nixos/modules/services/system/nix-daemon-firewall.nix
+@@ -117,14 +117,14 @@ 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
+           ''}
 diff --git a/nixos/modules/services/web-apps/akkoma.nix b/nixos/modules/services/web-apps/akkoma.nix
-index f88e8db6fa5b..8a26caf1f2d2 100644
+index 250f799718ab..c351c87e72a8 100644
 --- a/nixos/modules/services/web-apps/akkoma.nix
 +++ b/nixos/modules/services/web-apps/akkoma.nix
 @@ -965,12 +965,12 @@ in
@@ -2237,30 +2393,8 @@
          Restart = "on-failure";
          RestartSec = "5s";
          ConfigurationDirectory = [ "artalk" ];
-diff --git a/nixos/modules/services/web-apps/crabfit.nix b/nixos/modules/services/web-apps/crabfit.nix
-index 77275a6acdd9..369b3b21ad98 100644
---- a/nixos/modules/services/web-apps/crabfit.nix
-+++ b/nixos/modules/services/web-apps/crabfit.nix
-@@ -118,7 +118,7 @@ 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}";
-         }
-@@ -140,7 +140,7 @@ in
-
-         environment = {
-           NEXT_PUBLIC_API_URL = "https://${cfg.api.host}";
--          PORT = builtins.toString cfg.frontend.port;
-+          PORT = toString cfg.frontend.port;
-         }
-         // cfg.frontend.environment;
-       };
 diff --git a/nixos/modules/services/web-apps/cryptpad.nix b/nixos/modules/services/web-apps/cryptpad.nix
-index 4a38d9589678..c340ce13175e 100644
+index cc24766b4763..ddb7ad88119a 100644
 --- a/nixos/modules/services/web-apps/cryptpad.nix
 +++ b/nixos/modules/services/web-apps/cryptpad.nix
 @@ -186,8 +186,8 @@ in
@@ -2448,6 +2582,19 @@
          };
        };

+diff --git a/nixos/modules/services/web-apps/librechat.nix b/nixos/modules/services/web-apps/librechat.nix
+index a1cfd2e67559..95f684a491f6 100644
+--- a/nixos/modules/services/web-apps/librechat.nix
++++ b/nixos/modules/services/web-apps/librechat.nix
+@@ -205,7 +205,7 @@ 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;
 diff --git a/nixos/modules/services/web-apps/mastodon.nix b/nixos/modules/services/web-apps/mastodon.nix
 index 9d71b8112cf4..8021abb42ede 100644
 --- a/nixos/modules/services/web-apps/mastodon.nix
@@ -3301,6 +3448,33 @@
              # Note: Firefox doesn't use a regular "-" in the window title, but "—" (Hex: 0xe2 0x80 0x94)
              machine.wait_for_window("Test — Mozilla Firefox")
              machine.send_key("ctrl-minus")
+diff --git a/nixos/tests/gitlab/runner/podman-runner/nix-image.nix b/nixos/tests/gitlab/runner/podman-runner/nix-image.nix
+index 43c11ae25175..bfb11e9573d9 100644
+--- a/nixos/tests/gitlab/runner/podman-runner/nix-image.nix
++++ b/nixos/tests/gitlab/runner/podman-runner/nix-image.nix
+@@ -219,7 +219,7 @@ let
+         cat > $out <<EOF
+         [
+         ${lib.concatStringsSep "\n" (
+-          builtins.map (
++          map (
+             drv:
+             let
+               outputs = drv.outputsToInstall or [ "out" ];
+@@ -227,11 +227,11 @@ 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}";
 diff --git a/nixos/tests/glance.nix b/nixos/tests/glance.nix
 index dce1c29a4f06..9a92f0c458ea 100644
 --- a/nixos/tests/glance.nix
@@ -3579,6 +3753,22 @@
              pkgs.writeText "ncps-cache-key" "ncps:dcrGsrku0KvltFhrR5lVIMqyloAdo0y8vYZOeIFUSLJS2IToL7dPHSSCk/fi+PJf8EorpBn8PU7MNhfvZoI8mA=="
            );
          };
+diff --git a/nixos/tests/networking/meshtasticd.nix b/nixos/tests/networking/meshtasticd.nix
+index 121886e7910a..d46dbe742ad5 100644
+--- a/nixos/tests/networking/meshtasticd.nix
++++ b/nixos/tests/networking/meshtasticd.nix
+@@ -38,8 +38,8 @@ 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'")
+   '';
+ }
 diff --git a/nixos/tests/networking/networkd-and-scripted.nix b/nixos/tests/networking/networkd-and-scripted.nix
 index b75f82218a69..257fd07d1eb3 100644
 --- a/nixos/tests/networking/networkd-and-scripted.nix
@@ -3617,6 +3807,19 @@
      (packageName: {
        name = packageName;
        value = runTest {
+diff --git a/nixos/tests/onlyoffice.nix b/nixos/tests/onlyoffice.nix
+index bf0960671247..67e4f8505709 100644
+--- a/nixos/tests/onlyoffice.nix
++++ b/nixos/tests/onlyoffice.nix
+@@ -24,7 +24,7 @@ in
+   testScript = ''
+     machine.wait_for_unit("onlyoffice-docservice.service")
+     machine.wait_for_unit("onlyoffice-converter.service")
+-    machine.wait_for_open_port(${builtins.toString port})
++    machine.wait_for_open_port(${toString port})
+     machine.succeed("curl --fail http://office.example.com/healthcheck")
+   '';
+ }
 diff --git a/nixos/tests/predictable-interface-names.nix b/nixos/tests/predictable-interface-names.nix
 index 62cafb1c2c48..8ab29a73cd4f 100644
 --- a/nixos/tests/predictable-interface-names.nix

Notably, I generalized the script as follows:

--- 2025-11-16 (dc9c0ac7b54813a95edf964b742d6cfe3fc29bcb)
+++ 2026-01-15 (a2ed7e8d882c2b9deba7b7c2cc8e1a97b29aa415)
@@ -32,7 +32,7 @@
         )

         fd \
-          --exclude doc/manual/release-notes/rl-2411.section.md \
+          --exclude doc/manual/release-notes \
           --type file \
           . \
           nixos \

@MattSturgeon

This comment was marked as outdated.

@MattSturgeon MattSturgeon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I skimmed the diff very quickly again. No obvious issues.

Rebuild count isn't particularly relevant to NixOS modules, but only seeing two is still encouraging:

I'll run a nixpkgs-review just to be safe (not sure if nixpkgs-review-gha will be able to build tests.nixos-functions.nixos-test, but we'll see). EDIT: ah, it's blacklisted.

I aim to get this merged promptly before the inevitable conflicts reappear. If issues are found post-merge we can fix or revert as necessary.

@MattSturgeon

Copy link
Copy Markdown
Contributor
  • tests.nixos-functions.nixos-test

Built fine locally

@MattSturgeon MattSturgeon added this pull request to the merge queue Jan 15, 2026
Merged via the queue into NixOS:master with commit c078ee6 Jan 15, 2026
29 of 32 checks passed
@bjornfor

Copy link
Copy Markdown
Contributor

This needs to be backported or else other backports are going to be difficult.

@nixpkgs-ci

nixpkgs-ci Bot commented Jan 16, 2026

Copy link
Copy Markdown
Contributor

Backport failed for release-25.11, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release-25.11
git worktree add -d .worktree/backport-447403-to-release-25.11 origin/release-25.11
cd .worktree/backport-447403-to-release-25.11
git switch --create backport-447403-to-release-25.11
git cherry-pick -x a2ed7e8d882c2b9deba7b7c2cc8e1a97b29aa415

@bjornfor

Copy link
Copy Markdown
Contributor

@trueNAHO: Can you create a new PR for the release-25.11 branch, please? (I presume since it's auto-generated that it might be easier to do it that way than to cherry-pick and resolve conflicts.)

@MattSturgeon

MattSturgeon commented Jan 16, 2026

Copy link
Copy Markdown
Contributor

This needs to be backported or else other backports are going to be difficult.

Good point. This applies equally to the other PRs in this series:

  1. doc: remove optional builtins prefixes from prelude functions #447401
  2. lib: remove optional builtins prefixes from prelude functions #447402
  3. pkgs: remove optional builtins prefixes from prelude functions #447404
  4. treewide: remove optional builtins prefixes from prelude functions #444432

We asked for the initial PRs to be split for easier review, however I'm fine to review a single backport.

Can you create a new PR for the release-25.11 branch, please? (I presume since it's auto-generated that it might be easier to do it that way than to cherry-pick and resolve conflicts.)

If the backport is made of 5 commits (freshly generated, but still tagged with (cherry picked from commit ...)), then CI will be able to higlight the difference with the original commits from master, aiding review.

@bjornfor

Copy link
Copy Markdown
Contributor

Sure, do whatever feels best 😃

@trueNAHO

trueNAHO commented Jan 16, 2026

Copy link
Copy Markdown
Member Author

@trueNAHO: Can you create a new PR for the release-25.11 branch, please? (I presume since it's auto-generated that it might be easier to do it that way than to cherry-pick and resolve conflicts.)

I opened #480781.

This needs to be backported or else other backports are going to be difficult.

Good point. This applies equally to the other PRs in this series:

  1. doc: remove optional builtins prefixes from prelude functions #447401
  2. lib: remove optional builtins prefixes from prelude functions #447402
  3. pkgs: remove optional builtins prefixes from prelude functions #447404
  4. treewide: remove optional builtins prefixes from prelude functions #444432

We asked for the initial PRs to be split for easier review, however I'm fine to review a single backport.

Based on the following output, the other PRs were already merged prior to the release-25.11 branch-off, meaning only this PR needs to be backported to release-25.11:

$ for commit in \
      b50da098117870e48cba6c110d290cb2a2dadf93 \
      44998896c6a811fcc4021e8ca75243b5d53e605b \
      6d1d15bb3610a98c8d6ba63e7e792cec53215227 \
      c078ee646535e63a08f709d3f1b5d122407e6f12 \
      d9335d5dd7057963bf0006432427e115b2825c4d
  do
      git merge-base --is-ancestor "$commit" release-25.11 || echo "$commit"
  done
c078ee646535e63a08f709d3f1b5d122407e6f12

Can you create a new PR for the release-25.11 branch, please? (I presume since it's auto-generated that it might be easier to do it that way than to cherry-pick and resolve conflicts.)

If the backport is made of 5 commits (freshly generated, but still tagged with (cherry picked from commit ...)), then CI will be able to higlight the difference with the original commits from master, aiding review.

Are you referring to some general GitHub feature, or just #480781 (review)? I usually run something like the following locally:

diff <(git show "$COMMIT_1") <(git show "$COMMIT_2")

@MattSturgeon

Copy link
Copy Markdown
Contributor

If the backport is made of 5 commits (freshly generated, but still tagged with (cherry picked from commit ...)), then CI will be able to higlight the difference with the original commits from master, aiding review.

Are you referring to some general GitHub feature, or just #480781 (review)?

I was refering to that review that our CI posts, yes. GitHub doesn't have any native features for inspection backports and comparing them to the original.

I usually run something like the following locally:

diff <(git show "$COMMIT_1") <(git show "$COMMIT_2")

That's essentially what our CI does. It relies on the backport having a (cherry picked from commit ...) tag to know which commit to compare with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: hardware Drivers, Firmware and Kernels 6.topic: k3s Kubernates distribution (https://k3s.io/) 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: nixos-container Imperative and declarative systemd-nspawn containers 6.topic: printing Drivers, CUPS & Co. 6.topic: systemd Software suite that provides an array of system components for Linux operating systems. 6.topic: testing Tooling for automated testing of packages and modules 6.topic: vim Advanced text editor 8.has: documentation This PR adds or changes documentation 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 2 This PR was reviewed and approved by two persons.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants