diff --git a/flake.lock b/flake.lock index 41bb780..8abea89 100644 --- a/flake.lock +++ b/flake.lock @@ -74,12 +74,29 @@ "type": "github" } }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1673800717, + "narHash": "sha256-SFHraUqLSu5cC6IxTprex/nTsI81ZQAtDvlBvGDWfnA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2f9fd351ec37f5d479556cd48be4ca340da59b8f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "crane": "crane", "flake-compat": "flake-compat", "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "nixpkgs-stable": "nixpkgs-stable" } }, "rust-overlay": { diff --git a/flake.nix b/flake.nix index f9514ec..d27d2bc 100644 --- a/flake.nix +++ b/flake.nix @@ -3,6 +3,7 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-22.11"; flake-utils.url = "github:numtide/flake-utils"; crane = { @@ -18,7 +19,7 @@ }; }; - outputs = { self, nixpkgs, flake-utils, crane, ... }: let + outputs = { self, nixpkgs, nixpkgs-stable, flake-utils, crane, ... }: let supportedSystems = flake-utils.lib.defaultSystems; makeCranePkgs = pkgs: let @@ -31,6 +32,12 @@ }; cranePkgs = makeCranePkgs pkgs; + pkgsStable = import nixpkgs-stable { + inherit system; + overlays = []; + }; + cranePkgsStable = makeCranePkgs pkgsStable; + inherit (pkgs) lib; in rec { packages = { @@ -130,13 +137,17 @@ inherit (cranePkgs) attic-tests cargoArtifacts; }; - checks = lib.optionalAttrs pkgs.stdenv.isLinux (import ./integration-tests { - pkgs = import nixpkgs { - inherit system; - overlays = [ self.overlays.default ]; + checks = let + makeIntegrationTests = pkgs: import ./integration-tests { + pkgs = import nixpkgs { + inherit system; + overlays = [ self.overlays.default ]; + }; + flake = self; }; - flake = self; - }); + unstableTests = makeIntegrationTests pkgs; + stableTests = lib.mapAttrs' (name: lib.nameValuePair "stable-${name}") (makeIntegrationTests pkgsStable); + in lib.optionalAttrs pkgs.stdenv.isLinux (unstableTests // stableTests); }) // { overlays = { default = final: prev: let