caddy-log-exporter/flake.nix

58 lines
1.3 KiB
Nix
Raw Normal View History

2024-09-19 11:21:05 +02:00
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = inputs:
inputs.flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ ];
};
2024-09-19 14:33:36 +02:00
caddy-log-exporter = pkgs.buildGo123Module {
name = "caddy-log-exporter";
src = ./.;
vendorHash = null;
ldflags = [ "-s" "-w" "-extldflags '-static'" ];
CGO_ENABLED = 0;
};
docker = pkgs.dockerTools.buildImage {
name = "xsteadfastx/caddy-log-exporter";
tag = "latest";
config = {
Entrypoint = [ "${caddy-log-exporter}/bin/caddy-log-exporter" ];
};
};
2024-09-19 11:21:05 +02:00
env-pkgs = with pkgs; [
go_1_23
go-task
gofumpt
golangci-lint
golines
gopls
2024-09-19 14:33:36 +02:00
skopeo
2024-09-19 11:21:05 +02:00
];
in
with pkgs; {
2024-09-19 14:33:36 +02:00
packages =
{
default = caddy-log-exporter;
inherit caddy-log-exporter docker;
};
2024-09-19 11:21:05 +02:00
devShells.default = mkShell {
buildInputs = env-pkgs;
};
}
);
}