From 419b96c46dff367ca128bf971c36652862b961b6 Mon Sep 17 00:00:00 2001 From: Leandro Emmanuel Reina Kiperman Date: Sat, 23 Sep 2023 10:50:24 +0200 Subject: [PATCH] Make sure to not break hydra --- flake.lock | 83 +++++++++++++++++++++++++++++++--- flake.nix | 2 +- overlays/overrides/default.nix | 23 ++++++++-- 3 files changed, 98 insertions(+), 10 deletions(-) diff --git a/flake.lock b/flake.lock index 6af29a1..3118ff8 100644 --- a/flake.lock +++ b/flake.lock @@ -120,6 +120,22 @@ "type": "github" } }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" @@ -203,9 +219,7 @@ }, "hydra": { "inputs": { - "nix": [ - "nix" - ], + "nix": "nix", "nixpkgs": [ "nixpkgs" ] @@ -257,16 +271,57 @@ "type": "github" } }, + "lowdown-src_2": { + "flake": false, + "locked": { + "lastModified": 1633514407, + "narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=", + "owner": "kristapsdz", + "repo": "lowdown", + "rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8", + "type": "github" + }, + "original": { + "owner": "kristapsdz", + "repo": "lowdown", + "type": "github" + } + }, "nix": { + "inputs": { + "flake-compat": "flake-compat_2", + "lowdown-src": "lowdown-src", + "nixpkgs": [ + "hydra", + "nixpkgs" + ], + "nixpkgs-regression": "nixpkgs-regression" + }, + "locked": { + "lastModified": 1690219894, + "narHash": "sha256-QMYAkdtU+g9HlZKtoJ+AI6TbWzzovKGnPZJHfZdclc8=", + "owner": "NixOS", + "repo": "nix", + "rev": "a212300a1d9f9c7b0daf19c00c87fc50480f54f4", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "2.17.0", + "repo": "nix", + "type": "github" + } + }, + "nix_2": { "inputs": { "flake-compat": [ "flake-compat" ], - "lowdown-src": "lowdown-src", + "lowdown-src": "lowdown-src_2", "nixpkgs": [ "nixpkgs" ], - "nixpkgs-regression": "nixpkgs-regression" + "nixpkgs-regression": "nixpkgs-regression_2" }, "locked": { "lastModified": 1695206941, @@ -366,6 +421,22 @@ "type": "github" } }, + "nixpkgs-regression_2": { + "locked": { + "lastModified": 1643052045, + "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + } + }, "nixpkgs-stable": { "locked": { "lastModified": 1685801374, @@ -424,7 +495,7 @@ "home-manager": "home-manager", "hydra": "hydra", "impermanence": "impermanence", - "nix": "nix", + "nix": "nix_2", "nixos-artwork": "nixos-artwork", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", diff --git a/flake.nix b/flake.nix index 3939eab..84e9408 100644 --- a/flake.nix +++ b/flake.nix @@ -67,7 +67,7 @@ url = "github:NixOS/hydra/master"; inputs = { nixpkgs.follows = "nixpkgs"; - nix.follows = "nix"; + # nix.follows = "nix"; # DON'T! See hydra#1182 }; }; impermanence = { diff --git a/overlays/overrides/default.nix b/overlays/overrides/default.nix index 0984f29..7db638e 100644 --- a/overlays/overrides/default.nix +++ b/overlays/overrides/default.nix @@ -14,6 +14,23 @@ # along with this program. If not, see . { hydra, nix, ... } @ inputs: -final: prev: { - hydra_unstable = final.hydra; -} // (hydra.overlays.default final prev) // (nix.overlays.default final prev) +final: prev: +let + # Avoid infinite recursion by renaming flakes + hydra' = hydra; + nix' = nix; +in +let + # A fake overlaid pkgs, to ensure that hydra uses it's own version of nix, + # due to hydra#1182 + hydra_final = final // (hydra'.inputs.nix.overlays.default hydra_final prev); + # Get the relevant bits out of the provided overlays + inherit (hydra'.overlays.default hydra_final prev) hydra perlPackages; + inherit (nix'.overlays.default final prev) lowdown-nix nix; + +in +{ + # Expose the extracted packages into the overlay + inherit lowdown-nix nix; + hydra_unstable = hydra; +}