diff options
-rw-r--r-- | nix/buildkite/default.nix | 10 | ||||
-rw-r--r-- | nix/readTree/default.nix | 9 | ||||
-rw-r--r-- | views/kit/default.nix | 6 |
3 files changed, 15 insertions, 10 deletions
diff --git a/nix/buildkite/default.nix b/nix/buildkite/default.nix index d299d526241b..eb8061cf6b09 100644 --- a/nix/buildkite/default.nix +++ b/nix/buildkite/default.nix @@ -6,7 +6,7 @@ # # The structure of the file that is being created is documented here: # https://buildkite.com/docs/pipelines/defining-steps -{ pkgs, ... }: +{ depot, pkgs, ... }: let inherit (builtins) @@ -29,6 +29,7 @@ let unsafeDiscardStringContext; inherit (pkgs) lib runCommandNoCC writeText; + inherit (depot.nix.readTree) mkLabel; in rec { # Creates a Nix expression that yields the target at the specified @@ -46,13 +47,6 @@ rec { in if target ? __subtarget then subtargetExpr else targetExpr; - # Create a pipeline label from the target's tree location. - mkLabel = target: - let label = concatStringsSep "/" target.__readTree; - in if target ? __subtarget - then "${label}:${target.__subtarget}" - else label; - # Determine whether to skip a target if it has not diverged from the # HEAD branch. shouldSkip = parentTargetMap: label: drvPath: diff --git a/nix/readTree/default.nix b/nix/readTree/default.nix index 22815a44c4ee..5d2e1fff6aa8 100644 --- a/nix/readTree/default.nix +++ b/nix/readTree/default.nix @@ -58,6 +58,13 @@ let __readTreeChildren = builtins.attrNames children; }; + # Create a label from a target's tree location. + mkLabel = target: + let label = concatStringsSep "/" target.__readTree; + in if target ? __subtarget + then "${label}:${target.__subtarget}" + else label; + # Merge two attribute sets, but place attributes in `passthru` via # `overrideAttrs` for derivation targets that support it. merge = a: b: @@ -188,7 +195,7 @@ let isDerivation = x: isAttrs x && x ? type && x.type == "derivation"; in { - inherit gather; + inherit gather mkLabel; __functor = _: { path diff --git a/views/kit/default.nix b/views/kit/default.nix index ba46b719e286..0548fb7bbb7b 100644 --- a/views/kit/default.nix +++ b/views/kit/default.nix @@ -15,9 +15,13 @@ pkgs.lib.fix (self: { buildGo = import ./buildGo { inherit pkgs; }; - buildkite = import ./buildkite { inherit pkgs; }; readTree = import ./readTree { }; + buildkite = import ./buildkite { + inherit pkgs; + depot.nix.readTree = self.readTree; + }; + besadii = import ./besadii { depot.nix.buildGo = self.buildGo; }; |