Skip to content

Commit

Permalink
nix: add container image (#3)
Browse files Browse the repository at this point in the history
* nix: add package

* nix: add container image

---------

Co-authored-by: Lars Sjöström <lars@radicore.se>
  • Loading branch information
dln and lsjostro authored Oct 1, 2024
1 parent 495a08a commit 6cbd91e
Showing 1 changed file with 30 additions and 13 deletions.
43 changes: 30 additions & 13 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
utils.lib.eachDefaultSystem (
system:
let
inherit (nixpkgs) lib;

pkgs = import nixpkgs {
inherit system;
};
Expand All @@ -36,22 +38,37 @@
];
in
{
packages.default = pkgs.buildGo123Module {
pname = "envoy-oidc-authserver";
version = "main";
src = ./.;
packages = {
default = pkgs.buildGo123Module {
pname = "envoy-oidc-authserver";
version = "main";
src = ./.;

meta = {
desciption = "Envoy OIDC Authserver";
homepage = "https://github.com/shelmangroup/envoy-oidc-authserver";
mainProgram = "envoy-oidc-authserver";
};

# vendorHash = ""; # Use this when upgrading dependencies
vendorHash = "sha256-n7+O+uc8YRnhXccVVnKE6zK8kh8EGiKeiES4A+R1Dhg=";
# vendorHash = ""; # Use this when upgrading dependencies
vendorHash = "sha256-n7+O+uc8YRnhXccVVnKE6zK8kh8EGiKeiES4A+R1Dhg=";

nativeBuildInputs = with pkgs; [
buf
protoc-gen-go
];
nativeBuildInputs = with pkgs; [
buf
protoc-gen-go
];

prePatch = ''
HOME="$TMPDIR" ${pkgs.buf}/bin/buf generate
'';
prePatch = ''
HOME="$TMPDIR" ${pkgs.buf}/bin/buf generate
'';
};

container = pkgs.dockerTools.buildImage {
name = "envoy-oidc-authserver";
tag = "latest";
copyToRoot = [ self.packages.${system}.default ];
config.Entrypoint = [ (lib.getExe self.packages.${system}.default) ];
};
};

devShells = {
Expand Down

0 comments on commit 6cbd91e

Please sign in to comment.