Files
zitadel-resources-operator/build/flake.nix
HaimKortovich d5c3485fd2
All checks were successful
Build and Publish / build-release (push) Successful in 8m29s
move everything to src
2026-04-07 12:33:54 -05:00

66 lines
1.6 KiB
Nix

{
description = "Zitadel Resources Operator";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
package = pkgs.buildGoModule {
pname = "zitadel-resources-operator";
version = "0.0.0";
src = ../.;
doCheck = false;
vendorHash = "sha256-j8In3lKJ3ZpxI5i1HxasM2uqQ/j1Mmkh+VgoC2tNSGc=";
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
gopls
operator-sdk
go
];
};
}
);
}