Move tailscale to module
This commit is contained in:
@ -44,4 +44,5 @@ with lib.my;
|
|||||||
];
|
];
|
||||||
|
|
||||||
modules.desktop.gnome.enable = true;
|
modules.desktop.gnome.enable = true;
|
||||||
|
modules.networking.tailscale.enable = true;
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
./dev/zig.nix
|
./dev/zig.nix
|
||||||
./editors/neovim
|
./editors/neovim
|
||||||
./editors/vscode.nix
|
./editors/vscode.nix
|
||||||
|
./networking/tailscale.nix
|
||||||
./security/gpg.nix
|
./security/gpg.nix
|
||||||
./security/pass.nix
|
./security/pass.nix
|
||||||
./shell/git
|
./shell/git
|
||||||
|
20
modules/networking/tailscale.nix
Normal file
20
modules/networking/tailscale.nix
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
with lib.my;
|
||||||
|
let cfg = config.modules.networking.tailscale;
|
||||||
|
in {
|
||||||
|
options.modules.networking.tailscale = {
|
||||||
|
enable = mkBoolOpt false;
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
services.tailscale.enable = true;
|
||||||
|
services.openssh.openFirewall = false;
|
||||||
|
networking.firewall = {
|
||||||
|
checkReversePath = "loose";
|
||||||
|
trustedInterfaces = [ "tailscale0" ];
|
||||||
|
allowedUDPPorts = [ config.services.tailscale.port ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Reference in New Issue
Block a user