debanator/flake.nix

38 lines
989 B
Nix
Raw Normal View History

2023-05-01 01:22:25 +01:00
{
2023-05-04 23:52:02 +01:00
description = "Serve your deb files as an APT repo";
2023-05-01 01:22:25 +01:00
inputs.utils.url = "github:numtide/flake-utils";
inputs.devshell.url = "github:numtide/devshell";
2023-05-04 23:52:02 +01:00
inputs.nixpkgs.url = "github:nixos/nixpkgs";
2023-05-01 01:22:25 +01:00
outputs = {
self,
nixpkgs,
utils,
devshell,
}:
utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [devshell.overlays.default];
};
in rec {
packages.default = pkgs.buildGoModule {
2023-05-04 23:52:02 +01:00
name = "debanator";
2023-05-01 01:22:25 +01:00
src = self;
2023-05-04 23:52:02 +01:00
vendorSha256 = "sha256-M8/8fi0JBkUDjhLpur54bv2HzaOEhAIuqZO+oSvkIBk=";
2023-05-01 01:22:25 +01:00
2023-05-05 00:06:18 +01:00
# doesn't work
#ldflags = ''
# -X github.com/wlcx/debanator.Commit=${if self ? rev then self.rev else "dirty"}
#'';
2023-05-01 01:22:25 +01:00
};
apps.default = utils.lib.mkApp {drv = packages.default;};
devShells.default =
2023-05-04 23:12:16 +01:00
pkgs.devshell.mkShell {packages = with pkgs; [go gopls goreleaser];};
2023-05-01 01:22:25 +01:00
formatter = pkgs.alejandra;
});
}