Created
March 3, 2023 12:19
-
-
Save MAHDTech/c61ef2a0d57af3fadaa207ba1ba5ba4e to your computer and use it in GitHub Desktop.
Referencing custom derivations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{pkgs, ...}: | |
pkgs.dockerTools.buildImage { | |
name = "pivnet"; | |
tag = "latest"; | |
created = "now"; | |
copyToRoot = pkgs.buildEnv { | |
name = "image-root"; | |
pathsToLink = ["/bin"]; | |
paths = with pkgs; [ | |
# Common | |
busybox | |
curlFull | |
cacert | |
# Tools | |
(callPackage ./pivnet.nix {}) | |
]; | |
}; | |
config = { | |
Entrypoint = [ | |
""${REFERENCE_HERE}/bin/pivnet" | |
]; | |
Cmd = [ | |
]; | |
ExposedPorts = { | |
}; | |
Env = [ | |
"SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt" | |
]; | |
WorkingDir = "/workdir"; | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{pkgs, ...}: let | |
pivnet = pkgs.fetchurl { | |
name = "pivnet"; | |
url = "https://github.com/pivotal-cf/pivnet-cli/releases/download/v3.0.1/pivnet-linux-amd64-3.0.1"; | |
sha256 = "sha256-et44d6fpcyJ8WMrGrjpRrXiBMDh8FmRjaR/gjzd5KPw="; | |
}; | |
in | |
pkgs.stdenv.mkDerivation { | |
name = "pivnet"; | |
version = "v3.0.1"; | |
phases = ["installPhase"]; | |
installPhase = '' | |
mkdir --parents $out/bin | |
install --verbose ${pivnet} $out/bin/pivnet | |
''; | |
meta = { | |
description = "CLI to interact with Tanzu Network API V2 interface."; | |
homepage = "https://github.com/pivotal-cf/pivnet-cli"; | |
license = "Apache 2.0"; | |
}; | |
} |
Author
MAHDTech
commented
Mar 3, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment