botoh/nix/module.nix
2024-05-14 22:45:49 -04:00

31 lines
608 B
Nix

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