diff --git a/nix/module.nix b/nix/module.nix index 4fe0612..4fa7646 100644 --- a/nix/module.nix +++ b/nix/module.nix @@ -19,21 +19,23 @@ in { type = types.package; inherit (self.packages.${system}) default; }; - twitch_id = mkOption { - type = types.str; - }; - twitch_oauth = mkOption { - type = types.str; + + environmentFiles = mkOption { + type = types.listOf types.path; + default = []; + example = ["/run/twitch_auth"]; + description = '' + set twitch oauth / id + ''; }; }; config = mkIf cfg.enable { systemd.services.botoh = { wantedBy = ["multi-user.target"]; - serviceConfig.ExecStart = "${cfg.package}/bin/botoh"; - environment = { - TWITCH_ID = cfg.twitch_id; - TWITCH_OAUTH = cfg.twitch_oauth; + serviceConfig = { + EnvironmentFile = cfg.environmentFiles; + ExecStart = "${cfg.package}/bin/botoh"; }; }; };