Fix module

This commit is contained in:
Malte Tammena 2021-12-09 18:03:57 +01:00
parent b933d995c4
commit 461d66a3d9

View file

@ -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";