tsvnstat/flake.nix

41 lines
1.2 KiB
Nix
Raw Normal View History

2022-11-16 19:53:59 -07:00
{
description = "tsvnstat: a tailscale aware vmcstat server";
2023-09-20 09:36:27 -06:00
inputs.nixpkgs.url = "github:nixos/nixpkgs";
2022-11-16 19:53:59 -07:00
outputs = { self, nixpkgs }:
let
supportedSystems =
[ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
in {
packages = forAllSystems (system:
let pkgs = nixpkgsFor.${system};
in {
2023-09-20 09:36:27 -06:00
tsvnstat = pkgs.buildGo121Module {
2022-11-16 19:53:59 -07:00
pname = "tsvnstat";
2023-12-09 14:51:03 -07:00
version = "v0.0.13";
2022-11-16 19:53:59 -07:00
src = ./.;
2023-12-09 14:51:03 -07:00
vendorHash = "sha256-YNrE+JaoHjkqEVdOubgOiDKH332zY0Njy8JOYxMRoKw=";
2022-11-16 19:53:59 -07:00
proxyVendor = true;
};
});
defaultPackage = forAllSystems (system: self.packages.${system}.tsvnstat);
devShells = forAllSystems (system:
let pkgs = nixpkgsFor.${system};
in {
default = pkgs.mkShell {
shellHook = ''
PS1='\u@\h:\@; '
echo "Go `${pkgs.go}/bin/go version`"
'';
2023-09-20 09:36:27 -06:00
nativeBuildInputs = with pkgs; [ git go_1_21 gopls go-tools ];
2022-11-16 19:53:59 -07:00
};
});
};
}