diff --git a/hosts/server/configuration.nix b/hosts/server/configuration.nix index 7285e4f..26e54ca 100644 --- a/hosts/server/configuration.nix +++ b/hosts/server/configuration.nix @@ -21,6 +21,7 @@ service = { selfhost = { + monitor = true; nextcloud = true; }; forty_two.irc = true; diff --git a/services/self_host.nix b/services/self_host.nix index fbb4315..062e206 100644 --- a/services/self_host.nix +++ b/services/self_host.nix @@ -1,6 +1,9 @@ { inputs, config, pkgs, lib, ... }: let + monitor = import ./self_host/monitor.nix { + inherit inputs config pkgs lib; + }; nextcloud = import ./self_host/nextcloud.nix { inherit inputs config pkgs lib; }; @@ -9,6 +12,7 @@ in { imports = [ nextcloud + monitor ]; config = { @@ -17,6 +21,11 @@ in }; }; options.service.selfhost = { + monitor = lib.mkOption { + type = lib.types.bool; + default = false; + description = "Enable the monitor"; + }; nextcloud = lib.mkOption { type = lib.types.bool; default = false; diff --git a/services/self_host/monitor.nix b/services/self_host/monitor.nix new file mode 100644 index 0000000..292a270 --- /dev/null +++ b/services/self_host/monitor.nix @@ -0,0 +1,19 @@ +{ config, pkgs, lib, ... }: + +let + cfg = config.service.selfhost.monitor; +in +{ + services = { + glances.enable = true; + + nginx.virtualHosts."monitor.enium.eu" = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://127.0.0.1:61208"; + proxyWebsockets = true; + }; + }; + }; +} diff --git a/services/self_host/nextcloud.nix b/services/self_host/nextcloud.nix index 13c8032..e875951 100644 --- a/services/self_host/nextcloud.nix +++ b/services/self_host/nextcloud.nix @@ -20,6 +20,12 @@ in adminuser = "OwnedByTheEniumTeam"; dbtype = "sqlite"; }; + settings = { + trusted_domains = [ + "192.168.1.254" + ]; + default_phone_region = "FR"; + }; }; nginx.virtualHosts."nextcloud.enium.eu".enableACME = true; nginx.virtualHosts."nextcloud.enium.eu".forceSSL = true;