feat: Tailscale VPN Setup
This commit is contained in:
@@ -41,5 +41,4 @@
|
||||
|
||||
systems = [ "x86_64-linux" ];
|
||||
};
|
||||
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style;
|
||||
}
|
||||
|
||||
@@ -35,4 +35,8 @@ in
|
||||
bluetooth.enable = true;
|
||||
sound.enable = true;
|
||||
};
|
||||
|
||||
my.services = {
|
||||
vpn.enable = true;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
imports = [
|
||||
./environments
|
||||
./hardware
|
||||
./services
|
||||
];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
# Service-related modules
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./vpn
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
# self-hosted vpn
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.services.vpn;
|
||||
inherit (config.networking) domain;
|
||||
in
|
||||
{
|
||||
options.my.services.vpn = with lib; {
|
||||
enable = mkEnableOption "Headscale VPN Setup";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
services.tailscale.enable = true;
|
||||
}
|
||||
]
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user