nixos-config/hosts/nuc/modules/nix-serve/default.nix

19 lines
423 B
Nix
Raw Normal View History

2023-04-12 22:09:46 +02:00
{ config, ... }:
2023-04-12 10:06:32 +02:00
let
domain = "cache.rfive.de";
in
{
2023-04-12 22:09:46 +02:00
sops.secrets."nix-serve/secretkey" = { };
2023-04-12 10:06:32 +02:00
services.nix-serve = {
enable = true;
secretKeyFile = config.sops.secrets."nix-serve/secretkey".path;
};
services.nginx.virtualHosts."${domain}" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:${toString config.services.nix-serve.port}";
};
};
}