From 69475a651c0daf200e77aeb7fb3a5e33e68d134b Mon Sep 17 00:00:00 2001 From: sterni Date: Thu, 10 Nov 2022 14:41:46 +0100 Subject: fix(3p): use nixpkgs nix_2_3 expr and tarball job for our Nix fork By re-using the nix_2_3 expression from nixpkgs we are no longer stuck with the 2021 expression from Nix's release.nix and the resulting derivation has a shape that other expressions in nixpkgs expect (e.g. nix-serve), so we can actually overlay our fork into the nix_2_3 attribute. This should reduce duplication on e.g. whitby. Since there is no nixUnstable expression in nixpkgs anymore, it expects a Nix release tarball which we produle using the appropriate release.nix job from the repository. Sadly there is some trickery involved in getting it to respect localSystem, since the tarball job is not based on the passed in systems list. Change-Id: Ib49f298334d166327f91559a06b0a37b2488bc63 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7262 Autosubmit: sterni Reviewed-by: tazjin Tested-by: BuildkiteCI Reviewed-by: grfn --- third_party/overlays/tvl.nix | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/third_party/overlays/tvl.nix b/third_party/overlays/tvl.nix index d0a0d5581cd5..71c46b86d1f3 100644 --- a/third_party/overlays/tvl.nix +++ b/third_party/overlays/tvl.nix @@ -18,6 +18,19 @@ let inherit rev; hash = "sha256:0rwyrh471c5y64axyd8vzzzmzlscg97fsrjbgbm1a93wnzxcvnvk"; } // { revCount = 0; shortRev = builtins.substring 0 7 rev; }; + + nixTarball = (scopedImport + { + # The tarball job always uses currentSystem which we need to purify + builtins = builtins // { currentSystem = localSystem; }; + } + "${nixSrc}/release.nix" + { + nix = nixSrc; + nixpkgs = self.path; + systems = [ ]; + } + ).tarball; in { buf = super.buf.overrideAttrs (old: { @@ -27,12 +40,10 @@ in ] ++ old.patches or [ ]; }); - nix = (import "${nixSrc}/release.nix" { - nix = nixSrc; - nixpkgs = super.path; - systems = [ localSystem ]; - }).build."${localSystem}"; - + nix_2_3 = super.nix_2_3.overrideAttrs (_: { + src = "${nixTarball}/tarballs/nix-${nixTarball.version}.tar.xz"; + }); + nix = self.nix_2_3; nix_latest = super.nix; nvd = super.nvd.overrideAttrs (old: { -- cgit 1.4.1