1 # Experimental flake interface to Nixpkgs.
2 # See https://github.com/NixOS/rfcs/pull/49 for details.
4 description = "A collection of packages for the Nix package manager";
8 jobs = import ./pkgs/top-level/release.nix {
14 forAllSystems = lib.genAttrs lib.systems.flakeExposed;
17 lib = lib.extend (final: prev: {
19 nixos = import ./nixos/lib { lib = final; };
22 import ./nixos/lib/eval-config.nix (
24 modules = args.modules ++ [{
25 system.nixos.versionSuffix =
26 ".${final.substring 0 8 (self.lastModifiedDate or self.lastModified or "19700101")}.${self.shortRev or "dirty"}";
27 system.nixos.revision = final.mkIf (self ? rev) self.rev;
29 } // lib.optionalAttrs (! args?system) {
30 # Allow system to be set modularly in nixpkgs.system.
31 # We set it to null, to remove the "legacy" entrypoint's
32 # non-hermetic default.
38 checks.x86_64-linux.tarball = jobs.tarball;
41 nixpkgsManual = jobs.manual;
42 nixosManual = (import ./nixos/release-small.nix {
44 }).nixos.manual.x86_64-linux;
47 # The "legacy" in `legacyPackages` doesn't imply that the packages exposed
48 # through this attribute are "legacy" packages. Instead, `legacyPackages`
49 # is used here as a substitute attribute name for `packages`. The problem
50 # with `packages` is that it makes operations like `nix flake show
51 # nixpkgs` unusably slow due to the sheer number of packages the Nix CLI
52 # needs to evaluate. But when the Nix CLI sees a `legacyPackages`
53 # attribute it displays `omitted` instead of evaluating all packages,
54 # which keeps `nix flake show` on Nixpkgs reasonably fast, though less
56 legacyPackages = forAllSystems (system: import ./. { inherit system; });
59 notDetected = ./nixos/modules/installer/scan/not-detected.nix;
62 Make the `nixpkgs.*` configuration read-only. Guarantees that `pkgs`
63 is the way you initialize it.
68 imports = [ nixpkgs.nixosModules.readOnlyPkgs ];
69 nixpkgs.pkgs = nixpkgs.legacyPackages.x86_64-linux;
72 readOnlyPkgs = ./nixos/modules/misc/nixpkgs/read-only.nix;