2024-04-08 11:11:05 -04:00
|
|
|
{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.forcebot_rs;
|
|
|
|
in {
|
|
|
|
options.services.forcebot_rs = {
|
|
|
|
enable = mkEnableOption ''
|
|
|
|
Enable forcebot
|
|
|
|
'';
|
|
|
|
|
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
2024-04-08 18:45:30 -04:00
|
|
|
inherit (self.packages.${system}) default;
|
2024-04-08 11:11:05 -04:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
systemd.services.forcebot_rs = {
|
|
|
|
wantedBy = ["multi-user.target"];
|
|
|
|
serviceConfig.ExecStart = "${cfg.package}/bin/forcebot_rs";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|