📌 overlay for tailscale

This commit is contained in:
James Walker 2021-11-19 22:59:43 -05:00
parent 3caf10caf3
commit c2caeb4dae
Signed by: walkah
GPG Key ID: 3C127179D6086E93
6 changed files with 54 additions and 1 deletions

View File

@ -9,6 +9,8 @@
../../modules/sops ../../modules/sops
]; ];
nixpkgs.overlays = [ (import ../../overlays) ];
# Use the extlinux boot loader. (NixOS wants to enable GRUB by default) # Use the extlinux boot loader. (NixOS wants to enable GRUB by default)
boot.loader.grub.enable = false; boot.loader.grub.enable = false;
# Enables the generation of /boot/extlinux/extlinux.conf # Enables the generation of /boot/extlinux/extlinux.conf

View File

@ -23,6 +23,7 @@ in {
boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [ (import ../../overlays) ];
# Set your time zone. # Set your time zone.
time.timeZone = "America/Toronto"; time.timeZone = "America/Toronto";

View File

@ -17,6 +17,8 @@ in {
../../modules/matrix/nginx.nix ../../modules/matrix/nginx.nix
]; ];
nixpkgs.overlays = [ (import ../../overlays) ];
boot.cleanTmpDir = true; boot.cleanTmpDir = true;
# Set your time zone. # Set your time zone.

3
overlays/default.nix Normal file
View File

@ -0,0 +1,3 @@
self: super: {
tailscale = super.callPackage ../pkgs/tailscale/default.nix { };
}

View File

@ -0,0 +1,42 @@
{ lib, stdenv, buildGo117Module, fetchFromGitHub, makeWrapper, iptables, iproute2, procps }:
buildGo117Module rec {
pname = "tailscale";
version = "1.18.0";
src = fetchFromGitHub {
owner = "tailscale";
repo = "tailscale";
rev = "v${version}";
sha256 = "sha256-bexcln2BTYZo17zyxJKiRt7xkMEgAijRsl9HxHEA9og=";
};
nativeBuildInputs = lib.optionals stdenv.isLinux [ makeWrapper ];
CGO_ENABLED = 0;
vendorSha256 = "sha256-ulgTwnuisnkQf0WLQhZ70MwuOpZuroh7ShxBGyv0d0k=";
doCheck = false;
subPackages = [ "cmd/tailscale" "cmd/tailscaled" ];
tags = [ "xversion" ];
ldflags = [ "-X tailscale.com/version.Long=${version}" "-X tailscale.com/version.Short=${version}" ];
postInstall = lib.optionalString stdenv.isLinux ''
wrapProgram $out/bin/tailscaled --prefix PATH : ${lib.makeBinPath [ iproute2 iptables ]}
wrapProgram $out/bin/tailscale --suffix PATH : ${lib.makeBinPath [ procps ]}
sed -i -e "s#/usr/sbin#$out/bin#" -e "/^EnvironmentFile/d" ./cmd/tailscaled/tailscaled.service
install -D -m0444 -t $out/lib/systemd/system ./cmd/tailscaled/tailscaled.service
'';
meta = with lib; {
homepage = "https://tailscale.com";
description = "The node agent for Tailscale, a mesh VPN built on WireGuard";
license = licenses.bsd3;
maintainers = with maintainers; [ danderson mbaillie ];
};
}

View File

@ -1,6 +1,9 @@
let let
sources = import ./nix/sources.nix; sources = import ./nix/sources.nix;
pkgs = import sources.nixpkgs { }; pkgs = import sources.nixpkgs {
overlays = [ (import ./overlays) ];
config = { };
};
in in
pkgs.mkShell { pkgs.mkShell {
name = "athens"; name = "athens";