ts-reverse-proxy/flake.nix

44 lines
1.3 KiB
Nix
Raw Normal View History

2023-01-31 09:19:43 -07:00
{
description = "ts-reverse-proxy: a TailScale aware reverse proxy";
inputs.nixpkgs.url = "nixpkgs";
2023-01-31 09:19:43 -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 {
2023-01-31 09:31:00 -07:00
overlay = final: prev: {
2023-01-31 09:47:28 -07:00
inherit (self.packages.${prev.system}) ts-reverse-proxy;
2023-01-31 09:31:00 -07:00
};
2023-01-31 09:19:43 -07:00
packages = forAllSystems (system:
let pkgs = nixpkgsFor.${system};
in {
ts-reverse-proxy = pkgs.buildGoModule {
2023-01-31 09:19:43 -07:00
pname = "ts-reverse-proxy";
version = "v1.0.0";
2023-01-31 09:19:43 -07:00
src = ./.;
vendorSha256 = "sha256-4m9+yCeYWl5bDLxT6oClTUPQtnZsJEdxj7byh6ZZkdI=";
2023-01-31 09:19:43 -07:00
};
});
defaultPackage = forAllSystems (system: self.packages.${system}.ts-reverse-proxy);
devShells = forAllSystems (system:
let pkgs = nixpkgsFor.${system};
in {
default = pkgs.mkShell {
shellHook = ''
PS1='\u@\h:\@; '
echo "Go `${pkgs.go}/bin/go version`"
2023-05-08 16:10:41 -06:00
nix run github:qbit/xin#flake-warn
2023-01-31 09:19:43 -07:00
'';
2023-04-28 08:24:52 -06:00
nativeBuildInputs = with pkgs; [ git go_1_20 gopls go-tools graphviz ];
2023-01-31 09:19:43 -07:00
};
});
};
}