41 lines
974 B
Nix
41 lines
974 B
Nix
{ config, lib, depot, ... }:
|
|
|
|
let
|
|
inherit (lib) mkEnableOption mkOption mkIf types;
|
|
cfg = config.services.rundeck;
|
|
in {
|
|
options.services.rundeck = {
|
|
enable = mkEnableOption "rundeck";
|
|
|
|
user = mkOption {
|
|
default = null;
|
|
type = types.nullOr types.str;
|
|
};
|
|
|
|
package = mkOption {
|
|
default = depot.pkgs.rundeck-bin;
|
|
defaultText = "depot.pkgs.rundeck-bin";
|
|
type = types.package;
|
|
};
|
|
|
|
pathPackages = mkOption {
|
|
default = [];
|
|
defaultText = "[]";
|
|
type = types.listOf types.package;
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
systemd.services.rundeckd = {
|
|
wantedBy = [ "multi-user.target" ];
|
|
after = [ "network.target" ];
|
|
serviceConfig = {
|
|
User = cfg.user;
|
|
DynamicUser = cfg.user != cfg.user;
|
|
Path = lib.makeBinPath cfg.pathPackages;
|
|
ExecStart = "${cfg.package}/bin/rundeckd -b /var/lib/rundeck";
|
|
StateDirectory = "rundeck";
|
|
};
|
|
};
|
|
};
|
|
}
|