homeserver: added cockpit ui

This commit is contained in:
Tigor Hutasuhut 2024-06-12 20:51:10 +07:00
parent 9cd3c1b5b0
commit f250903a47
5 changed files with 63 additions and 0 deletions

View file

@ -70,5 +70,7 @@
microsoft-edge.enable = lib.mkEnableOption "microsoft-edge"; microsoft-edge.enable = lib.mkEnableOption "microsoft-edge";
nextcloud.enable = lib.mkEnableOption "nextcloud"; nextcloud.enable = lib.mkEnableOption "nextcloud";
cockpit.enable = lib.mkEnableOption "cockpit";
}; };
} }

View file

@ -24,5 +24,6 @@
go.enable = true; go.enable = true;
networking.firewall.enable = true; networking.firewall.enable = true;
networking.firewall.allowedTCPPorts = [ 80 443 ]; networking.firewall.allowedTCPPorts = [ 80 443 ];
cockpit.enable = true;
}; };
} }

View file

@ -0,0 +1,25 @@
{ config, lib, pkgs, ... }:
let
cfg = config.profile.cockpit;
in
{
config = lib.mkIf cfg.enable {
environment.systemPackages = lib.mkIf config.profile.podman.enable [
(pkgs.callPackage ../packages/cockpit-podman.nix { })
];
services.cockpit = {
enable = true;
openFirewall = true;
settings = {
WebService = {
AllowUnencrypted = true;
ProtocolHeader = "X-Forwarded-Proto";
ForwardedForHeader = "X-Forwarded-For";
};
Session = {
IdleTimeout = 120; # 2 hours.
};
};
};
};
}

View file

@ -7,6 +7,7 @@
./bluetooth.nix ./bluetooth.nix
./boot_loader.nix ./boot_loader.nix
./brightnessctl.nix ./brightnessctl.nix
./cockpit.nix
./docker.nix ./docker.nix
./flatpak.nix ./flatpak.nix
./font.nix ./font.nix

View file

@ -0,0 +1,34 @@
{ lib, stdenv, fetchzip, gettext, ... }:
stdenv.mkDerivation rec {
pname = "cockpit-podman";
version = "89";
src = fetchzip {
url = "https://github.com/cockpit-project/${pname}/releases/download/${version}/${pname}-${version}.tar.xz";
sha256 = "sha256-qLt6x9W+M/DztzcFxyWZLHUTM1ZsPCOykO+6o/URa6c=";
};
nativeBuildInputs = [
gettext
];
makeFlags = [ "DESTDIR=$(out)" "PREFIX=" ];
postPatch = ''
substituteInPlace Makefile \
--replace /usr/share $out/share
touch pkg/lib/cockpit-po-plugin.js
touch dist/manifest.json
'';
dontBuild = true;
meta = with lib; {
description = "Cockpit UI for podman containers";
license = licenses.lgpl21;
homepage = "https://github.com/cockpit-project/cockpit-podman";
platforms = platforms.linux;
maintainers = [ ];
};
}