2023-04-21 16:18:33 +02:00
|
|
|
{ depot, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
depot.nix.readTree.drvTargets rec {
|
|
|
|
# Provide a Terraform wrapper with Yandex Cloud support.
|
|
|
|
terraform = pkgs.terraform.withPlugins (p: [
|
|
|
|
p.yandex
|
|
|
|
]);
|
|
|
|
|
|
|
|
validate = depot.tools.checks.validateTerraform {
|
|
|
|
inherit terraform;
|
|
|
|
name = "corp";
|
|
|
|
src = lib.cleanSource ./.;
|
|
|
|
};
|
|
|
|
|
2023-04-21 16:38:09 +02:00
|
|
|
# Yandex Cloud CLI
|
|
|
|
yc-cli = pkgs.stdenv.mkDerivation rec {
|
|
|
|
pname = "yc-cli";
|
2023-05-23 11:42:14 +02:00
|
|
|
version = "0.106.0";
|
2023-04-21 16:38:09 +02:00
|
|
|
|
|
|
|
src = pkgs.fetchurl {
|
|
|
|
url = "https://storage.yandexcloud.net/yandexcloud-yc/release/${version}/linux/amd64/yc";
|
2023-05-23 11:42:14 +02:00
|
|
|
sha256 = "sha256:1f7fq9rlihz91ld1vdjj9vq9ssq1ls031jin4zisxv75rcdpslh3";
|
2023-04-21 16:38:09 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
phases = [ "installPhase" ];
|
|
|
|
installPhase = "install -D $src $out/bin/yc";
|
|
|
|
};
|
|
|
|
|
2023-04-21 16:18:33 +02:00
|
|
|
deps = depot.tools.depot-deps.overrideDeps {
|
|
|
|
tf-yandex = {
|
|
|
|
attr = "corp.ops.terraform";
|
|
|
|
cmd = "terraform";
|
|
|
|
};
|
2023-04-21 16:38:09 +02:00
|
|
|
|
|
|
|
yc.attr = "corp.ops.yc-cli";
|
2023-04-21 16:18:33 +02:00
|
|
|
};
|
2023-04-21 18:56:48 +02:00
|
|
|
|
|
|
|
# Base image for Yandex VMs.
|
|
|
|
yandex-base-image = (depot.third_party.nixos {
|
|
|
|
configuration = { ... }: {
|
|
|
|
imports = [
|
2023-09-22 18:37:18 +02:00
|
|
|
(depot.path.origSrc + ("/ops/modules/yandex-cloud.nix"))
|
2023-04-21 18:56:48 +02:00
|
|
|
];
|
|
|
|
};
|
|
|
|
}).config.system.build.yandexCloudImage;
|
2023-04-21 16:18:33 +02:00
|
|
|
}
|