From 99ab2a7400c981ca89c72dc8ad1038cb89dc9b12 Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Sat, 6 Feb 2021 11:53:48 +0100 Subject: pkgs/tvl: expose tvl's depot in vuizvui depot is a nix-based monorepo which contains some great nix utilities like yants (a nix type system), runTestsuite, mergePatch and so on, a few interesting pure nix builders like buildLisp and buildGo and a few packages maintained by @Profpatsch and myself. This change exposes tvl completely as pkgs.tvl, but prevents hydra from building it using dontRecurseIntoAttrs as depot pins its own version of nixpkgs which is not easily overrideable, contains some expensive to build system configurations we are not interested in and even some notoriously indeterministic packages. Additionally it is possible to override pkgs.tvl to use a different or local version of depot: pkgs.tvl.override { tvlSrc = /home/lukas/src/depot; } To keep with @Profpatsch's previous solution, we pass in vuizvui's nixpkgs version to depot via nixpkgsBisectPath which may break packages in depot occasionally if nixpkgs causes breakage in TVL and depot isn't updated accordingly. --- pkgs/default.nix | 11 +++++++++-- pkgs/profpatsch/default.nix | 38 ++------------------------------------ pkgs/tvl/default.nix | 12 ++++++++++++ 3 files changed, 23 insertions(+), 38 deletions(-) create mode 100644 pkgs/tvl/default.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index a508a060..94fa4116 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,7 +1,12 @@ { pkgs ? import (import ../nixpkgs-path.nix) {} }: let - inherit (pkgs.lib) callPackageWith; + inherit (pkgs.lib) + callPackageWith + recurseIntoAttrs + dontRecurseIntoAttrs + ; + callPackage = callPackageWith (pkgs // self.vuizvui); callPackage_i686 = callPackageWith (pkgs.pkgsi686Linux // self.vuizvui); @@ -10,7 +15,7 @@ let pkgsi686Linux = pkgs.pkgsi686Linux // self.vuizvui; }; - self.vuizvui = pkgs.recurseIntoAttrs { + self.vuizvui = recurseIntoAttrs { mkChannel = callPackage ./build-support/channel.nix { }; buildSandbox = callPackage ./build-support/build-sandbox {}; lazy-packages = callPackage ./build-support/lazy-packages {}; @@ -30,5 +35,7 @@ let openlab = callPackageScope ./openlab; profpatsch = callPackageScope ./profpatsch; sternenseemann = callPackageScope ./sternenseemann; + + tvl = dontRecurseIntoAttrs (callPackage ./tvl { }); }; in self.vuizvui diff --git a/pkgs/profpatsch/default.nix b/pkgs/profpatsch/default.nix index 149f2198..680831f2 100644 --- a/pkgs/profpatsch/default.nix +++ b/pkgs/profpatsch/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, pkgs, sternenseemann, lazy-packages }: +{ stdenv, lib, pkgs, sternenseemann, tvl, lazy-packages }: let inherit (pkgs) callPackage; @@ -106,41 +106,7 @@ let writeExeclineFns = callPackage ./execline/write-execline.nix {}; - # # Fetch the tvl source at commit, and replac the nixpkgs version it depends - # # on with the given nixpkgsPath. - importTvl = { tvlCommit, tvlSha256, nixpkgsPath }: - let - bins = getBins pkgs.gawk [ "gawk" ] - // getBins pkgs.coreutils [ "cp" ]; - gawkScript = '' - # patch out emacs overlay (requires fetching the overlay with builtins.fetchTarball) - /depot.third_party.overlays.emacs/ { sub("^", "#") } - 1 { print } - ''; - src = pkgs.fetchgit { - url = "https://code.tvl.fyi/depot.git"; - rev = tvlCommit; - sha256 = tvlSha256; - }; - prepareSource = runExeclineFns.runExeclineLocalNoSeqL "prepare-tvl" {} [ - "importas" "out" "out" - "if" [ bins.cp "--no-preserve=mode" "-r" src "$out" ] - bins.gawk "-i" "inplace" gawkScript "\${out}/third_party/nixpkgs/default.nix" - ]; - in import prepareSource { - nixpkgsBisectPath = nixpkgsPath; - }; - - in rec { - # tvl = import /home/philip/depot {}; - tvl = - importTvl { - tvlCommit = "72b46e8fe80d9c8c708602387b4d46cce6bb266d"; # 2022-02-28 - tvlSha256 = "sha256-uWrsbMWe3CZVlsstMrJB4HP3tzU8GgFB7VAsanUBI2g="; - nixpkgsPath = pkgs.path; - }; - inherit (nixperiments) # canonical pattern matching primitive @@ -250,7 +216,7 @@ in rec { }; inherit (import ./profpatsch.de { - inherit pkgs tvl lib + inherit pkgs lib tvl toNetstring toNetstringList writeExecline runExecline getBins writeRustSimple netencode-rs el-semicolon el-exec el-substitute netencode record-get; }) websiteStatic diff --git a/pkgs/tvl/default.nix b/pkgs/tvl/default.nix new file mode 100644 index 00000000..f84e3fa3 --- /dev/null +++ b/pkgs/tvl/default.nix @@ -0,0 +1,12 @@ +{ tvlSrc ? builtins.fetchGit { + name = "tvl-depot"; + url = "https://code.tvl.fyi"; + rev = "98371362f25202f8afae3949b618b0db78d5ea1d"; + ref = "canon"; + } +, pkgs +}: + +import tvlSrc { + nixpkgsBisectPath = pkgs.path; # TODO: does this improve eval time significantly? +} -- cgit 1.4.1