this shouldn't create any rebuilds
the move was done with the following script
```fish
#!/usr/bin/env fish
# nix shell .#nixfmt nixpkgs#{nixf-diagnose,ripgrep,sd}
set base (git rev-parse HEAD)
set scope pkgs/by-name
set builder buildRustPackage
set files (rg --files-with-matches -F "$builder rec {" $scope | sort -u)
for file in $files
echo $file
sd -F "$builder rec {" "$builder (finalAttrs: {" $file
# version
sd -F 'version}' 'finalAttrs.version}' $file
sd -F '${version' '${finalAttrs.version' $file
sd -F '= version' '= finalAttrs.version' $file
sd -F 'inherit version;' 'inherit (finalAttrs) version;' $file
sd -F ' + version;' ' + finalAttrs.version;' $file
sd 'replaceStrings (.*) version' 'replaceStrings $1 finalAttrs.version' $file
sd -F 'splitVersion version' 'splitVersion finalAttrs.version' $file
sd -F 'versionAtLeast version' 'versionAtLeast finalAttrs.version' $file
sd 'versions\.([a-z]+) version' 'versions.$1 finalAttrs.version' $file
# src
sd -F 'src}' 'finalAttrs.src}' $file
sd -F '${src' '${finalAttrs.src' $file
sd -F '= src' '= finalAttrs.src' $file
sd -F 'inherit src;' 'inherit (finalAttrs) src;' $file
sd -F 'inherit (src' 'inherit (finalAttrs.src' $file
# pname
sd -F 'pname}' 'finalAttrs.pname}' $file
sd -F '${pname' '${finalAttrs.pname' $file
sd -F '= pname' '= finalAttrs.pname' $file
sd -F 'inherit pname;' 'inherit (finalAttrs) pname;' $file
# combinations
sd -F 'inherit version src;' 'inherit (finalAttrs) version src;' $file
sd -F 'inherit src version;' 'inherit (finalAttrs) src version;' $file
sd -F 'inherit version pname;' 'inherit (finalAttrs) version pname;' $file
sd -F 'inherit pname version;' 'inherit (finalAttrs) pname version;' $file
sd -F 'inherit pname src version;' 'inherit (finalAttrs) pname src version;' $file
sd -F 'inherit pname version src;' 'inherit (finalAttrs) pname version src;' $file
sd -F 'inherit src pname version;' 'inherit (finalAttrs) src pname version;' $file
sd -F 'inherit src version pname;' 'inherit (finalAttrs) src version pname;' $file
sd -F 'inherit version pname src;' 'inherit (finalAttrs) version pname src;' $file
sd -F 'inherit version src pname;' 'inherit (finalAttrs) version src pname;' $file
# meta
sd -F '${meta' '${finalAttrs.meta' $file
sd -F '= meta' '= finalAttrs.meta' $file
sd -F 'inherit (meta' 'inherit (finalAttrs.meta' $file
# cargo
sd -F 'cargoRoot}' 'finalAttrs.cargoRoot}' $file
sd -F '${cargoRoot' '${finalAttrs.cargoRoot' $file
sd -F '= cargoRoot' '= finalAttrs.cargoRoot' $file
sd -F 'cargoBuildFlags}' 'finalAttrs.cargoBuildFlags}' $file
sd -F '${cargoBuildFlags' '${finalAttrs.cargoBuildFlags' $file
sd -F '= cargoBuildFlags' '= finalAttrs.cargoBuildFlags' $file
# patches
sd -F 'patches}' 'finalAttrs.patches}' $file
sd -F '${patches' '${finalAttrs.patches' $file
sd -F '= patches' '= finalAttrs.patches' $file
# passthru
sd -F 'passthru}' 'finalAttrs.passthru}' $file
sd -F '${passthru' '${finalAttrs.passthru' $file
sd -F '= passthru' '= finalAttrs.passthru' $file
# *buildInputs
sd -F 'buildInputs}' 'finalAttrs.buildInputs}' $file
sd -F 'makeLibraryPath buildInputs' 'makeLibraryPath finalAttrs.buildInputs' $file
sd -F 'nativeBuildInputs}' 'finalAttrs.nativeBuildInputs}' $file
sd -F 'propagatedBuildInputs}' 'finalAttrs.propagatedBuildInputs}' $file
# other
sd -F 'desktopItem}' 'finalAttrs.desktopItem}' $file
sd -F 'runtimeLibs}' 'finalAttrs.runtimeLibs}' $file
sd -F 'libPath}' 'finalAttrs.libPath}' $file
sd -F 'runtimeDependencies}' 'finalAttrs.runtimeDependencies}' $file
sd -F 'nativeRuntimeInputs}' 'finalAttrs.nativeRuntimeInputs}' $file
sd -F '(!doCheck)' '(!finalAttrs.doCheck)' $file
sd -F 'optional doCheck' 'optional finalAttrs.doCheck' $file
sd -F 'optionals doCheck' 'optionals finalAttrs.doCheck' $file
sd -F '++ runtimeDependencies' '++ finalAttrs.runtimeDependencies' $file
# close finalAttrs lambda
echo ')' >>$file
# catch some errors early
if ! nixfmt $file
git restore $file
continue
end
if ! nixf-diagnose -i sema-primop-overridden $file
git restore $file
continue
end
end
set torestore (rg -F .finalAttrs --files-with-matches $scope)
if test (count $torestore) -gt 0
git restore $torestore
end
# set torestore (rg -F finalAttrs.pname --files-with-matches $scope)
# if test (count $torestore) -gt 0
# git restore $torestore
# end
# commit for faster eval times
git add pkgs
git commit --no-gpg-sign -m temp
set torestore
for file in $files
# file hasn't changed
if git diff --quiet $base $file
continue
end
# try to eval the package to definitely catch all errors
echo $file
set pname (string split / $file -f 4)
if ! nix eval .#$pname
set torestore $torestore $file
end
end
# restore files that don't eval
git reset --soft $base
git restore --staged .
if test (count $torestore) -gt 0
git restore $torestore
end
```
after that some manual cleanup was done:
- restore all files that cause merge conflicts with staging
# Conflicts:
# pkgs/by-name/ca/cargo-chef/package.nix
# pkgs/by-name/ca/cargo-public-api/package.nix
# pkgs/by-name/ca/cargo-update/package.nix
# pkgs/by-name/le/leetcode-cli/package.nix
Nixpkgs is a collection of over 120,000 software packages that can be installed with the Nix package manager. It also implements NixOS, a purely-functional Linux distribution.
Manuals
- NixOS Manual - how to install, configure, and maintain a purely-functional Linux distribution
- Nixpkgs Manual - contributing to Nixpkgs and using programming-language-specific Nix expressions
- Nix Package Manager Manual - how to write Nix expressions (programs), and how to use Nix command line tools
Community
- Discourse Forum
- Matrix Chat
- Official wiki
- Community-maintained list of ways to get in touch (Discord, Telegram, IRC, etc.)
Other Project Repositories
The sources of all official Nix-related projects are in the NixOS organization on GitHub. Here are some of the main ones:
- Nix - the purely functional package manager
- NixOps - the tool to remotely deploy NixOS machines
- nixos-hardware - NixOS profiles to optimize settings for different hardware
- Nix RFCs - the formal process for making substantial changes to the community
- NixOS homepage - the NixOS.org website
- hydra - our continuous integration system
- NixOS Branding - NixOS branding
Continuous Integration and Distribution
Nixpkgs and NixOS are built and tested by our continuous integration system, Hydra.
- Continuous package builds for unstable/master
- Continuous package builds for the NixOS 25.11 release
- Tests for unstable/master
- Tests for the NixOS 25.11 release
Artifacts successfully built with Hydra are published to cache at https://cache.nixos.org/. When successful build and test criteria are met, the Nixpkgs expressions are distributed via Nix channels.
Contributing
Nixpkgs is among the most active projects on GitHub. While thousands of open issues and pull requests might seem like a lot at first, it helps to consider it in the context of the scope of the project. Nixpkgs describes how to build tens of thousands of pieces of software and implements a Linux distribution. The GitHub Insights page gives a sense of the project activity.
Community contributions are always welcome through GitHub Issues and Pull Requests.
For more information about contributing to the project, please visit the contributing page.
Donations
The infrastructure for NixOS and related projects is maintained by a nonprofit organization, the NixOS Foundation. To ensure the continuity and expansion of the NixOS infrastructure, we are looking for donations to our organization.
You can donate to the NixOS Foundation through SEPA bank transfers or by using Open Collective:
License
Nixpkgs is licensed under the MIT License.
Note
MIT license does not apply to the packages built by Nixpkgs, merely to the files in this repository (the Nix expressions, build scripts, NixOS modules, etc.). It also might not apply to patches included in Nixpkgs, which may be derivative works of the packages to which they apply. The aforementioned artifacts are all covered by the licenses of the respective packages.