1
0
Fork 0
mirror of https://github.com/zhaofengli/attic.git synced 2024-12-15 17:50:57 +00:00

flake.nix: Also run integration tests on stable nixpkgs

This commit is contained in:
Zhaofeng Li 2023-01-16 14:14:14 -07:00
parent 99202303be
commit 49bd872153
2 changed files with 36 additions and 8 deletions

View file

@ -74,12 +74,29 @@
"type": "github" "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": { "root": {
"inputs": { "inputs": {
"crane": "crane", "crane": "crane",
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs",
"nixpkgs-stable": "nixpkgs-stable"
} }
}, },
"rust-overlay": { "rust-overlay": {

View file

@ -3,6 +3,7 @@
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-22.11";
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
crane = { 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; supportedSystems = flake-utils.lib.defaultSystems;
makeCranePkgs = pkgs: let makeCranePkgs = pkgs: let
@ -31,6 +32,12 @@
}; };
cranePkgs = makeCranePkgs pkgs; cranePkgs = makeCranePkgs pkgs;
pkgsStable = import nixpkgs-stable {
inherit system;
overlays = [];
};
cranePkgsStable = makeCranePkgs pkgsStable;
inherit (pkgs) lib; inherit (pkgs) lib;
in rec { in rec {
packages = { packages = {
@ -130,13 +137,17 @@
inherit (cranePkgs) attic-tests cargoArtifacts; inherit (cranePkgs) attic-tests cargoArtifacts;
}; };
checks = lib.optionalAttrs pkgs.stdenv.isLinux (import ./integration-tests { checks = let
pkgs = import nixpkgs { makeIntegrationTests = pkgs: import ./integration-tests {
inherit system; pkgs = import nixpkgs {
overlays = [ self.overlays.default ]; 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 = { overlays = {
default = final: prev: let default = final: prev: let