32 lines
735 B
Nix
32 lines
735 B
Nix
{
|
|
pkgs,
|
|
lib,
|
|
config,
|
|
...
|
|
}:
|
|
let
|
|
cfg = config.services.hive-c0re;
|
|
in
|
|
{
|
|
options.services.hive-c0re = {
|
|
enable = lib.mkEnableOption "hive-c0re — hyperhive coordinator daemon";
|
|
package = lib.mkOption {
|
|
type = lib.types.package;
|
|
default = pkgs.hyperhive;
|
|
defaultText = lib.literalExpression "pkgs.hyperhive";
|
|
description = "Package that provides /bin/hive-c0re.";
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
systemd.services.hive-c0re = {
|
|
description = "hyperhive coordinator daemon";
|
|
wantedBy = [ "multi-user.target" ];
|
|
serviceConfig = {
|
|
ExecStart = "${cfg.package}/bin/hive-c0re";
|
|
Restart = "on-failure";
|
|
RestartSec = 2;
|
|
};
|
|
};
|
|
};
|
|
}
|