krebs types += ssh-{priv,pub}key

This commit is contained in:
tv 2016-03-16 01:54:49 +01:00
parent e6657cd46a
commit 444d85ea86

View File

@ -47,7 +47,7 @@ types // rec {
}; };
ssh.pubkey = mkOption { ssh.pubkey = mkOption {
type = nullOr str; type = nullOr ssh-pubkey;
default = null; default = null;
apply = x: apply = x:
optionalTrace (x == null && config.owner.name == build.user.name) optionalTrace (x == null && config.owner.name == build.user.name)
@ -55,25 +55,7 @@ types // rec {
x; x;
}; };
ssh.privkey = mkOption { ssh.privkey = mkOption {
type = nullOr (submodule { type = nullOr ssh-privkey;
options = {
bits = mkOption {
type = nullOr (enum ["4096"]);
default = null;
};
path = mkOption {
type = either path str;
apply = x: {
path = toString x;
string = x;
}.${typeOf x};
};
type = mkOption {
type = enum ["rsa" "ed25519"];
default = "ed25519";
};
};
});
default = null; default = null;
}; };
}; };
@ -184,7 +166,7 @@ types // rec {
default = config._module.args.name; default = config._module.args.name;
}; };
pubkey = mkOption { pubkey = mkOption {
type = nullOr str; type = nullOr ssh-pubkey;
default = null; default = null;
}; };
uid = mkOption { uid = mkOption {
@ -198,6 +180,26 @@ types // rec {
addr = str; addr = str;
addr4 = str; addr4 = str;
addr6 = str; addr6 = str;
ssh-pubkey = str;
ssh-privkey = submodule {
options = {
bits = mkOption {
type = nullOr (enum ["4096"]);
default = null;
};
path = mkOption {
type = either path str;
apply = x: {
path = toString x;
string = x;
}.${typeOf x};
};
type = mkOption {
type = enum ["rsa" "ed25519"];
default = "ed25519";
};
};
};
krebs.file-location = types.submodule { krebs.file-location = types.submodule {
options = { options = {