Move all nixos-modules out of qois subfolder
This commit is contained in:
parent
d49f58265f
commit
97d1a30329
22 changed files with 3 additions and 14 deletions
50
nixos-modules/vpn-exit-node/default.nix
Normal file
50
nixos-modules/vpn-exit-node/default.nix
Normal file
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.qois.vpn-exit-node;
|
||||
in
|
||||
{
|
||||
|
||||
options.qois.vpn-exit-node = {
|
||||
enable = mkEnableOption "vpn exit node";
|
||||
domain = mkOption {
|
||||
description = "Domain for the VPN admin server";
|
||||
type = types.str;
|
||||
default = "vpn.qo.is";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
qois.backup-client.includePaths = [ "/var/lib/tailscale" ];
|
||||
|
||||
sops.secrets."tailscale/key".restartUnits = [ "tailscaled.service" ];
|
||||
|
||||
services.tailscale = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
useRoutingFeatures = "server";
|
||||
authKeyFile = config.sops.secrets."tailscale/key".path;
|
||||
extraUpFlags =
|
||||
let
|
||||
backplaneRoute =
|
||||
with config.qois.meta.network.virtual.backplane.v4;
|
||||
"${id}/${builtins.toString prefixLength}";
|
||||
in
|
||||
[
|
||||
"--timeout 60s"
|
||||
"--accept-dns=false"
|
||||
"--accept-routes=false"
|
||||
"--login-server=https://${cfg.domain}"
|
||||
"--advertise-exit-node"
|
||||
"--advertise-routes=${backplaneRoute}"
|
||||
"--advertise-tags=tag:srv"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue