2021-11-17 14:38:24 +00:00
|
|
|
{
|
2022-04-17 01:36:23 +01:00
|
|
|
description = "Samw's APC PDU MQTT bridge";
|
2021-11-17 14:38:24 +00:00
|
|
|
|
2022-04-17 01:36:23 +01:00
|
|
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
2023-01-31 17:17:22 +00:00
|
|
|
inputs.devshell = {
|
|
|
|
url = "github:numtide/devshell";
|
|
|
|
inputs.flake-utils.follows = "flake-utils";
|
2023-07-15 15:24:45 +01:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
2023-01-31 17:17:22 +00:00
|
|
|
};
|
2021-11-17 14:38:24 +00:00
|
|
|
|
2023-01-31 17:17:22 +00:00
|
|
|
outputs = { self, nixpkgs, flake-utils, devshell }:
|
2022-04-17 01:36:23 +01:00
|
|
|
flake-utils.lib.eachDefaultSystem (system:
|
2023-01-31 17:17:22 +00:00
|
|
|
let
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
2023-07-15 15:34:05 +01:00
|
|
|
overlays = [ devshell.overlays.default ];
|
2023-01-31 17:17:22 +00:00
|
|
|
};
|
2022-04-17 01:36:23 +01:00
|
|
|
in rec {
|
|
|
|
packages.apc2mqtt = pkgs.buildGoModule {
|
|
|
|
name = "apc2mqtt";
|
|
|
|
src = self;
|
|
|
|
vendorSha256 = "sha256-GlRcuUNrsNnONigXut2xFx0kX+5k80Djn07c3UutCLU=";
|
|
|
|
ldflags = ''
|
|
|
|
-X main.version=${if self ? rev then self.rev else "dirty"}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
defaultPackage = packages.apc2mqtt;
|
2023-01-31 17:17:22 +00:00
|
|
|
devShell =
|
|
|
|
pkgs.devshell.mkShell { packages = with pkgs; [ go gopls mosquitto ]; };
|
2022-04-17 01:36:23 +01:00
|
|
|
});
|
2021-11-17 14:38:24 +00:00
|
|
|
}
|