Watch
2
0
Fork
You've already forked NixOS--nixpkgs
0
mirror of github.com/NixOS/nixpkgs
  • Nix 94.7%
  • Shell 2.1%
  • Python 1.9%
  • Rust 0.3%
  • Perl 0.2%
  • Other 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Robert Hensing 96898b50f7 nixpkgs: Allow passing {host,build}Platform directly instead of *[sS]ystem
This new interface has already been applied successfully in NixOS, with its
`nixpkgs.hostPlatform` and `nixpkgs.buildPlatform` options.
It has removed the need to specify the platform or its system string in
`nixosSystem` calls for `nixos-generate-config` users.
More generally, it adopting these cross compilation terms directly simplifies
the overall design, even if that's not quite reflected in the implementation
yet.

To illustrate, the `hostPlatform` option is always defined and reliably
produces the host platform for users who don't use the legacy options.
This is in contrast to `nixpkgs.crossSystem`, which is usually not
even defined, and `nixpkgs.localSystem` which is usually the wrong
platform to refer to in a config file.

Ideally we'd clean up the `nixpkgs.{system,localSystem,crossSystem}`
options to reduce complexity and confusion. But the interface in
Nixpkgs was still based on the old terminology and behavior.
By introducing these parameters also in Nixpkgs, the users experience
from NixOS carries over to Nixpkgs.

Further simplifications in the code base are now possible, specifically

- stage.nix and related files still work with {local,cross}System,
  and have logic like

      ${if stdenv.hostPlatform == stdenv.buildPlatform
        then "localSystem" else "crossSystem"} = <...>

  ... which is really just

      hostPlatform = <...>

  This can now be simplified by refactoring this code to work with
  {host,build}Platform variables instead.

- NixOS can forward its platform options directly to its Nixpkgs call.
  This pays off when the `*[sS]ystem` options are removed.

[without much trouble]: https://github.com/NixOS/nixpkgs/pull/237218
2026-11-21 16:25:21 +01:00
.devcontainer .devcontainer: update devcontainer image version to 5-linux 2026-03-24 06:49:43 +00:00
.github workflows/periodic-merges: integrate with staging-26.11 2026-11-16 09:36:26 +01:00
ci ci/treefmt: add jq for json terraform-providers 2026-11-18 09:03:20 +10:00
doc nixpkgs: Allow passing {host,build}Platform directly instead of *[sS]ystem 2026-11-21 16:25:21 +01:00
lib lib.systems: warn on usage of mingw aliases (#506402) 2026-11-17 19:54:41 +00:00
maintainers python3Packages.fileseq: init at 3.4.1 (#557607) 2026-11-17 20:10:06 +00:00
modules lib/services: make the portable service module self-contained 2026-08-30 21:18:31 +02:00
nixos nixos/amazon-image: mount the ESP readable only by root (#589684) 2026-11-18 01:02:48 +00:00
pkgs nixpkgs: Allow passing {host,build}Platform directly instead of *[sS]ystem 2026-11-21 16:25:21 +01:00
.editorconfig fetchtorrent: fix single-file torrents (#497402) 2026-08-21 20:10:51 +00:00
.git-blame-ignore-revs .git-blame-ignore-revs: add nixfmt 1.2.0 commit 2026-01-22 19:00:19 -03:00
.gitattributes fetchtorrent: test single-file torrents 2026-05-05 13:21:09 -07:00
.gitignore gitignore: add AGENTS.md and CLAUDE.md 2026-07-21 21:05:33 -04:00
.mailmap mailmap: update stepbrobd 2026-10-23 22:27:46 +02:00
.version
CONTRIBUTING.md Revert "Revert "CONTRIBUTING: ban most LLM prose"" 2026-11-15 16:42:25 +01:00
COPYING COPYING: 2025 -> 2026 2026-01-07 14:31:39 +02:00
default.nix
flake.nix shell: pin a Nixpkgs that supports x86_64-darwin 2026-07-24 22:37:07 +01:00
README.md Revert "README.md: update logo to rainbow variant" 2026-09-30 10:13:47 -06:00
shell.nix shell: cleanup 26.05 x86_64-darwin special case 2026-07-26 20:46:54 +01:00

NixOS logo

Contributors badge Open Collective supporters

Nixpkgs is a collection of over 140,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

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:

Continuous Integration and Distribution

Nixpkgs and NixOS are built and tested by our continuous integration system, Hydra.

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.