mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
chore: nf-fmt-nix
This commit is contained in:
parent
37137017c2
commit
c8bc78fb88
4 changed files with 152 additions and 140 deletions
|
|
@ -47,7 +47,8 @@ in {
|
|||
protocol = "http";
|
||||
prometheus.exporter.enable = let
|
||||
sslPort = config.ports.asterisk-ssl;
|
||||
in mkAlmostOptionDefault (!sslPort.enable || !sslPort.prometheus.exporter.enable);
|
||||
in
|
||||
mkAlmostOptionDefault (!sslPort.enable || !sslPort.prometheus.exporter.enable);
|
||||
};
|
||||
asterisk-ssl = {
|
||||
port = mkAlmostOptionDefault 8089;
|
||||
|
|
|
|||
|
|
@ -155,12 +155,16 @@ let
|
|||
default = "/metrics";
|
||||
};
|
||||
ssl = {
|
||||
enable = mkEnableOption "HTTPS" // {
|
||||
default = any (port: port.ssl) (attrValues exporterPorts);
|
||||
};
|
||||
insecure = mkEnableOption "self-signed SSL" // {
|
||||
default = true;
|
||||
};
|
||||
enable =
|
||||
mkEnableOption "HTTPS"
|
||||
// {
|
||||
default = any (port: port.ssl) (attrValues exporterPorts);
|
||||
};
|
||||
insecure =
|
||||
mkEnableOption "self-signed SSL"
|
||||
// {
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -12,17 +12,21 @@ in {
|
|||
serviceAttr = "motion";
|
||||
assertions = let
|
||||
# in motion.conf, `0` represents the port being disabled
|
||||
configPort = port: if port.enable then port.port else 0;
|
||||
in mkIf config.enable [
|
||||
(nixosConfig: {
|
||||
assertion = configPort config.ports.default == nixosConfig.services.motion.settings.webcontrol_port or 0;
|
||||
message = "webcontrol port mismatch";
|
||||
})
|
||||
(nixosConfig: {
|
||||
assertion = configPort config.ports.stream == nixosConfig.services.motion.settings.stream_port or 0;
|
||||
message = "stream port mismatch";
|
||||
})
|
||||
];
|
||||
configPort = port:
|
||||
if port.enable
|
||||
then port.port
|
||||
else 0;
|
||||
in
|
||||
mkIf config.enable [
|
||||
(nixosConfig: {
|
||||
assertion = configPort config.ports.default == nixosConfig.services.motion.settings.webcontrol_port or 0;
|
||||
message = "webcontrol port mismatch";
|
||||
})
|
||||
(nixosConfig: {
|
||||
assertion = configPort config.ports.stream == nixosConfig.services.motion.settings.stream_port or 0;
|
||||
message = "stream port mismatch";
|
||||
})
|
||||
];
|
||||
};
|
||||
defaults.port.listen = mkAlmostOptionDefault "lan";
|
||||
ports = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue