Migrate config from dotfiles

This commit is contained in:
2023-06-26 14:40:59 +01:00
parent e45609ea4b
commit a7e1525e34
69 changed files with 2236 additions and 161 deletions

View File

@ -0,0 +1,21 @@
{ config, lib, pkgs, ... }:
with lib;
with lib.my;
let cfg = config.modules.networking.tailscale;
in {
options.modules.networking.tailscale = {
enable = mkBoolOpt false;
restrictSSH = mkBoolOpt true;
};
config = mkIf cfg.enable {
services.tailscale.enable = true;
services.openssh.openFirewall = !cfg.restrictSSH;
networking.firewall = {
checkReversePath = "loose";
trustedInterfaces = [ "tailscale0" ];
allowedUDPPorts = [ config.services.tailscale.port ];
};
};
}