fruitbasket/modules/nix-serve.nix

19 lines
442 B
Nix
Raw Normal View History

2024-04-12 11:21:52 +02:00
{ config, pkgs, ... }:
2024-02-25 23:10:43 +01:00
let
domain = "cache.${config.networking.domain}";
in
{
sops.secrets."nix-serve/key" = { };
services.nix-serve = {
enable = true;
2024-04-12 11:21:52 +02:00
package = pkgs.nix-serve-ng;
2024-02-25 23:10:43 +01:00
secretKeyFile = config.sops.secrets."nix-serve/key".path;
2024-02-25 23:16:47 +01:00
port = 5002;
2024-02-25 23:10:43 +01:00
};
services.nginx.virtualHosts."${domain}" = {
locations."/" = {
proxyPass = "http://127.0.0.1:${toString config.services.nix-serve.port}";
};
};
}