diff options
author | Martin Fischer <martin@push-f.com> | 2024-12-18 08:58:08 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2024-12-18 09:26:11 +0100 |
commit | d2a7379876196b64fe345f47db2ab91d5315857d (patch) | |
tree | e262c7e3ca3db7944a304d51320fa6540290f8af /nixos | |
parent | e7990ebbba8c9b903687c177588b45e9294f8d11 (diff) |
refactor: introduce domains.nix
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/domains.nix | 7 | ||||
-rw-r--r-- | nixos/parts/tailscale.nix | 5 | ||||
-rw-r--r-- | nixos/tente-configuration.nix | 7 |
3 files changed, 14 insertions, 5 deletions
diff --git a/nixos/domains.nix b/nixos/domains.nix new file mode 100644 index 0000000..95f0a3c --- /dev/null +++ b/nixos/domains.nix @@ -0,0 +1,7 @@ +let + domain = "beta.push-f.com"; +in +{ + personalWebsite = domain; + tailscaleControlServer = "tailscale.${domain}"; +} diff --git a/nixos/parts/tailscale.nix b/nixos/parts/tailscale.nix index bce1564..1cb6dcf 100644 --- a/nixos/parts/tailscale.nix +++ b/nixos/parts/tailscale.nix @@ -1,10 +1,13 @@ +let + domains = import ../domains.nix; +in { config, pkgs, ... }: { services.tailscale = { enable = true; extraUpFlags = [ - "--login-server=https://headscale.push-f.com/" + "--login-server=https://${domains.tailscaleControlServer}/" ]; # Only needed during activation. # authKeyFile = "/tmp/key-file"; diff --git a/nixos/tente-configuration.nix b/nixos/tente-configuration.nix index 3c52332..459fe87 100644 --- a/nixos/tente-configuration.nix +++ b/nixos/tente-configuration.nix @@ -4,7 +4,7 @@ # https://search.nixos.org/options and in the NixOS manual (`nixos-help`). let - domain = "beta.push-f.com"; + domains = import ./domains.nix; acmeEmail = "martin@push-f.com"; in { config, lib, pkgs, ... }: @@ -101,11 +101,10 @@ in group = "www-data"; }; - # My personal website - nginx.virtualHosts.${domain} = { + nginx.virtualHosts.${domains.personalWebsite} = { enableACME = true; forceSSL = true; - root = "/srv/www/${domain}"; + root = "/srv/www/${domains.personalWebsite}"; }; }; |