ts-reverse-proxy/flake.nix

45 lines
1.4 KiB
Nix
Raw Normal View History

2023-01-31 09:19:43 -07:00
{
description = "ts-reverse-proxy: a TailScale aware reverse proxy";
2023-09-20 09:40:16 -06:00
inputs.nixpkgs.url = "github:nixos/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};
2024-06-18 12:19:21 -06:00
buildGoModule = pkgs.buildGoModule;
2023-01-31 09:19:43 -07:00
in {
2023-11-17 07:09:26 -07:00
ts-reverse-proxy = buildGoModule {
2023-01-31 09:19:43 -07:00
pname = "ts-reverse-proxy";
2024-07-05 20:09:41 -06:00
version = "v1.0.6";
2023-01-31 09:19:43 -07:00
src = ./.;
2024-07-05 20:09:41 -06:00
vendorHash = "sha256-7Xlu3mKQwI5n6wdYOkcdgF/9BU4RIGTg57ly05Fk3AY=";
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:\@; '
2024-06-18 12:19:21 -06:00
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-11-17 07:09:26 -07:00
nativeBuildInputs = with pkgs; [ git go gopls go-tools graphviz ];
2023-01-31 09:19:43 -07:00
};
});
};
}