ssh-cert-dist/modules/options.nix
shimun 9d405a6324
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
feat(home-manager): create timer unit
2023-07-10 08:58:51 +02:00

53 lines
1.2 KiB
Nix

{ config, lib, pkgs, ... }: with lib; let
directoryModule = { name, ... }: {
options = {
name = mkOption {
type = types.str;
default = last (splitString "/" name);
};
fetch = mkOption {
type = types.bool;
default = true;
};
upload = mkOption {
type = types.bool;
default = false;
};
interval = mkOption {
type = types.str;
default = "daily";
description = "https://www.freedesktop.org/software/systemd/man/systemd.time.html";
};
};
};
endpointOption = mkOption {
type = with types; nullOr str;
description = "API endpoint url";
default = "https://pki.shimun.net";
};
packageOption = mkOption {
type = types.package;
default = pkgs.ssh-cert-dist-client;
};
in
{
options = {
services.ssh-cert-dist = {
enable = mkEnableOption "ssh-cert-dist";
endpoint = endpointOption;
package = packageOption;
directories = mkOption {
type = with types; attrsOf (submodule directoryModule);
default = { };
};
};
programs.ssh-cert-dist = {
enable = mkEnableOption "ssh-cert-dist client";
package = packageOption;
endpoint = endpointOption;
};
};
}