diff --git a/hosts/server/configuration.nix b/hosts/server/configuration.nix index 26e54ca..1c3dcc8 100644 --- a/hosts/server/configuration.nix +++ b/hosts/server/configuration.nix @@ -21,6 +21,7 @@ service = { selfhost = { + htop = true; monitor = true; nextcloud = true; }; diff --git a/services/self_host.nix b/services/self_host.nix index 062e206..887793b 100644 --- a/services/self_host.nix +++ b/services/self_host.nix @@ -1,6 +1,9 @@ { inputs, config, pkgs, lib, ... }: let + htop = import ./self_host/htop.nix { + inherit inputs config pkgs lib; + }; monitor = import ./self_host/monitor.nix { inherit inputs config pkgs lib; }; @@ -12,6 +15,7 @@ in { imports = [ nextcloud + htop monitor ]; @@ -21,6 +25,11 @@ in }; }; options.service.selfhost = { + htop = lib.mkOption { + type = lib.types.bool; + default = false; + description = "Enable the htop"; + }; monitor = lib.mkOption { type = lib.types.bool; default = false; diff --git a/services/self_host/htop.nix b/services/self_host/htop.nix new file mode 100644 index 0000000..311370f --- /dev/null +++ b/services/self_host/htop.nix @@ -0,0 +1,19 @@ +{ config, pkgs, lib, ... }: + +let + cfg = config.service.selfhost.monitor; +in +{ + services = { + glances.enable = true; + + nginx.virtualHosts."htop.enium.eu" = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://127.0.0.1:61208"; + proxyWebsockets = true; + }; + }; + }; +}