From fbe17ff811ff0ed41b8b4271910e1947e864bcd5 Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Sun, 17 Aug 2025 11:12:50 +0200 Subject: [PATCH 1/6] windows.mingw_w64_pthreads: put deprecation behind alias --- pkgs/os-specific/windows/default.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/windows/default.nix b/pkgs/os-specific/windows/default.nix index 3cfdb8c7e85da..3a8813b15aaa8 100644 --- a/pkgs/os-specific/windows/default.nix +++ b/pkgs/os-specific/windows/default.nix @@ -1,5 +1,6 @@ { lib, + config, stdenv, buildPackages, pkgs, @@ -9,7 +10,9 @@ }: lib.makeScope newScope ( - self: with self; { + self: + with self; + { dlfcn = callPackage ./dlfcn { }; mingw_w64 = callPackage ./mingw-w64 { @@ -31,8 +34,6 @@ lib.makeScope newScope ( mingw_w64_headers = callPackage ./mingw-w64/headers.nix { }; - mingw_w64_pthreads = lib.warn "windows.mingw_w64_pthreads is deprecated, windows.pthreads should be preferred" self.pthreads; - mcfgthreads = callPackage ./mcfgthreads { stdenv = crossThreadsStdenv; }; npiperelay = callPackage ./npiperelay { }; @@ -43,4 +44,7 @@ lib.makeScope newScope ( sdk = callPackage ./msvcSdk { }; } + // lib.optionalAttrs config.allowAliases { + mingw_w64_pthreads = lib.warn "windows.mingw_w64_pthreads is deprecated, windows.pthreads should be preferred" self.pthreads; + } ) From 10795162f8695729351e68b0e3dd3f3569b34e0e Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Sun, 17 Aug 2025 11:37:58 +0200 Subject: [PATCH 2/6] windows.sdk: move throw behind meta.license check --- pkgs/os-specific/windows/msvcSdk/default.nix | 194 ++++++++++--------- 1 file changed, 98 insertions(+), 96 deletions(-) diff --git a/pkgs/os-specific/windows/msvcSdk/default.nix b/pkgs/os-specific/windows/msvcSdk/default.nix index 17e0cce656a6d..f57d2bf90de96 100644 --- a/pkgs/os-specific/windows/msvcSdk/default.nix +++ b/pkgs/os-specific/windows/msvcSdk/default.nix @@ -24,102 +24,104 @@ let else throw "Unsupported system"; in -if !config.microsoftVisualStudioLicenseAccepted then - throw '' - Microsoft Software License Terms are not accepted with config.microsoftVisualStudioLicenseAccepted. - Please read https://visualstudio.microsoft.com/license-terms/mt644918/ and if you agree, change your - config to indicate so. - '' -else - stdenvNoCC.mkDerivation (finalAttrs: { - inherit version; - pname = "msvc-sdk"; - dontUnpack = true; - - strictDeps = true; - nativeBuildInputs = [ xwin ]; - - outputHashAlgo = "sha256"; - outputHashMode = "recursive"; - outputHash = hashes.${arch}; - - __structuredAttrs = true; - xwinArgs = [ - "--accept-license" - "--cache-dir=xwin-out" - "--manifest=${./manifest.json}" - "--arch=${arch}" - "splat" - "--preserve-ms-arch-notation" - ]; - - buildPhase = '' - runHook preBuild - - xwin "''${xwinArgs[@]}" - mkdir "$out" - mv xwin-out/splat/* "$out" - - runHook postBuild - ''; - - dontFixup = true; - dontInstall = true; - - passthru = { - updateScript = ./update.nu; - tests = { - hello-world = testers.runCommand { - name = "hello-msvc"; - - nativeBuildInputs = [ - llvmPackages.clang-unwrapped - llvmPackages.bintools-unwrapped - ]; - - script = '' - set -euo pipefail - - cat > hello.c <<- EOF - #include - - int main(int argc, char* argv[]) { - printf("Hello world!\n"); - return 0; - } - EOF - - clang-cl --target=x86_64-pc-windows-msvc -fuse-ld=lld \ - /vctoolsdir ${finalAttrs.finalPackage}/crt \ - /winsdkdir ${finalAttrs.finalPackage}/sdk \ - ./hello.c -v - - if test ! -f hello.exe; then - echo "hello.exe not found!" - exit 1 - else - touch $out - fi - ''; - }; +stdenvNoCC.mkDerivation (finalAttrs: { + inherit version; + pname = "msvc-sdk"; + dontUnpack = true; + + strictDeps = true; + nativeBuildInputs = [ xwin ]; + + outputHashAlgo = "sha256"; + outputHashMode = "recursive"; + outputHash = + if !config.microsoftVisualStudioLicenseAccepted then + throw '' + Microsoft Software License Terms are not accepted with config.microsoftVisualStudioLicenseAccepted. + Please read https://visualstudio.microsoft.com/license-terms/mt644918/ and if you agree, change your + config to indicate so. + '' + else + hashes.${arch}; + + __structuredAttrs = true; + xwinArgs = [ + "--accept-license" + "--cache-dir=xwin-out" + "--manifest=${./manifest.json}" + "--arch=${arch}" + "splat" + "--preserve-ms-arch-notation" + ]; + + buildPhase = '' + runHook preBuild + + xwin "''${xwinArgs[@]}" + mkdir "$out" + mv xwin-out/splat/* "$out" + + runHook postBuild + ''; + + dontFixup = true; + dontInstall = true; + + passthru = { + updateScript = ./update.nu; + tests = { + hello-world = testers.runCommand { + name = "hello-msvc"; + + nativeBuildInputs = [ + llvmPackages.clang-unwrapped + llvmPackages.bintools-unwrapped + ]; + + script = '' + set -euo pipefail + + cat > hello.c <<- EOF + #include + + int main(int argc, char* argv[]) { + printf("Hello world!\n"); + return 0; + } + EOF + + clang-cl --target=x86_64-pc-windows-msvc -fuse-ld=lld \ + /vctoolsdir ${finalAttrs.finalPackage}/crt \ + /winsdkdir ${finalAttrs.finalPackage}/sdk \ + ./hello.c -v + + if test ! -f hello.exe; then + echo "hello.exe not found!" + exit 1 + else + touch $out + fi + ''; }; }; - - meta = { - description = "MSVC SDK and Windows CRT for cross compiling"; - homepage = "https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/"; - maintainers = [ lib.maintainers.RossSmyth ]; - license = { - deprecated = false; - fullName = "Microsoft Software License Terms"; - shortName = "msvc"; - spdxId = "unknown"; - url = "https://www.visualstudio.com/license-terms/mt644918/"; - }; - platforms = lib.platforms.all; - # The arm32 manifest is missing critical pieces. - broken = stdenvNoCC.hostPlatform.isAarch32; - sourceProvenance = [ lib.sourceTypes.binaryNativeCode ]; - teams = [ lib.teams.windows ]; + }; + + meta = { + description = "MSVC SDK and Windows CRT for cross compiling"; + homepage = "https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/"; + maintainers = [ lib.maintainers.RossSmyth ]; + license = { + deprecated = false; + fullName = "Microsoft Software License Terms"; + shortName = "msvc"; + spdxId = "unknown"; + free = false; + url = "https://www.visualstudio.com/license-terms/mt644918/"; }; - }) + platforms = lib.platforms.all; + # The arm32 manifest is missing critical pieces. + broken = stdenvNoCC.hostPlatform.isAarch32; + sourceProvenance = [ lib.sourceTypes.binaryNativeCode ]; + teams = [ lib.teams.windows ]; + }; +}) From 1cdfcf64c11af0e6315991c4fee550058502f375 Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Sun, 17 Aug 2025 10:58:40 +0200 Subject: [PATCH 3/6] packages-config.nix: remove redundant package sets these package set where already recoursed into --- pkgs/top-level/packages-config.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkgs/top-level/packages-config.nix b/pkgs/top-level/packages-config.nix index b90bbcb080a8e..eb69a04b807b1 100644 --- a/pkgs/top-level/packages-config.nix +++ b/pkgs/top-level/packages-config.nix @@ -11,19 +11,15 @@ with super; lib.mapAttrs (_: set: recurseIntoAttrs set) { inherit (super) - agdaPackages - apacheHttpdPackages fusePackages gns3Packages haskellPackages - idrisPackages nodePackages nodePackages_latest platformioPackages rPackages roundcubePlugins sourceHanPackages - zabbix60 windows ; From 1f4ee1015edf5ffaf9c09e7957eee9bf44fac22b Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Sun, 17 Aug 2025 11:06:41 +0200 Subject: [PATCH 4/6] packages-config.nix: eval stuff that's appearing on search.nixos.org --- pkgs/top-level/all-packages.nix | 22 +++++++++++----------- pkgs/top-level/haskell-packages.nix | 5 +++-- pkgs/top-level/packages-config.nix | 20 -------------------- 3 files changed, 14 insertions(+), 33 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 04521e6c4eab7..fac0d05a26bdf 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2330,7 +2330,7 @@ with pkgs; roundcube = callPackage ../servers/roundcube { }; - roundcubePlugins = dontRecurseIntoAttrs (callPackage ../servers/roundcube/plugins { }); + roundcubePlugins = recurseIntoAttrs (callPackage ../servers/roundcube/plugins { }); rsyslog = callPackage ../tools/system/rsyslog { withHadoop = false; # Currently Broken @@ -3461,9 +3461,9 @@ with pkgs; importNpmLock = callPackages ../build-support/node/import-npm-lock { }; - nodePackages_latest = dontRecurseIntoAttrs nodejs_latest.pkgs; + nodePackages_latest = recurseIntoAttrs nodejs_latest.pkgs; - nodePackages = dontRecurseIntoAttrs nodejs.pkgs; + nodePackages = recurseIntoAttrs nodejs.pkgs; node2nix = nodePackages.node2nix; @@ -3970,7 +3970,7 @@ with pkgs; inherit (darwin) DarwinTools; }; - platformioPackages = dontRecurseIntoAttrs (callPackage ../development/embedded/platformio { }); + platformioPackages = recurseIntoAttrs (callPackage ../development/embedded/platformio { }); platformio = if stdenv.hostPlatform.isLinux then platformioPackages.platformio-chrootenv @@ -5164,10 +5164,10 @@ with pkgs; # Haskell and GHC - haskell = callPackage ./haskell-packages.nix { }; + haskell = recurseIntoAttrs (callPackage ./haskell-packages.nix { }); haskellPackages = - dontRecurseIntoAttrs + recurseIntoAttrs # Prefer native-bignum to avoid linking issues with gmp # GHC 9.6 rts can't be built statically with hadrian, so we need to use 9.4 # until 9.8 is ready @@ -7857,7 +7857,7 @@ with pkgs; #GMP ex-satellite, so better keep it near gmp # A GMP fork - gns3Packages = dontRecurseIntoAttrs (callPackage ../applications/networking/gns3 { }); + gns3Packages = recurseIntoAttrs (callPackage ../applications/networking/gns3 { }); gns3-gui = gns3Packages.guiStable; gns3-server = gns3Packages.serverStable; @@ -9654,7 +9654,7 @@ with pkgs; rstudioServerWrapper = rstudioWrapper.override { rstudio = rstudio-server; }; - rPackages = dontRecurseIntoAttrs ( + rPackages = recurseIntoAttrs ( callPackage ../development/r-modules { overrides = (config.rPackageOverrides or (_: { })) pkgs; } @@ -10502,7 +10502,7 @@ with pkgs; inherit (linuxPackages) kernel; }; - fusePackages = dontRecurseIntoAttrs ( + fusePackages = recurseIntoAttrs ( callPackage ../os-specific/linux/fuse { util-linux = util-linuxMinimal; } @@ -10938,7 +10938,7 @@ with pkgs; v4l-utils = callPackage ../os-specific/linux/v4l-utils { }; - windows = callPackages ../os-specific/windows { }; + windows = recurseIntoAttrs (callPackages ../os-specific/windows { }); wpa_supplicant = callPackage ../os-specific/linux/wpa_supplicant { }; @@ -11184,7 +11184,7 @@ with pkgs; pretendard-std ; - sourceHanPackages = dontRecurseIntoAttrs (callPackage ../data/fonts/source-han { }); + sourceHanPackages = recurseIntoAttrs (callPackage ../data/fonts/source-han { }); source-han-sans = sourceHanPackages.sans; source-han-serif = sourceHanPackages.serif; source-han-mono = sourceHanPackages.mono; diff --git a/pkgs/top-level/haskell-packages.nix b/pkgs/top-level/haskell-packages.nix index e990d8753f55b..6504271d512b3 100644 --- a/pkgs/top-level/haskell-packages.nix +++ b/pkgs/top-level/haskell-packages.nix @@ -78,7 +78,7 @@ in # `name: pkgs: pkgs.haskell.packages.${name}.ghc == pkgs.buildPackages.haskell.compiler.${name}.ghc`. # This isn't problematic since pkgsBuildBuild.buildPackages is also build->build, # just something to keep in mind. - compiler = + compiler = pkgs.lib.recurseIntoAttrs ( let bb = pkgsBuildBuild.haskell; in @@ -496,7 +496,8 @@ in name: compiler.${name}.override { enableNativeBignum = true; } ) ); - }; + } + ); # Default overrides that are applied to all package sets. packageOverrides = self: super: { }; diff --git a/pkgs/top-level/packages-config.nix b/pkgs/top-level/packages-config.nix index eb69a04b807b1..ffec001f9812a 100644 --- a/pkgs/top-level/packages-config.nix +++ b/pkgs/top-level/packages-config.nix @@ -10,26 +10,6 @@ super: with super; lib.mapAttrs (_: set: recurseIntoAttrs set) { - inherit (super) - fusePackages - gns3Packages - haskellPackages - nodePackages - nodePackages_latest - platformioPackages - rPackages - roundcubePlugins - sourceHanPackages - windows - ; - - # Make sure haskell.compiler is included, so alternative GHC versions show up, - # but don't add haskell.packages.* since they contain the same packages (at - # least by name) as haskellPackages. - haskell = super.haskell // { - compiler = recurseIntoAttrs super.haskell.compiler; - }; - # emacsPackages is an alias for emacs.pkgs # Re-introduce emacsPackages here so that emacs.pkgs can be searched. emacsPackages = emacs.pkgs; From 288d13a9cebcb648d116d4b74fe5f746206582de Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Sun, 17 Aug 2025 16:49:12 +0200 Subject: [PATCH 5/6] packages-config.nix: move emcasPackages back to all-packages.nix and eval --- pkgs/top-level/aliases.nix | 1 - pkgs/top-level/all-packages.nix | 2 ++ pkgs/top-level/packages-config.nix | 4 ---- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 624c701df6353..0e6d140bd0355 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -820,7 +820,6 @@ mapAliases { emacsMacport = emacs-macport; # Added 2023-08-10 emacsNativeComp = emacs; # Added 2022-06-08 emacsWithPackages = throw "'emacsWithPackages' has been renamed to/replaced by 'emacs.pkgs.withPackages'"; # Converted to throw 2024-10-17 - emacsPackages = emacs.pkgs; # Added 2025-03-02 EmptyEpsilon = empty-epsilon; # Added 2024-07-14 enyo-doom = enyo-launcher; # Added 2022-09-09 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fac0d05a26bdf..542d4859de3c3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11539,6 +11539,8 @@ with pkgs; emacs-nox = emacs30-nox; emacs-pgtk = emacs30-pgtk; + emacsPackages = recurseIntoAttrs emacs.pkgs; + emacsPackagesFor = emacs: import ./emacs-packages.nix { diff --git a/pkgs/top-level/packages-config.nix b/pkgs/top-level/packages-config.nix index ffec001f9812a..6f605684ff0ec 100644 --- a/pkgs/top-level/packages-config.nix +++ b/pkgs/top-level/packages-config.nix @@ -10,10 +10,6 @@ super: with super; lib.mapAttrs (_: set: recurseIntoAttrs set) { - # emacsPackages is an alias for emacs.pkgs - # Re-introduce emacsPackages here so that emacs.pkgs can be searched. - emacsPackages = emacs.pkgs; - # minimal-bootstrap packages aren't used for anything but bootstrapping our # stdenv. They should not be used for any other purpose and therefore not # show up in search results or repository tracking services that consume our From 04948a4253fe5d4ff52852f753dfe01554764d27 Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Sun, 17 Aug 2025 16:50:07 +0200 Subject: [PATCH 6/6] packages-config.nix: only use to remove packages from search --- pkgs/top-level/packages-config.nix | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pkgs/top-level/packages-config.nix b/pkgs/top-level/packages-config.nix index 6f605684ff0ec..53efa0c446011 100644 --- a/pkgs/top-level/packages-config.nix +++ b/pkgs/top-level/packages-config.nix @@ -3,13 +3,9 @@ # Ensures no aliases are in the results. allowAliases = false; - # Enable recursion into attribute sets that nix-env normally doesn't look into - # so that we can get a more complete picture of the available packages for the - # purposes of the index. + # Remove Packages sets that we don't want to have appear on search.nixos.org and the index. packageOverrides = - super: - with super; - lib.mapAttrs (_: set: recurseIntoAttrs set) { + super: with super; { # minimal-bootstrap packages aren't used for anything but bootstrapping our # stdenv. They should not be used for any other purpose and therefore not # show up in search results or repository tracking services that consume our