about summary refs log tree commit diff
path: root/third_party/nix/corepkgs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-05-18T15·39+0200
committerclbot <clbot@tvl.fyi>2022-05-19T14·08+0000
commitd127f9bd0e7b9b2e0df2de8a2227f77c0907468d (patch)
tree68455040d88b8e0c2817601db88ede450873ff8e /third_party/nix/corepkgs
parentc85291c602ac666421627d6934ebc6d5be1b93e1 (diff)
chore(3p/nix): unvendor tvix 0.1 r/4098
Nothing is using this now, and we'll likely never pick this up again,
but we learned a lot in the process.

Every now and then this breaks in some bizarre way on channel bumps
and it's just a waste of time to maintain that.

Change-Id: Idcf2f5acd4ca7070ce18d7149cbfc0d967dc0a44
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5632
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Reviewed-by: lukegb <lukegb@tvl.fyi>
Autosubmit: tazjin <tazjin@tvl.su>
Diffstat (limited to 'third_party/nix/corepkgs')
-rw-r--r--third_party/nix/corepkgs/buildenv.nix27
-rw-r--r--third_party/nix/corepkgs/config.nix.in29
-rw-r--r--third_party/nix/corepkgs/derivation.nix30
-rw-r--r--third_party/nix/corepkgs/fetchurl.nix46
-rw-r--r--third_party/nix/corepkgs/imported-drv-to-derivation.nix24
-rw-r--r--third_party/nix/corepkgs/unpack-channel.nix39
6 files changed, 0 insertions, 195 deletions
diff --git a/third_party/nix/corepkgs/buildenv.nix b/third_party/nix/corepkgs/buildenv.nix
deleted file mode 100644
index 4da0db2ae2ae..000000000000
--- a/third_party/nix/corepkgs/buildenv.nix
+++ /dev/null
@@ -1,27 +0,0 @@
-{ derivations, manifest }:
-
-derivation {
-  name = "user-environment";
-  system = "builtin";
-  builder = "builtin:buildenv";
-
-  inherit manifest;
-
-  # !!! grmbl, need structured data for passing this in a clean way.
-  derivations =
-    map
-      (d:
-        [
-          (d.meta.active or "true")
-          (d.meta.priority or 5)
-          (builtins.length d.outputs)
-        ] ++ map (output: builtins.getAttr output d) d.outputs)
-      derivations;
-
-  # Building user environments remotely just causes huge amounts of
-  # network traffic, so don't do that.
-  preferLocalBuild = true;
-
-  # Also don't bother substituting.
-  allowSubstitutes = false;
-}
diff --git a/third_party/nix/corepkgs/config.nix.in b/third_party/nix/corepkgs/config.nix.in
deleted file mode 100644
index 0e4a2f0c90c7..000000000000
--- a/third_party/nix/corepkgs/config.nix.in
+++ /dev/null
@@ -1,29 +0,0 @@
-let
-  fromEnv = var: def:
-    let val = builtins.getEnv var; in
-    if val != "" then val else def;
-in rec {
-  shell = "@bash@";
-  coreutils = "@coreutils@";
-  bzip2 = "@bzip2@";
-  gzip = "@gzip@";
-  xz = "@xz@";
-  tar = "@tar@";
-  tarFlags = "@tarFlags@";
-  tr = "@tr@";
-  nixBinDir = fromEnv "NIX_BIN_DIR" "@CMAKE_INSTALL_FULL_BINDIR@";
-  nixPrefix = "@CMAKE_INSTALL_PREFIX@";
-  nixLibexecDir = fromEnv "NIX_LIBEXEC_DIR" "@CMAKE_INSTALL_FULL_LIBEXECDIR@";
-  nixLocalstateDir = "/nix/var";
-  nixSysconfDir = "/etc";
-  nixStoreDir = fromEnv "NIX_STORE_DIR" "/nix/store";
-
-  # If Nix is installed in the Nix store, then automatically add it as
-  # a dependency to the core packages. This ensures that they work
-  # properly in a chroot.
-  chrootDeps =
-    if dirOf nixPrefix == builtins.storeDir then
-      [ (builtins.storePath nixPrefix) ]
-    else
-      [ ];
-}
diff --git a/third_party/nix/corepkgs/derivation.nix b/third_party/nix/corepkgs/derivation.nix
deleted file mode 100644
index 1f95cf88ec44..000000000000
--- a/third_party/nix/corepkgs/derivation.nix
+++ /dev/null
@@ -1,30 +0,0 @@
-/* This is the implementation of the ‘derivation’ builtin function.
-   It's actually a wrapper around the ‘derivationStrict’ primop. */
-
-drvAttrs @ { outputs ? [ "out" ], ... }:
-
-let
-
-  strict = derivationStrict drvAttrs;
-
-  commonAttrs = drvAttrs // (builtins.listToAttrs outputsList) //
-    {
-      all = map (x: x.value) outputsList;
-      inherit drvAttrs;
-    };
-
-  outputToAttrListElement = outputName:
-    {
-      name = outputName;
-      value = commonAttrs // {
-        outPath = builtins.getAttr outputName strict;
-        drvPath = strict.drvPath;
-        type = "derivation";
-        inherit outputName;
-      };
-    };
-
-  outputsList = map outputToAttrListElement outputs;
-
-in
-(builtins.head outputsList).value
diff --git a/third_party/nix/corepkgs/fetchurl.nix b/third_party/nix/corepkgs/fetchurl.nix
deleted file mode 100644
index 9933b7cc120c..000000000000
--- a/third_party/nix/corepkgs/fetchurl.nix
+++ /dev/null
@@ -1,46 +0,0 @@
-{ system ? "" # obsolete
-, url
-, hash ? "" # an SRI ash
-
-  # Legacy hash specification
-, md5 ? ""
-, sha1 ? ""
-, sha256 ? ""
-, sha512 ? ""
-, outputHash ? if hash != "" then hash else if sha512 != "" then sha512 else if sha1 != "" then sha1 else if md5 != "" then md5 else sha256
-, outputHashAlgo ? if hash != "" then "" else if sha512 != "" then "sha512" else if sha1 != "" then "sha1" else if md5 != "" then "md5" else "sha256"
-
-, executable ? false
-, unpack ? false
-, name ? baseNameOf (toString url)
-}:
-
-derivation {
-  builder = "builtin:fetchurl";
-
-  # New-style output content requirements.
-  inherit outputHashAlgo outputHash;
-  outputHashMode = if unpack || executable then "recursive" else "flat";
-
-  inherit name url executable unpack;
-
-  system = "builtin";
-
-  # No need to double the amount of network traffic
-  preferLocalBuild = true;
-
-  impureEnvVars = [
-    # We borrow these environment variables from the caller to allow
-    # easy proxy configuration.  This is impure, but a fixed-output
-    # derivation like fetchurl is allowed to do so since its result is
-    # by definition pure.
-    "http_proxy"
-    "https_proxy"
-    "ftp_proxy"
-    "all_proxy"
-    "no_proxy"
-  ];
-
-  # To make "nix-prefetch-url" work.
-  urls = [ url ];
-}
diff --git a/third_party/nix/corepkgs/imported-drv-to-derivation.nix b/third_party/nix/corepkgs/imported-drv-to-derivation.nix
deleted file mode 100644
index 639f068332f2..000000000000
--- a/third_party/nix/corepkgs/imported-drv-to-derivation.nix
+++ /dev/null
@@ -1,24 +0,0 @@
-attrs @ { drvPath, outputs, name, ... }:
-
-let
-
-  commonAttrs = (builtins.listToAttrs outputsList) //
-    {
-      all = map (x: x.value) outputsList;
-      inherit drvPath name;
-      type = "derivation";
-    };
-
-  outputToAttrListElement = outputName:
-    {
-      name = outputName;
-      value = commonAttrs // {
-        outPath = builtins.getAttr outputName attrs;
-        inherit outputName;
-      };
-    };
-
-  outputsList = map outputToAttrListElement outputs;
-
-in
-(builtins.head outputsList).value
diff --git a/third_party/nix/corepkgs/unpack-channel.nix b/third_party/nix/corepkgs/unpack-channel.nix
deleted file mode 100644
index d39a20637818..000000000000
--- a/third_party/nix/corepkgs/unpack-channel.nix
+++ /dev/null
@@ -1,39 +0,0 @@
-with import <nix/config.nix>;
-
-let
-
-  builder = builtins.toFile "unpack-channel.sh"
-    ''
-      mkdir $out
-      cd $out
-      xzpat="\.xz\$"
-      gzpat="\.gz\$"
-      if [[ "$src" =~ $xzpat ]]; then
-        ${xz} -d < $src | ${tar} xf - ${tarFlags}
-      elif [[ "$src" =~ $gzpat ]]; then
-        ${gzip} -d < $src | ${tar} xf - ${tarFlags}
-      else
-        ${bzip2} -d < $src | ${tar} xf - ${tarFlags}
-      fi
-      if [ * != $channelName ]; then
-        mv * $out/$channelName
-      fi
-    '';
-
-in
-
-{ name, channelName, src }:
-
-derivation {
-  system = builtins.currentSystem;
-  builder = shell;
-  args = [ "-e" builder ];
-  inherit name channelName src;
-
-  PATH = "${nixBinDir}:${coreutils}";
-
-  # No point in doing this remotely.
-  preferLocalBuild = true;
-
-  inherit chrootDeps;
-}