tvl-depot/nix/tailscale/default.nix
2020-02-11 16:36:28 +00:00

19 lines
410 B
Nix

# 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))