nixosModules: move tailscale config to hosts

This commit is contained in:
Aly Raffauf 2024-07-07 20:10:54 -04:00
parent e2c9c12c10
commit 58b248367c
10 changed files with 15 additions and 41 deletions

View file

@ -4,7 +4,11 @@
pkgs, pkgs,
... ...
}: { }: {
age.secrets.wifi.file = ../secrets/wifi.age; age.secrets = {
tailscaleAuthKey.file = ../secrets/tailscale/authKeyFile.age;
wifi.file = ../secrets/wifi.age;
};
environment.variables.FLAKE = "github:alyraffauf/nixcfg"; environment.variables.FLAKE = "github:alyraffauf/nixcfg";
fileSystems = lib.attrsets.optionalAttrs (config.networking.hostName != "mauville") { fileSystems = lib.attrsets.optionalAttrs (config.networking.hostName != "mauville") {
@ -118,4 +122,10 @@
}; };
}; };
}; };
services.tailscale = {
enable = true;
openFirewall = true;
authKeyFile = config.age.secrets.tailscaleAuthKey.path;
};
} }

View file

@ -39,8 +39,6 @@
enable = true; enable = true;
syncMusic = false; syncMusic = false;
}; };
tailscale.enable = true;
}; };
users = { users = {

View file

@ -44,10 +44,7 @@
hyprland.enable = true; hyprland.enable = true;
}; };
services = { services.syncthing.enable = true;
syncthing.enable = true;
tailscale.enable = true;
};
users.aly = { users.aly = {
enable = true; enable = true;

View file

@ -58,10 +58,7 @@
steam.enable = true; steam.enable = true;
}; };
services = { services.flatpak.enable = true;
flatpak.enable = true;
tailscale.enable = true;
};
users = { users = {
aly = { aly = {

View file

@ -136,8 +136,6 @@ in {
syncMusic = true; syncMusic = true;
musicPath = "${mediaDirectory}/Music"; musicPath = "${mediaDirectory}/Music";
}; };
tailscale.enable = true;
}; };
}; };

View file

@ -42,10 +42,7 @@
hyprland.enable = true; hyprland.enable = true;
}; };
services = { services.syncthing.enable = true;
syncthing.enable = true;
tailscale.enable = true;
};
users.aly = { users.aly = {
enable = true; enable = true;

View file

@ -20,9 +20,7 @@
}; };
networking.hostName = "rustboro"; networking.hostName = "rustboro";
system.stateVersion = "24.05"; system.stateVersion = "24.05";
zramSwap.memoryPercent = 100; zramSwap.memoryPercent = 100;
ar = { ar = {
@ -41,10 +39,7 @@
hyprland.enable = true; hyprland.enable = true;
}; };
services = { services.syncthing.enable = true;
syncthing.enable = true;
tailscale.enable = true;
};
users.aly = { users.aly = {
enable = true; enable = true;

View file

@ -67,8 +67,6 @@
type = lib.types.str; type = lib.types.str;
}; };
}; };
tailscale.enable = lib.mkEnableOption "Tailscale WireGuard VPN.";
}; };
}; };
} }

View file

@ -7,6 +7,5 @@
imports = [ imports = [
./flatpak ./flatpak
./syncthing ./syncthing
./tailscale
]; ];
} }

View file

@ -1,15 +0,0 @@
{
pkgs,
lib,
config,
...
}: {
config = lib.mkIf config.ar.services.tailscale.enable {
age.secrets.tailscaleAuthKey.file = ../../../secrets/tailscale/authKeyFile.age;
services.tailscale = {
enable = true;
openFirewall = true;
authKeyFile = config.age.secrets.tailscaleAuthKey.path;
};
};
}