botoh/nix/module.nix

31 lines
608 B
Nix
Raw Normal View History

2024-05-14 22:31:32 -04:00
{self}: {
pkgs,
config,
lib,
...
}: let
inherit (lib) types;
inherit (lib.modules) mkIf;
inherit (lib.options) mkOption mkEnableOption;
inherit (pkgs.stdenv.hostPlatform) system;
2024-05-14 22:45:49 -04:00
cfg = config.services.botoh;
2024-05-14 22:31:32 -04:00
in {
options.services.botoh = {
enable = mkEnableOption ''
Enable botoh
'';
package = mkOption {
type = types.package;
inherit (self.packages.${system}) default;
};
};
config = mkIf cfg.enable {
2024-05-14 22:45:49 -04:00
systemd.services.botoh = {
2024-05-14 22:31:32 -04:00
wantedBy = ["multi-user.target"];
serviceConfig.ExecStart = "${cfg.package}/bin/botoh";
};
};
}