about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--fun/idual/default.nix2
-rw-r--r--nix/readTree/default.nix17
-rw-r--r--nix/utils/default.nix17
-rw-r--r--nix/writers/tests/rust.nix2
-rw-r--r--ops/dns/default.nix6
-rw-r--r--third_party/gerrit_plugins/default.nix2
-rw-r--r--third_party/nixery/default.nix2
-rw-r--r--tools/rust-crates-advisory/default.nix2
-rw-r--r--users/Profpatsch/arglib/netencode.nix2
-rw-r--r--users/Profpatsch/blog/default.nix2
-rw-r--r--users/Profpatsch/execline/default.nix2
-rw-r--r--users/Profpatsch/netencode/default.nix2
-rw-r--r--users/Profpatsch/netstring/default.nix2
-rw-r--r--users/Profpatsch/netstring/tests/default.nix2
-rw-r--r--users/Profpatsch/nixpkgs-rewriter/default.nix2
-rw-r--r--users/Profpatsch/tree-sitter.nix2
-rw-r--r--users/Profpatsch/writers/tests/default.nix2
-rw-r--r--users/tazjin/dns/default.nix4
-rw-r--r--web/tvl/logo/default.nix2
19 files changed, 34 insertions, 40 deletions
diff --git a/fun/idual/default.nix b/fun/idual/default.nix
index 877ab7d3929d..0f87f4ae1a76 100644
--- a/fun/idual/default.nix
+++ b/fun/idual/default.nix
@@ -14,7 +14,7 @@ let
   };
   package = python3Packages.buildPythonPackage opts;
   script  = python3Packages.buildPythonApplication opts;
-in depot.nix.utils.drvTargets {
+in depot.nix.readTree.drvTargets {
   inherit script;
   python  = python3.withPackages (_: [ package ]);
   setAlarm = pkgs.writeShellScriptBin "set-alarm" ''
diff --git a/nix/readTree/default.nix b/nix/readTree/default.nix
index 5e805b5f4a97..2ad8e40f6c28 100644
--- a/nix/readTree/default.nix
+++ b/nix/readTree/default.nix
@@ -157,6 +157,10 @@ let
            })
            (node.meta.targets or []))
     else [];
+
+  # Determine whether a given value is a derivation.
+  # Copied from nixpkgs/lib for cases where lib is not available yet.
+  isDerivation = x: isAttrs x && x ? type && x.type == "derivation";
 in {
   inherit gather;
 
@@ -210,4 +214,17 @@ in {
   #
   # It is often required to create the args attribute set.
   fix = f: let x = f x; in x;
+
+  # Takes an attribute set and adds a meta.targets attribute to it
+  # which contains all direct children of the attribute set which are
+  # derivations.
+  #
+  # Type: attrs -> attrs
+  drvTargets = attrs: attrs // {
+    meta = {
+      targets = builtins.filter
+      (x: isDerivation attrs."${x}")
+      (builtins.attrNames attrs);
+    } // (attrs.meta or {});
+  };
 }
diff --git a/nix/utils/default.nix b/nix/utils/default.nix
index d90dee24af01..f65d4712a03d 100644
--- a/nix/utils/default.nix
+++ b/nix/utils/default.nix
@@ -1,22 +1,6 @@
 { depot, lib, ... }:
 
 let
