use env file for module
This commit is contained in:
parent
3d09ad6696
commit
7c1578e99a
1 changed files with 11 additions and 9 deletions
|
@ -19,21 +19,23 @@ in {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
inherit (self.packages.${system}) default;
|
inherit (self.packages.${system}) default;
|
||||||
};
|
};
|
||||||
twitch_id = mkOption {
|
|
||||||
type = types.str;
|
environmentFiles = mkOption {
|
||||||
};
|
type = types.listOf types.path;
|
||||||
twitch_oauth = mkOption {
|
default = [];
|
||||||
type = types.str;
|
example = ["/run/twitch_auth"];
|
||||||
|
description = ''
|
||||||
|
set twitch oauth / id
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
systemd.services.botoh = {
|
systemd.services.botoh = {
|
||||||
wantedBy = ["multi-user.target"];
|
wantedBy = ["multi-user.target"];
|
||||||
serviceConfig.ExecStart = "${cfg.package}/bin/botoh";
|
serviceConfig = {
|
||||||
environment = {
|
EnvironmentFile = cfg.environmentFiles;
|
||||||
TWITCH_ID = cfg.twitch_id;
|
ExecStart = "${cfg.package}/bin/botoh";
|
||||||
TWITCH_OAUTH = cfg.twitch_oauth;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue