about summary refs log tree commit diff
path: root/nix/tailscale/default.nix
blob: 4f533f6d61d2179c350343fa4dc85fdaa30da41e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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))