Unverified Commit f0feb1b8 authored by Silvan Mosberger's avatar Silvan Mosberger Committed by GitHub
Browse files

Merge pull request #317772 from ExpidusOS/fix/flake-check

Make NixOS/nixpkgs Flake pure
parents 8aeb30ae 8bb66a49
Loading
Loading
Loading
Loading
+12 −9
Original line number Diff line number Diff line
@@ -5,14 +5,15 @@

  outputs = { self }:
    let
      jobs = import ./pkgs/top-level/release.nix {
        nixpkgs = self;
      };

      libVersionInfoOverlay = import ./lib/flake-version-info.nix self;
      lib = (import ./lib).extend libVersionInfoOverlay;

      forAllSystems = lib.genAttrs lib.systems.flakeExposed;

      jobs = forAllSystems (system: import ./pkgs/top-level/release.nix {
        nixpkgs = self;
        inherit system;
      });
    in
    {
      lib = lib.extend (final: prev: {
@@ -43,12 +44,14 @@
          );
      });

      checks.x86_64-linux = {
        tarball = jobs.tarball;
      checks = forAllSystems (system: {
        tarball = jobs.${system}.tarball;
      } // lib.optionalAttrs (self.legacyPackages.${system}.stdenv.isLinux) {
        # Test that ensures that the nixosSystem function can accept a lib argument
        # Note: prefer not to extend or modify `lib`, especially if you want to share reusable modules
        #       alternatives include: `import` a file, or put a custom library in an option or in `_module.args.<libname>`
        nixosSystemAcceptsLib = (self.lib.nixosSystem {
          pkgs = self.legacyPackages.${system};
          lib = self.lib.extend (final: prev: {
            ifThisFunctionIsMissingTheTestFails = final.id;
          });
@@ -64,13 +67,13 @@
            })
          ];
        }).config.system.build.toplevel;
      };
      });

      htmlDocs = {
        nixpkgsManual = jobs.manual;
        nixpkgsManual = builtins.mapAttrs (_: jobSet: jobSet.manual) jobs;
        nixosManual = (import ./nixos/release-small.nix {
          nixpkgs = self;
        }).nixos.manual.x86_64-linux;
        }).nixos.manual;
      };

      # The "legacy" in `legacyPackages` doesn't imply that the packages exposed
+3 −1
Original line number Diff line number Diff line
@@ -24,7 +24,9 @@ in
      #
      #   https://github.com/NixOS/nixpkgs/issues/272591
      #
      [(import ../../pkgs/test/release {})]
      [(import ../../pkgs/test/release {
        inherit pkgs lib nix;
      })]
    ;

  }
+2 −1
Original line number Diff line number Diff line
{ supportedSystems
, system ? builtins.currentSystem
, packageSet ? (import ../..)
, scrubJobs ? true
, # Attributes passed to nixpkgs. Don't build packages marked as unfree.
@@ -33,7 +34,7 @@ let
    systems
    ;

  pkgs = packageSet (recursiveUpdate { system = "x86_64-linux"; config.allowUnsupportedSystem = true; } nixpkgsArgs);
  pkgs = packageSet (recursiveUpdate { inherit system; config.allowUnsupportedSystem = true; } nixpkgsArgs);

  hydraJob' = if scrubJobs then hydraJob else id;

+2 −1
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@
   $ nix-build pkgs/top-level/release.nix -A coreutils.x86_64-linux
*/
{ nixpkgs ? { outPath = (import ../../lib).cleanSource ../..; revCount = 1234; shortRev = "abcdef"; revision = "0000000000000000000000000000000000000000"; }
, system ? builtins.currentSystem
, officialRelease ? false
  # The platform doubles for which we build Nixpkgs.
, supportedSystems ? [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]
@@ -54,7 +55,7 @@

let
  release-lib = import ./release-lib.nix {
    inherit supportedSystems scrubJobs nixpkgsArgs;
    inherit supportedSystems scrubJobs nixpkgsArgs system;
  };

  inherit (release-lib) mapTestOn pkgs;