37 lines
834 B
Nix
37 lines
834 B
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
namespace,
|
|
...
|
|
}:
|
|
let
|
|
name = "cockpit";
|
|
cfg = config.${namespace}.services.${name};
|
|
net = lib.${namespace}.network;
|
|
|
|
cockpitConfig = lib.${namespace}.mkModule {
|
|
inherit config name;
|
|
description = "Cockpit web-based server management UI";
|
|
moduleConfig = {
|
|
services.cockpit = {
|
|
inherit (cfg) port openFirewall;
|
|
enable = true;
|
|
allowed-origins = [
|
|
"https://${net.hosts.nas.lan}:${toString cfg.port}"
|
|
"https://${net.hosts.nas.hostname}:${toString cfg.port}"
|
|
"https://${net.hosts.nas.hostname}.local:${toString cfg.port}"
|
|
];
|
|
plugins = with pkgs.${namespace}; [
|
|
# cockpit-benchmark
|
|
cockpit-podman
|
|
cockpit-machines
|
|
];
|
|
};
|
|
};
|
|
};
|
|
in
|
|
{
|
|
imports = [ cockpitConfig ];
|
|
}
|