refactoring for iServer and isWorkstation: part 1
This commit is contained in:
parent
94f540b2d0
commit
af1d9ac368
37 changed files with 663 additions and 508 deletions
45
hosts/modules/networking.nix
Normal file
45
hosts/modules/networking.nix
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
hostType,
|
||||
inputs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
config = lib.mkMerge [
|
||||
# Common configuration
|
||||
{
|
||||
networking = {
|
||||
networkmanager.enable = true;
|
||||
firewall.enable = true;
|
||||
};
|
||||
|
||||
services = {
|
||||
tailscale = {
|
||||
enable = true;
|
||||
extraUpFlags = [ "--operator=user" ];
|
||||
};
|
||||
openssh.enable = true;
|
||||
};
|
||||
}
|
||||
|
||||
# Server specific configuration
|
||||
(lib.mkIf hostType.isServer {
|
||||
services.tailscale = {
|
||||
extraSetFlags = [ "--advertise-exit-node" ];
|
||||
useRoutingFeatures = "server";
|
||||
};
|
||||
})
|
||||
|
||||
# Workstation specific configuration
|
||||
(lib.mkIf hostType.isWorkstation {
|
||||
services = {
|
||||
tailscale.useRoutingFeatures = "client";
|
||||
nginx = {
|
||||
enable = true;
|
||||
virtualHosts."localhost".root = inputs.homepage;
|
||||
};
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue