Files
nix-config/modules/nixos/services/cockpit/default.nix
2026-04-05 19:10:23 -05:00

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 ];
}