Files
nix-config/modules/nixos/services/cockpit/default.nix
mjallen18 a88736cf6e net
2026-03-30 16:09:25 -05:00

38 lines
859 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 = {
enable = true;
port = cfg.port;
openFirewall = cfg.openFirewall;
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 ];
}