forcebot_rs/nix/module.nix
notohh 200d2a86d3
Some checks failed
ci/woodpecker/pr/cargo-checks Pipeline was successful
ci/woodpecker/cron/flake-update Pipeline failed
nix: add pre-commit-hooks
2024-04-08 18:45:30 -04:00

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