From faf84d57189f0a2dd4208848628f785e04a3a77f Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Sat, 22 Jan 2022 17:50:53 -0800 Subject: [PATCH] flake.nix: Use own nix-eval-jobs fork Currently we depend on changes that are not yet in a released version of nix-eval-jobs. This pin needs to go before the 0.3 release. --- flake.lock | 53 ++++++++++++++++++++++++++++++++++- flake.nix | 18 ++++++++++-- integration-tests/nixpkgs.nix | 1 + 3 files changed, 69 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index d0c7487..07f0ad3 100644 --- a/flake.lock +++ b/flake.lock @@ -16,7 +16,57 @@ "type": "github" } }, + "flake-utils": { + "locked": { + "lastModified": 1637014545, + "narHash": "sha256-26IZAc5yzlD9FlDT54io1oqG/bBoyka+FJk5guaX4x4=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "bba5dcc8e0b20ab664967ad83d24d64cb64ec4f4", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nix-eval-jobs": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1641681369, + "narHash": "sha256-FpWFVYm3N8qcjWd2+d3SjL5BKt4ScCr4fyc1indYwTY=", + "owner": "zhaofengli", + "repo": "nix-eval-jobs", + "rev": "5248c68833076062c7cd20eef1a70294776cf265", + "type": "github" + }, + "original": { + "owner": "zhaofengli", + "ref": "colmena", + "repo": "nix-eval-jobs", + "type": "github" + } + }, "nixpkgs": { + "locked": { + "lastModified": 1639573498, + "narHash": "sha256-YAoywqjyjOJYuEZpA8sln84jk99GG9hYbPEYXwGEGGM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "aef12c8678fd5e927edba764bd04f3ba2930ae15", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { "locked": { "lastModified": 1642492175, "narHash": "sha256-lo5hxiY8U4eREChAR7JD94zns92hQqmp3wg3qTFolPA=", @@ -35,7 +85,8 @@ "root": { "inputs": { "flake-compat": "flake-compat", - "nixpkgs": "nixpkgs", + "nix-eval-jobs": "nix-eval-jobs", + "nixpkgs": "nixpkgs_2", "utils": "utils" } }, diff --git a/flake.nix b/flake.nix index 9f712b6..7abf9d9 100644 --- a/flake.nix +++ b/flake.nix @@ -5,16 +5,22 @@ nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; utils.url = "github:numtide/flake-utils"; + # not yet upstreamed + nix-eval-jobs.url = "github:zhaofengli/nix-eval-jobs/colmena"; + flake-compat = { url = "github:edolstra/flake-compat"; flake = false; }; }; - outputs = { self, nixpkgs, utils, ... }: let + outputs = { self, nixpkgs, utils, nix-eval-jobs, ... }: let supportedSystems = [ "x86_64-linux" "i686-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; in utils.lib.eachSystem supportedSystems (system: let - pkgs = import nixpkgs { inherit system; }; + pkgs = import nixpkgs { + inherit system; + overlays = [ self._evalJobsOverlay ]; + }; in rec { # We still maintain the expression in a Nixpkgs-acceptable form defaultPackage = self.packages.${system}.colmena; @@ -58,6 +64,14 @@ ''; }; }) // { + # For use in integration tests + _evalJobsOverlay = + (final: prev: { + nix-eval-jobs = (final.callPackage nix-eval-jobs.outPath {}).overrideAttrs (old: { + version = "0.0.3-colmena"; + }); + }); + overlay = final: prev: { colmena = final.callPackage ./package.nix { }; }; diff --git a/integration-tests/nixpkgs.nix b/integration-tests/nixpkgs.nix index fd4b9c0..92cce60 100644 --- a/integration-tests/nixpkgs.nix +++ b/integration-tests/nixpkgs.nix @@ -2,6 +2,7 @@ let flake = (import ../flake-compat.nix).defaultNix; in import flake.inputs.nixpkgs.outPath { overlays = [ + flake._evalJobsOverlay flake.overlay ]; }