nixos-headscale/flake.nix

89 lines
3 KiB
Nix
Raw Normal View History

2022-11-26 23:12:36 -06:00
{
description = "headscale";
inputs = {
nixpkgs = {
url = "nixpkgs/nixos-unstable";
};
flake-utils = {
url = "github:numtide/flake-utils";
};
};
outputs = { self, nixpkgs, flake-utils }@inputs:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = import nixpkgs {
inherit system;
};
in
{
packages = {
headscale =
let
pname = "headscale";
2022-12-07 13:55:32 -06:00
version = "0.17.1";
2022-11-26 23:12:36 -06:00
in
pkgs.buildGoModule {
inherit pname version;
src = pkgs.fetchFromGitHub {
owner = "juanfont";
repo = "headscale";
rev = "v${version}";
2022-12-07 13:55:32 -06:00
sha256 = "sha256-/NJUtmH67VZERCvExcX4W4T9Rcixc5m28ujNcrQduWg=";
2022-11-26 23:12:36 -06:00
};
2022-12-07 13:55:32 -06:00
vendorSha256 = "sha256-Y1IK9Tx2sv0v27ZYtSxDP9keHQ7skctDOa+37pNGEC8=";
2022-11-26 23:12:36 -06:00
tags = [
"ts2019"
];
ldflags = [
"-s"
"-w"
"-X github.com/juanfont/headscale/cmd/headscale/cli.Version=v${version}"
];
checkFlags = [
"-short"
];
nativeBuildInputs = [
pkgs.installShellFiles
];
postInstall = ''
installShellCompletion --cmd headscale \
--bash <($out/bin/headscale completion bash) \
--fish <($out/bin/headscale completion fish) \
--zsh <($out/bin/headscale completion zsh)
'';
meta = with pkgs.lib; {
homepage = "https://github.com/juanfont/headscale";
description = "An open source, self-hosted implementation of the Tailscale control server";
longDescription = ''
Tailscale is a modern VPN built on top of Wireguard. It works like an
overlay network between the computers of your networks - using all kinds
of NAT traversal sorcery.
Everything in Tailscale is Open Source, except the GUI clients for
proprietary OS (Windows and macOS/iOS), and the
'coordination/control server'.
The control server works as an exchange point of Wireguard public keys for
the nodes in the Tailscale network. It also assigns the IP addresses of
the clients, creates the boundaries between each user, enables sharing
machines between users, and exposes the advertised routes of your nodes.
Headscale implements this coordination server.
'';
license = licenses.bsd3;
maintainers = with maintainers; [ nkje jk kradalby ];
};
};
};
}
);
}