Generators Reference
age
Generate an age private key.
Inputs:
pq- Whether to generate a post-quantum key (falseby default).
Type:
age :: { pq :: Bool; } -> Derivation
Examples:
generator = "age";
generator.age = {
pq = true;
};
dkim
Generate a DKIM private key.
Short-hand for generator.ssh-rsa with format set to "PKCS8".
Inputs:
pq- Number of bits for the RSA key (2048by default).
Type:
dkim :: { bits :: (Int | Null); } -> AttrSet
Examples:
generator = "dkim";
generator.dkim = {
bits = 4096;
};
ssh
Generate an SSH private key.
Inputs:
type- SSH key type ("ed25519"by default).bits- Number of bits for the key (nullby default).comment- Comment to add to the public key (nullby default).format- Private key format (nullby default).
Type:
ssh :: { type :: String; bits :: (Int | Null); comment :: (String | Null); format :: (String | Null); } -> Derivation
Examples:
generator = "ssh";
generator.ssh = {
type = "rsa";
bits = 4096;
comment = "user@host";
format = "PEM";
};
ssh-ed25519
Generate an Ed25519 SSH private key.
Short-hand for generator.ssh with type set to "ed25519".
Inputs:
comment- Comment to add to the public key (nullby default).format- Private key format (nullby default).
Type:
ssh-ed25519 :: { comment :: (String | Null); format :: (String | Null); } -> AttrSet
Examples:
generator = "ssh-ed25519";
generator.ssh-ed25519 = {
comment = "user@host";
format = "PEM";
};
ssh-rsa
Generate an RSA SSH private key.
Short-hand for generator.ssh with type set to "rsa".
Inputs:
bits- Number of bits for the key (nullby default).comment- Comment to add to the public key (nullby default).format- Private key format (nullby default).
Type:
ssh-rsa :: { bits :: (Int | Null); comment :: (String | Null); format :: (String | Null); } -> AttrSet
Examples:
generator = "ssh-rsa";
generator.ssh-rsa = {
bits = 4096;
comment = "user@host";
format = "PEM";
};
uuid
Generate random UUIDs.
Inputs:
count- Number of UUIDs to generate (1by default).raw- Whether to remove hyphens from generated UUIDs (falseby default).
Type:
uuid :: { count :: Int; raw :: Bool; } -> Derivation
Examples:
generator = "uuid";
generator.uuid = {
count = 5;
raw = true;
};