feat(nix/tailscale): Add function for generating tailscale ACLs
... and use it on Camden!
This commit is contained in:
parent
44b57d095b
commit
df1a4fef2b
2 changed files with 27 additions and 1 deletions
19
nix/tailscale/default.nix
Normal file
19
nix/tailscale/default.nix
Normal file
|
|
@ -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))
|
||||
Loading…
Add table
Add a link
Reference in a new issue