commit 233d837c6f2b5b54a2f906d25a34efe617be3be0 Author: Jeffrey C. Ollie Date: Sat Nov 26 23:12:36 2022 -0600 first diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c4a847d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/result diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..076db23 --- /dev/null +++ b/flake.lock @@ -0,0 +1,42 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1669411043, + "narHash": "sha256-LfPd3+EY+jaIHTRIEOUtHXuanxm59YKgUacmSzaqMLc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5dc7114b7b256d217fe7752f1614be2514e61bb8", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..2b6f6bf --- /dev/null +++ b/flake.nix @@ -0,0 +1,88 @@ +{ + 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"; + version = "0.17.0"; + in + pkgs.buildGoModule { + inherit pname version; + + src = pkgs.fetchFromGitHub { + owner = "juanfont"; + repo = "headscale"; + rev = "v${version}"; + sha256 = "sha256-KBTZpf9hHX1GeI2r0Tksa8oWdCVZz1wXKpy9htvk2RY="; + }; + + vendorSha256 = "sha256-Cq0WipTQ+kGcvnfP0kjyvjyonl2OC9W7Tj0MCuB1lDU="; + + 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 ]; + }; + }; + }; + } + ); +}