53 lines
1.6 KiB
Nix
53 lines
1.6 KiB
Nix
{
|
|
description = "Zitadel Resources Operator";
|
|
|
|
inputs = {
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, nixpkgs-unstable, flake-utils }:
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
unstable = nixpkgs-unstable.legacyPackages.${system};
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
package = unstable.buildGoModule {
|
|
pname = "zitadel-resources-operator";
|
|
version = "0.0.0";
|
|
src = ../src;
|
|
doCheck = false;
|
|
vendorHash = "sha256-HEXIHASdDC7chG9uF56f6pvZPVbxYs/fWFytDz6CAf4=";
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/bin
|
|
dir="$GOPATH/bin"
|
|
[ -e "$dir" ] && cp -r $dir/cmd $out/manager
|
|
|
|
runHook postInstall
|
|
'';
|
|
};
|
|
dockerPackage = pkgs.dockerTools.buildImage {
|
|
name = "zitadel-resources-operator";
|
|
fromImageName = "gcr.io/distroless/static";
|
|
fromImageTag = "nonroot";
|
|
copyToRoot = pkgs.buildEnv {
|
|
name = "operator";
|
|
paths = [ package ];
|
|
pathsToLink = [ "/" ];
|
|
};
|
|
config = {
|
|
Cmd = [ "/manager" ];
|
|
WorkingDir = "/";
|
|
User = "65532:65532";
|
|
};
|
|
};
|
|
in with pkgs; {
|
|
packages.default = package;
|
|
packages.dockerImage = dockerPackage;
|
|
devShells.default = mkShell {
|
|
buildInputs = [ nixfmt unstable.gopls operator-sdk unstable.go ];
|
|
};
|
|
});
|
|
}
|