Theia/Nyx: add tailscale

This commit is contained in:
blahai 2024-12-05 16:21:51 +02:00
parent 5c4c73eda2
commit e97df2e113
Signed by: blahai
SSH key fingerprint: SHA256:ZfCryi+V64yG+vC1ZIIsqgvBCmA31tTi7RJ6M8CvpRc
3 changed files with 36 additions and 6 deletions

View file

@ -17,6 +17,13 @@
initrd.kernelModules = [ ]; initrd.kernelModules = [ ];
kernelPackages = pkgs.linuxPackages_6_12; kernelPackages = pkgs.linuxPackages_6_12;
kernelModules = [ "kvm-amd" ]; kernelModules = [ "kvm-amd" ];
kernel = {
sysctl = {
"vm.max_map_count" = 2147483642;
"net.ipv4.ip_forward" = 1;
"net.ipv6.conf.all.forwarding" = 1;
};
};
extraModulePackages = [ ]; extraModulePackages = [ ];
loader.grub = { loader.grub = {
enable = true; enable = true;
@ -24,9 +31,8 @@
}; };
}; };
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ nixpkgs.config.allowUnfreePredicate = pkg:
"netdata" builtins.elem (lib.getName pkg) [ "netdata" ];
];
nix = { nix = {
package = pkgs.lix; package = pkgs.lix;
@ -94,6 +100,21 @@
}; };
services = { services = {
tailscale = {
enable = true;
useRoutingFeatures = "server";
openFirewall = true;
};
networkd-dispatcher = {
enable = true;
rules."50-tailscale" = {
onState = [ "routable" ];
script = ''
${lib.getExe pkgs.ethtool} -K ens3 rx-udp-gro-forwarding on rx-gro-list off
'';
};
};
earlyoom = { earlyoom = {
enable = true; enable = true;
@ -170,9 +191,7 @@
"access log" = "none"; "access log" = "none";
"error log" = "syslog"; "error log" = "syslog";
}; };
package = pkgs.netdata.override { package = pkgs.netdata.override { withCloudUi = true; };
withCloudUi = true;
};
}; };
forgejo = { forgejo = {
@ -287,5 +306,7 @@
jq jq
busybox busybox
fish fish
ethtool
networkd-dispatcher
]; ];
} }

View file

@ -4,5 +4,6 @@
./vpn.nix ./vpn.nix
./pipewire.nix ./pipewire.nix
./bluetooth.nix ./bluetooth.nix
./tailscale.nix
]; ];
} }

View file

@ -0,0 +1,8 @@
{ pkgs, ... }: {
services.tailscale = {
enable = true;
};
environment.systemPackages = with pkgs; [
trayscale
];
}