dotfiles/nixos/cache-server.nix

35 lines
714 B
Nix
Raw Normal View History

{ config, lib, ... }:
2023-08-27 19:03:24 -06:00
with lib;
2024-09-26 14:15:27 -06:00
let cfg = config.myModules.cache-server;
2023-08-27 19:03:24 -06:00
in
{
options = {
2024-09-26 14:15:27 -06:00
myModules.cache-server = {
2023-08-27 19:03:24 -06:00
enable = mkEnableOption "nix cache server";
port = mkOption {
type = types.int;
default = 5050;
2023-08-27 19:03:24 -06:00
};
host-string = mkOption {
type = types.string;
default = "0.0.0.0";
};
path = mkOption {
type = types.string;
default = "/";
};
};
2023-08-22 17:11:37 -06:00
};
2023-08-27 19:03:24 -06:00
config = mkIf cfg.enable {
age.secrets."cache-priv-key.pem".file = ./secrets/cache-priv-key.pem.age;
services.nix-serve = {
enable = true;
secretKeyFile = config.age.secrets."cache-priv-key.pem".path;
port = cfg.port;
2023-08-22 17:11:37 -06:00
};
};
}
2023-08-27 19:03:24 -06:00