1
0
Fork 0
mirror of https://github.com/NixOS/nix.dev.git synced 2024-10-18 14:32:43 -04:00
nix.dev/nix/inputs.nix
Silvan Mosberger f4794639c6 Various improvements to the dynamically generated Nix versions
- Use separate JSON files to track sources for Nixpkgs and Nix releases
  This greatly simplifies the code, because we can directly encode
  versions as keys without ambiguity
- Avoid an instance of IFD for the redirect generation
- Use pkgs.substitute instead of builtins.replaceStrings
- Turn off the single-page feature for now. It was added by Valentin in
  a previous commit, but I think we should discuss this a bit more
- Simplify a lot of the code and add comments
- Fix the mutable redirects, they were broken by a parent commit
- Remove pieces of Nix code that weren't used, like the import of the
  Nixpkgs manual. This can be added in the future when necessary
- Make sure that Nix versions are cached by building from the store path
2024-04-04 02:04:56 +02:00

37 lines
1.1 KiB
Nix

# An abstraction over the different source pins in this directory
{
# The main niv pins, these are without any standard names:
# {
# <name> = <source>;
# }
main = import ./sources.nix {
sourcesFile = ./sources.json;
};
# Sources for Nix releases, the attribute name is the release version.
# These are done specially because updating these is non-trivial.
# See ./update-nix-releases.nix
# {
# <version> = <source>;
# }
nix =
builtins.mapAttrs (name: value:
# This matches the nix-prefetch-url --unpack --name source call in ./update-nix-releases.nix
fetchTarball {
name = "source";
url = value.url;
sha256 = value.sha256;
}
) (builtins.fromJSON (builtins.readFile ./nix-versions.json));
# Sources for Nixpkgs releases, the attribute name is the release name.
# These can be updated with the standard niv tooling, but are tracked separately to avoid having to filter them out during processing.
# See ./update-nixpkgs-releases.nix
nixpkgs =
import ./sources.nix {
sourcesFile = ./nixpkgs-versions.json;
};
}