Skip to content

Commit

Permalink
nixos/programs/ssh: allow specifying known host CAs
Browse files Browse the repository at this point in the history
  • Loading branch information
edef1c committed Jul 21, 2019
1 parent 104f8a0 commit 1c9a2d4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion nixos/modules/programs/ssh.nix
Expand Up @@ -21,7 +21,7 @@ let

knownHostsText = (flip (concatMapStringsSep "\n") knownHosts
(h: assert h.hostNames != [];
concatStringsSep "," h.hostNames + " "
optionalString h.certAuthority "@cert-authority " + concatStringsSep "," h.hostNames + " "
+ (if h.publicKey != null then h.publicKey else readFile h.publicKeyFile)
)) + "\n";

Expand Down Expand Up @@ -128,6 +128,14 @@ in
default = {};
type = types.loaOf (types.submodule ({ name, ... }: {
options = {
certAuthority = mkOption {
type = types.bool;
default = false;
description = ''
This public key is an SSH certificate authority, rather than an
individual host's key.
'';
};
hostNames = mkOption {
type = types.listOf types.str;
default = [];
Expand Down

0 comments on commit 1c9a2d4

Please sign in to comment.