diff options
| author | Devin Finlinson <devin.finlinson@pm.me> | 2023-11-20 03:24:35 -0700 |
|---|---|---|
| committer | Devin Finlinson <devin.finlinson@pm.me> | 2023-11-20 03:24:35 -0700 |
| commit | 912267079a8eaa6ac1d866ef6e02c1046febbb66 (patch) | |
| tree | 0f5be4476dbc748709641765039f05210d8bbeb3 | |
| parent | 29fbd6e057d2308987fee2537bd68a8e6d7727b5 (diff) | |
updated template with modern settings
| -rw-r--r-- | flake.nix | 14 | ||||
| -rw-r--r-- | modules/nixos/headscale.nix | 30 |
2 files changed, 43 insertions, 1 deletions
@@ -232,7 +232,7 @@ ]; # specialArgs = { inherit inputs; }; }; - doretta = nixpkgs.lib.nixosSystem { + doretta = nixpkgs.lib.nixosSystem { # this is my build server modules = [ ./machines/doretta/configuration.nix ./machines/doretta/hardware-configuration.nix @@ -242,6 +242,18 @@ ./modules/nixos/system-packages.nix ]; }; + bosco = nixpkgs.lib.nixosSystem { # this is my networking server + modules = [ + ./machines/bosco/configuration.nix + ./machines/bosco/hardware-configuration.nix + + ./modules/nixos/nix-common.nix + ./modules/nixos/environment.nix + ./modules/nixos/system-packages.nix + + ./modules/nixos/headscale.nix + ]; + }; khad = nixpkgs.lib.nixosSystem { modules = [ ./machines/khad/configuration.nix diff --git a/modules/nixos/headscale.nix b/modules/nixos/headscale.nix new file mode 100644 index 0000000..a38008e --- /dev/null +++ b/modules/nixos/headscale.nix @@ -0,0 +1,30 @@ +{config, pkgs, ...}: +let + domain = "wormcar.gay"; + subDomain = "bosco." + "${domain}"; +in { + services = { + headscale = { + enable = true; + address = "0.0.0.0"; + port = 8080; + settings = { + logtail.enabled = false; + serverUrl = "https://${subDomain}"; + dns_config.base_domain = "${domain}"; + }; + }; + + nginx.virtualHosts.${subDomain} = { + forceSSL = true; + enableACME = true; + locations."/" = { + proxyPass = + "http://localhost:${toString config.services.headscale.port}"; + proxyWebsockets = true; + }; + }; + }; + + environment.systemPackages = [ config.services.headscale.package ]; +} |
