Generate accepted public key files through sops.
This commit is contained in:
parent
9878b40111
commit
8edba95021
2 changed files with 8 additions and 5 deletions
|
@ -27,10 +27,6 @@ let
|
||||||
++ (optional withPodman "podman");
|
++ (optional withPodman "podman");
|
||||||
shell = "${pkgs.zsh}/bin/zsh";
|
shell = "${pkgs.zsh}/bin/zsh";
|
||||||
passwordFile = passPath;
|
passwordFile = passPath;
|
||||||
# TODO: Fix for sops
|
|
||||||
# openssh.authorizedKeys.keyFiles = optional
|
|
||||||
# (cfg.openssh.enable && (builtins.pathExists "${passPath}.pub"))
|
|
||||||
# "${passPath}.pub";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, fn, ... }:
|
||||||
|
|
||||||
# For reference:
|
# For reference:
|
||||||
# https://infosec.mozilla.org/guidelines/openssh.html
|
# https://infosec.mozilla.org/guidelines/openssh.html
|
||||||
|
@ -25,4 +25,11 @@ mkIf (elem "openssh" config.machine.services) {
|
||||||
LogLevel VERBOSE
|
LogLevel VERBOSE
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
# Add public keys to /etc/ssh/authorized_keys.d
|
||||||
|
# This replaces users.users.*.openssh.authorizedKeys.*
|
||||||
|
sops.secrets = (fn.sopsHelper
|
||||||
|
(user: "users/${user.name}/publicKey")
|
||||||
|
config.machine.administrators
|
||||||
|
(user: { path = "/etc/ssh/authorized_keys.d/${user.name}"; mode = "444"; })
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue