From 2a409f3f51df1ec3ee2e9b09a4775e07ed5ad36f Mon Sep 17 00:00:00 2001 From: batteredbunny Date: Wed, 15 Jan 2025 03:02:33 +0200 Subject: [PATCH] Move lastfm-status to its own file --- caddy/default.nix | 9 --------- configuration.nix | 6 +----- services/lastfm-status.nix | 21 +++++++++++++++++++++ 3 files changed, 22 insertions(+), 14 deletions(-) create mode 100644 services/lastfm-status.nix diff --git a/caddy/default.nix b/caddy/default.nix index e685c01..d6b6a34 100644 --- a/caddy/default.nix +++ b/caddy/default.nix @@ -79,15 +79,6 @@ in respond owo ''; - "lastfm.catnip.ee".extraConfig = '' - tls { - dns cloudflare {env.CLOUDFLARE_API_TOKEN} - resolvers 1.1.1.1 - } - - reverse_proxy :${toString config.services.lastfm-status.port} - ''; - "http://syncthing.internal".extraConfig = '' @local remote_ip private_ranges 100.64.0.0/10 reverse_proxy @local http://${config.services.syncthing.guiAddress} diff --git a/configuration.nix b/configuration.nix index 2fe31ae..2a09604 100644 --- a/configuration.nix +++ b/configuration.nix @@ -31,7 +31,7 @@ ./services/gonic.nix ./services/youtuee.nix ./services/confess.nix - inputs.lastfm-status.nixosModules.default + ./services/lastfm-status.nix inputs.common-modules.nixosModules.nixos-upgrade ]; @@ -246,10 +246,6 @@ guiAddress = "0.0.0.0:8384"; openDefaultPorts = true; }; - lastfm-status = { - enable = true; - port = 4014; - }; scrutiny = { enable = true; collector.enable = true; diff --git a/services/lastfm-status.nix b/services/lastfm-status.nix new file mode 100644 index 0000000..bbb37de --- /dev/null +++ b/services/lastfm-status.nix @@ -0,0 +1,21 @@ +{ config, inputs, ... }: { + imports = [ + inputs.lastfm-status.nixosModules.default + ]; + + services = { + lastfm-status = { + enable = true; + port = 4014; + }; + + caddy.virtualHosts."lastfm.catnip.ee".extraConfig = '' + tls { + dns cloudflare {env.CLOUDFLARE_API_TOKEN} + resolvers 1.1.1.1 + } + + reverse_proxy :${toString config.services.lastfm-status.port} + ''; + }; +}