2021-04-10 17:20:35 +00:00
|
|
|
{ config, lib, depot, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (lib) mkEnableOption mkOption mkIf types;
|
|
|
|
cfg = config.services.rundeck;
|
|
|
|
in {
|
|
|
|
options.services.rundeck = {
|
|
|
|
enable = mkEnableOption "rundeck";
|
|
|
|
|
2021-04-10 22:17:28 +00:00
|
|
|
user = mkOption {
|
|
|
|
default = null;
|
|
|
|
type = types.nullOr types.str;
|
|
|
|
};
|
|
|
|
|
2021-04-10 17:20:35 +00:00
|
|
|
package = mkOption {
|
|
|
|
default = depot.pkgs.rundeck-bin;
|
|
|
|
defaultText = "depot.pkgs.rundeck-bin";
|
|
|
|
type = types.package;
|
|
|
|
};
|
2021-04-10 22:17:28 +00:00
|
|
|
|
|
|
|
pathPackages = mkOption {
|
|
|
|
default = [];
|
|
|
|
defaultText = "[]";
|
|
|
|
type = types.listOf types.package;
|
|
|
|
};
|
2021-04-10 17:20:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
systemd.services.rundeckd = {
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
after = [ "network.target" ];
|
2021-04-10 22:25:28 +00:00
|
|
|
path = cfg.pathPackages;
|
2021-04-10 17:20:35 +00:00
|
|
|
serviceConfig = {
|
2021-04-10 22:17:28 +00:00
|
|
|
User = cfg.user;
|
|
|
|
DynamicUser = cfg.user != cfg.user;
|
2021-04-10 17:20:35 +00:00
|
|
|
ExecStart = "${cfg.package}/bin/rundeckd -b /var/lib/rundeck";
|
|
|
|
StateDirectory = "rundeck";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|