mirror of
https://github.com/blahai/nyx.git
synced 2025-02-23 15:15:10 +00:00
33 lines
729 B
Nix
33 lines
729 B
Nix
{
|
|
lib,
|
|
pkgs,
|
|
config,
|
|
...
|
|
}: let
|
|
inherit (lib.modules) mkIf mkDefault;
|
|
inherit (lib.options) mkEnableOption;
|
|
inherit (config.services) tailscale;
|
|
|
|
sys = config.olympus.system.networking;
|
|
cfg = sys.tailscale;
|
|
in {
|
|
options.olympus.system.networking.tailscale = {
|
|
enable = mkEnableOption "Tailscale";
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
environment.systemPackages = [pkgs.tailscale];
|
|
|
|
networking.firewall = {
|
|
# always allow traffic from your Tailscale network
|
|
trustedInterfaces = ["${tailscale.interfaceName}"];
|
|
checkReversePath = "loose";
|
|
};
|
|
|
|
services.tailscale = {
|
|
enable = true;
|
|
openFirewall = true;
|
|
useRoutingFeatures = mkDefault "server";
|
|
};
|
|
};
|
|
}
|