fruitbasket/modules/nix-serve.nix

19 lines
430 B
Nix
Raw Normal View History

2024-02-25 23:10:43 +01:00
{ config, ... }:
let
domain = "cache.${config.networking.domain}";
in
{
sops.secrets."nix-serve/key" = { };
services.nix-serve = {
enable = true;
secretKeyFile = config.sops.secrets."nix-serve/key".path;
};
services.nginx.virtualHosts."${domain}" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:${toString config.services.nix-serve.port}";
};
};
}