feat: tailscale homelab module
This commit is contained in:
@@ -23,6 +23,12 @@
|
||||
ip = "100.66.139.89";
|
||||
localIp = "192.168.1.10";
|
||||
|
||||
tailscale = {
|
||||
enable = true;
|
||||
mode = "both";
|
||||
exitNode = true;
|
||||
};
|
||||
|
||||
forgejo = {
|
||||
enable = true;
|
||||
settings.users."user1" = {
|
||||
|
||||
@@ -14,11 +14,6 @@
|
||||
nameservers = [ "100.100.100.100" "1.1.1.1" "8.8.8.8" ];
|
||||
};
|
||||
|
||||
services.tailscale = {
|
||||
enable = true;
|
||||
useRoutingFeatures = "both";
|
||||
};
|
||||
|
||||
boot.kernel.sysctl."net.ipv4.ip_forward" = 1;
|
||||
boot.kernel.sysctl."net.ipv6.conf.all.forwarding" = 1;
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ in
|
||||
./adguard.nix
|
||||
./caddy.nix
|
||||
./forgejo.nix
|
||||
./tailscale.nix
|
||||
];
|
||||
options.homelab = with lib; with lib.types; {
|
||||
enable = mkEnableOption "";
|
||||
|
||||
33
modules/nixos/homelab/tailscale.nix
Normal file
33
modules/nixos/homelab/tailscale.nix
Normal file
@@ -0,0 +1,33 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.homelab.tailscale;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./network.nix
|
||||
];
|
||||
options.homelab.tailscale = with lib; with lib.types; {
|
||||
enable = mkEnableOption "";
|
||||
mode = mkOption {
|
||||
type = enum [
|
||||
"client"
|
||||
"server"
|
||||
"both"
|
||||
];
|
||||
default = "both";
|
||||
};
|
||||
exitNode = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
};
|
||||
settings = { };
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.tailscale = {
|
||||
enable = true;
|
||||
useRoutingFeatures = cfg.mode;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user