-
-  /* Takes an attribute set and adds a meta.targets
-     attribute to it which contains all direct children
-     of the attribute set which are derivations.
-
-     Type: attrs -> attrs
-  */
-  drvTargets = attrs:
-    attrs // {
-      meta = {
-        targets = builtins.filter
-          (x: lib.isDerivation attrs."${x}")
-          (builtins.attrNames attrs);
-      } // (attrs.meta or {});
-    };
-
   /* Get the basename of a store path without
      the leading hash.
 
@@ -186,7 +170,6 @@ let
 
 in {
   inherit
-    drvTargets
     storePathName
     pathType
     isDirectory
diff --git a/nix/writers/tests/rust.nix b/nix/writers/tests/rust.nix
index 4b87676118f5..8a12c95ec7da 100644
--- a/nix/writers/tests/rust.nix
+++ b/nix/writers/tests/rust.nix
@@ -60,7 +60,7 @@ let
   '');
 
 
-in depot.nix.utils.drvTargets {
+in depot.nix.readTree.drvTargets {
   inherit
     rustTransitiveLib
     rustWithLib
diff --git a/ops/dns/default.nix b/ops/dns/default.nix
index 1007be08f783..136a4c58dca7 100644
--- a/ops/dns/default.nix
+++ b/ops/dns/default.nix
@@ -2,15 +2,11 @@
 { depot, pkgs, ... }:
 
 let
-  inherit (depot.nix.utils)
-    drvTargets
-    ;
-
   checkZone = zone: file: pkgs.runCommandNoCC "${zone}-check" {} ''
     ${pkgs.bind}/bin/named-checkzone -i local ${zone} ${file} | tee $out
   '';
 
-in drvTargets {
+in depot.nix.readTree.drvTargets {
   nixery-dev = checkZone "nixery.dev" ./nixery.dev.zone;
   tvl-fyi = checkZone "tvl.fyi" ./tvl.fyi.zone;
   tvl-su = checkZone "tvl.su" ./tvl.su.zone;
diff --git a/third_party/gerrit_plugins/default.nix b/third_party/gerrit_plugins/default.nix
index 08a9e17ff9ee..8131ca2eb014 100644
--- a/third_party/gerrit_plugins/default.nix
+++ b/third_party/gerrit_plugins/default.nix
@@ -2,7 +2,7 @@
 
 let
   inherit (import ./builder.nix args) buildGerritBazelPlugin;
-in depot.nix.utils.drvTargets {
+in depot.nix.readTree.drvTargets {
   # https://gerrit.googlesource.com/plugins/owners
   owners = buildGerritBazelPlugin rec {
     name = "owners";
diff --git a/third_party/nixery/default.nix b/third_party/nixery/default.nix
index 0220c9cd801b..9262f1461401 100644
--- a/third_party/nixery/default.nix
+++ b/third_party/nixery/default.nix
@@ -3,7 +3,7 @@
 { depot, pkgs, ... }:
 
 let
-  inherit (depot.nix.utils) drvTargets;
+  inherit (depot.nix.readTree) drvTargets;
 
   commit = "6c4a69fa4280f0154ce257a1dfd23fb463c1ec5b";
   src = pkgs.fetchFromGitHub {
diff --git a/tools/rust-crates-advisory/default.nix b/tools/rust-crates-advisory/default.nix
index 9490e3f47477..c0cd4dc03e05 100644
--- a/tools/rust-crates-advisory/default.nix
+++ b/tools/rust-crates-advisory/default.nix
@@ -77,7 +77,7 @@ let
     bins.s6-touch "$out"
   ];
 
-in depot.nix.utils.drvTargets {
+in depot.nix.readTree.drvTargets {
 
   check-all-our-crates =
     depot.nix.drvSeqL
diff --git a/users/Profpatsch/arglib/netencode.nix b/users/Profpatsch/arglib/netencode.nix
index 7712bbd5bb9e..50f4c11c2d8f 100644
--- a/users/Profpatsch/arglib/netencode.nix
+++ b/users/Profpatsch/arglib/netencode.nix
@@ -37,4 +37,4 @@ let
     '';
   };
 
-in depot.nix.utils.drvTargets netencode
+in depot.nix.readTree.drvTargets netencode
diff --git a/users/Profpatsch/blog/default.nix b/users/Profpatsch/blog/default.nix
index 4e24d097e358..6ac3c3eb5104 100644
--- a/users/Profpatsch/blog/default.nix
+++ b/users/Profpatsch/blog/default.nix
@@ -358,7 +358,7 @@ let
     bins.cdbget "$2"
   ];
 
-in depot.nix.utils.drvTargets {
+in depot.nix.readTree.drvTargets {
    inherit
     router
     depotCgitLink
diff --git a/users/Profpatsch/execline/default.nix b/users/Profpatsch/execline/default.nix
index 2d1b91137347..1f75b97591fc 100644
--- a/users/Profpatsch/execline/default.nix
+++ b/users/Profpatsch/execline/default.nix
@@ -5,7 +5,7 @@ let
     name = "exec-helpers";
   } (builtins.readFile ./exec_helpers.rs);
 
-in depot.nix.utils.drvTargets {
+in depot.nix.readTree.drvTargets {
   inherit
     exec-helpers
     ;
diff --git a/users/Profpatsch/netencode/default.nix b/users/Profpatsch/netencode/default.nix
index db892cc9de8d..739bda3d78c9 100644
--- a/users/Profpatsch/netencode/default.nix
+++ b/users/Profpatsch/netencode/default.nix
@@ -135,7 +135,7 @@ let
     }
   '';
 
-in depot.nix.utils.drvTargets {
+in depot.nix.readTree.drvTargets {
   inherit
     netencode-rs
     pretty-rs
diff --git a/users/Profpatsch/netstring/default.nix b/users/Profpatsch/netstring/default.nix
index eee5358fddd9..dcc29d7e6fec 100644
--- a/users/Profpatsch/netstring/default.nix
+++ b/users/Profpatsch/netstring/default.nix
@@ -55,7 +55,7 @@ let
     }
   '';
 
-in depot.nix.utils.drvTargets {
+in depot.nix.readTree.drvTargets {
   inherit
     python-netstring
     rust-netstring
diff --git a/users/Profpatsch/netstring/tests/default.nix b/users/Profpatsch/netstring/tests/default.nix
index f64beb9e9275..710ba3d30526 100644
--- a/users/Profpatsch/netstring/tests/default.nix
+++ b/users/Profpatsch/netstring/tests/default.nix
@@ -53,7 +53,7 @@ let
     }
   '';
 
-in depot.nix.utils.drvTargets {
+in depot.nix.readTree.drvTargets {
   inherit
     python-netstring-test
     rust-netstring-test
diff --git a/users/Profpatsch/nixpkgs-rewriter/default.nix b/users/Profpatsch/nixpkgs-rewriter/default.nix
index 9dac01844165..787162d4973a 100644
--- a/users/Profpatsch/nixpkgs-rewriter/default.nix
+++ b/users/Profpatsch/nixpkgs-rewriter/default.nix
@@ -101,7 +101,7 @@ let
     "nix-instantiate" "$1" "-A" "{}"
   ];
 
-in depot.nix.utils.drvTargets {
+in depot.nix.readTree.drvTargets {
   inherit
    instantiate-nixpkgs-randomly
   # requires hnix, which we don’t want in tvl for now
diff --git a/users/Profpatsch/tree-sitter.nix b/users/Profpatsch/tree-sitter.nix
index 1e3f37801968..4f81b8e7a77c 100644
--- a/users/Profpatsch/tree-sitter.nix
+++ b/users/Profpatsch/tree-sitter.nix
@@ -169,7 +169,7 @@ let
         '';
       };
 
-in depot.nix.utils.drvTargets {
+in depot.nix.readTree.drvTargets {
   inherit
     print-ast
     tree-sitter-nix
diff --git a/users/Profpatsch/writers/tests/default.nix b/users/Profpatsch/writers/tests/default.nix
index c4769a28c655..dc760af9e16e 100644
--- a/users/Profpatsch/writers/tests/default.nix
+++ b/users/Profpatsch/writers/tests/default.nix
@@ -41,7 +41,7 @@ let
     assert(test_lib.test() == "test 1 2 3")
   '');
 
-in depot.nix.utils.drvTargets {
+in depot.nix.readTree.drvTargets {
   inherit
     pythonWithLib
     ;
diff --git a/users/tazjin/dns/default.nix b/users/tazjin/dns/default.nix
index 14b9d428641c..da92b88beade 100644
--- a/users/tazjin/dns/default.nix
+++ b/users/tazjin/dns/default.nix
@@ -2,13 +2,11 @@
 { depot, pkgs, ... }:
 
 let
-  inherit (depot.nix.utils) drvTargets;
-
   checkZone = zone: file: pkgs.runCommandNoCC "${zone}-check" {} ''
     ${pkgs.bind}/bin/named-checkzone -i local ${zone} ${file} | tee $out
   '';
 
-in drvTargets {
+in depot.nix.readTree.drvTargets {
   kontemplate-works = checkZone "kontemplate.works"./kontemplate.works.zone;
   tazj-in = checkZone "tazj.in" ./tazj.in.zone;
 }
diff --git a/web/tvl/logo/default.nix b/web/tvl/logo/default.nix
index 74ab4de7ddf4..940f67199bf6 100644
--- a/web/tvl/logo/default.nix
+++ b/web/tvl/logo/default.nix
@@ -67,7 +67,7 @@ let
     </svg>
   '';
 
-in depot.nix.utils.drvTargets(lib.fix (self: {
+in depot.nix.readTree.drvTargets(lib.fix (self: {
   # Expose the logo construction functions.
   inherit palette darkCss lightCss animatedCss staticCss;