forcebot_rs/nix/module.nix
notohh 087e76388d
nix: init rewrite
first pass of my nix rewrite

nix: rename module

nix: update module

nix: update module

nix: update module

nix: refactor

nix: remove package option

nix: fix serviceConfig

nix: add package back to module

nix: update module

nix: update module

nix: update module

nix: update module

remove default.nix
2024-04-08 17:46:08 -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;
default = self.packages.${system}.default;
};
};
config = mkIf cfg.enable {
systemd.services.forcebot_rs = {
wantedBy = ["multi-user.target"];
serviceConfig.ExecStart = "${cfg.package}/bin/forcebot_rs";
};
};
}