diff --git a/glados-module.nix b/glados-module.nix index 0e7f2c5..4a0d54b 100644 --- a/glados-module.nix +++ b/glados-module.nix @@ -3,10 +3,16 @@ let cfg = config.services.glados; ownerArgs = list: toString (map (id: "--owner ${id}") list); + enableDataCollector = + if cfg.dataCollector.enable then "--enable-data-collector" else ""; + in { options.services.glados = { enable = lib.mkEnableOption "GLaDOS systemd service"; + dataCollector.enable = + lib.mkEnableOption "Enable Minecraft -> InfluxDB data collector"; + envFile = lib.mkOption { type = lib.types.str; description = "Path to the environment configuration"; @@ -20,7 +26,8 @@ in { requires = [ "network-online.target" ]; after = [ "network-online.target" ]; serviceConfig = { - ExecStart = "${pkgs.glados}/bin/glados --db $STATE_DIRECTORY/state.yml"; + ExecStart = + "${pkgs.glados}/bin/glados --state $STATE_DIRECTORY/state.yml ${enableDataCollector}"; EnvironmentFile = "${cfg.envFile}"; Environment = "RUST_LOG=warn"; StateDirectory = "glados";