From df1a4fef2bcf20a3b54f2fc1b4c8220d663d04cd Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 11 Feb 2020 16:36:28 +0000 Subject: feat(nix/tailscale): Add function for generating tailscale ACLs ... and use it on Camden! --- nix/tailscale/default.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 nix/tailscale/default.nix (limited to 'nix/tailscale') diff --git a/nix/tailscale/default.nix b/nix/tailscale/default.nix new file mode 100644 index 0000000000..4f533f6d61 --- /dev/null +++ b/nix/tailscale/default.nix @@ -0,0 +1,19 @@ +# This file defines a Nix helper function to create Tailscale ACL files. +# +# https://tailscale.com/kb/1018/install-acls + +{ pkgs, ... }: + +with pkgs.nix.yants; + +let + inherit (builtins) toFile toJSON; + + entry = struct "aclEntry" { + Action = enum [ "accept" "reject" ]; + Users = list string; + Ports = list string; + }; + + acl = list entry; +in entries: toFile "tailscale-acl.json" (toJSON (acl entries)) -- cgit 1.4.1