48 lines
1.1 KiB
Nix
48 lines
1.1 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;
|
|
};
|
|
};
|
|
};
|
|
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;
|
|
};
|
|
|
|
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;
|
|
};
|
|
};
|
|
|
|
}
|