mirror of
https://github.com/ryantm/agenix.git
synced 2024-11-22 09:40:47 +03:00
parent
c53ac31e44
commit
dfb2e7e591
1 changed files with 9 additions and 4 deletions
|
@ -14,7 +14,7 @@ let
|
||||||
|
|
||||||
users = config.users.users;
|
users = config.users.users;
|
||||||
|
|
||||||
identities = builtins.concatStringsSep " " (map (path: "-i ${path}") cfg.sshKeyPaths);
|
identities = builtins.concatStringsSep " " (map (path: "-i ${path}") cfg.identityPaths);
|
||||||
installSecret = secretType: ''
|
installSecret = secretType: ''
|
||||||
${if secretType.symlink then ''
|
${if secretType.symlink then ''
|
||||||
_truePath="${cfg.secretsMountPoint}/$_agenix_generation/${secretType.name}"
|
_truePath="${cfg.secretsMountPoint}/$_agenix_generation/${secretType.name}"
|
||||||
|
@ -95,6 +95,11 @@ let
|
||||||
});
|
});
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
(mkRenamedOptionModule [ "age" "sshKeyPaths" ] [ "age" "identityPaths" ])
|
||||||
|
];
|
||||||
|
|
||||||
options.age = {
|
options.age = {
|
||||||
ageBin = mkOption {
|
ageBin = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
|
@ -121,7 +126,7 @@ in
|
||||||
Where secrets are created before they are symlinked to /run/agenix
|
Where secrets are created before they are symlinked to /run/agenix
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
sshKeyPaths = mkOption {
|
identityPaths = mkOption {
|
||||||
type = types.listOf types.path;
|
type = types.listOf types.path;
|
||||||
default =
|
default =
|
||||||
if config.services.openssh.enable then
|
if config.services.openssh.enable then
|
||||||
|
@ -135,8 +140,8 @@ in
|
||||||
|
|
||||||
config = mkIf (cfg.secrets != { }) {
|
config = mkIf (cfg.secrets != { }) {
|
||||||
assertions = [{
|
assertions = [{
|
||||||
assertion = cfg.sshKeyPaths != [ ];
|
assertion = cfg.identityPaths != [ ];
|
||||||
message = "age.sshKeyPaths must be set.";
|
message = "age.identityPaths must be set.";
|
||||||
}];
|
}];
|
||||||
|
|
||||||
# Create a new directory full of secrets for symlinking (this helps
|
# Create a new directory full of secrets for symlinking (this helps
|
||||||
|
|
Loading…
Reference in a new issue