2024-06-13 13:52:45 +07:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
|
|
cfg = config.profile.services.cockpit;
|
2024-06-13 14:04:10 +07:00
|
|
|
inherit (lib) mkIf;
|
2024-06-13 13:52:45 +07:00
|
|
|
in
|
|
|
|
{
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
environment.systemPackages = mkIf config.profile.podman.enable [
|
|
|
|
(pkgs.callPackage ../packages/cockpit-podman.nix { })
|
|
|
|
];
|
|
|
|
sops.secrets."cockpit" = {
|
|
|
|
sopsFile = ../../secrets/caddy_reverse_proxy.yaml;
|
|
|
|
path = "/etc/caddy/sites-enabled/cockpit";
|
2024-06-13 14:04:10 +07:00
|
|
|
mode = "0440";
|
2024-06-13 13:52:45 +07:00
|
|
|
};
|
|
|
|
services.cockpit = {
|
|
|
|
enable = true;
|
|
|
|
openFirewall = true;
|
|
|
|
settings = {
|
|
|
|
WebService = {
|
|
|
|
AllowUnencrypted = true;
|
|
|
|
ProtocolHeader = "X-Forwarded-Proto";
|
|
|
|
ForwardedForHeader = "X-Forwarded-For";
|
|
|
|
};
|
|
|
|
Session = {
|
|
|
|
IdleTimeout = 120; # 2 hours.
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|