Networking: add tailscale
This commit is contained in:
parent
d409120c43
commit
ffc1784f52
2 changed files with 34 additions and 1 deletions
|
@ -9,7 +9,7 @@ in {
|
|||
./firewall
|
||||
|
||||
./ssh.nix
|
||||
#./tailscale.nix
|
||||
./tailscale.nix
|
||||
];
|
||||
|
||||
networking = {
|
||||
|
|
33
modules/nixos/networking/tailscale.nix
Normal file
33
modules/nixos/networking/tailscale.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
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";
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Reference in a new issue