summary refs log tree commit diff
path: root/nixos/modules/programs
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-08-27 15:29:05 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-08-27 15:32:46 +0200
commit7c6ff6c1da65684137d9c3554540720f2f28e6cd (patch)
tree08b8ba29267964e8cf31cecec0f311244ff340d3 /nixos/modules/programs
parent287c08d8a319fc454e3d1ce90510f7a53e9d4e5d (diff)
downloadnixpkgs-7c6ff6c1da65684137d9c3554540720f2f28e6cd.tar
nixpkgs-7c6ff6c1da65684137d9c3554540720f2f28e6cd.tar.gz
nixpkgs-7c6ff6c1da65684137d9c3554540720f2f28e6cd.tar.bz2
nixpkgs-7c6ff6c1da65684137d9c3554540720f2f28e6cd.tar.lz
nixpkgs-7c6ff6c1da65684137d9c3554540720f2f28e6cd.tar.xz
nixpkgs-7c6ff6c1da65684137d9c3554540720f2f28e6cd.tar.zst
nixpkgs-7c6ff6c1da65684137d9c3554540720f2f28e6cd.zip
programs.ssh.knownHosts: Use submodule
Diffstat (limited to 'nixos/modules/programs')
-rw-r--r--nixos/modules/programs/ssh.nix69
1 files changed, 35 insertions, 34 deletions
diff --git a/nixos/modules/programs/ssh.nix b/nixos/modules/programs/ssh.nix
index e9ad47adec9..87a00497621 100644
--- a/nixos/modules/programs/ssh.nix
+++ b/nixos/modules/programs/ssh.nix
@@ -102,7 +102,41 @@ in
 
       knownHosts = mkOption {
         default = {};
-        type = types.loaOf types.optionSet;
+        type = types.loaOf (types.submodule {
+          options = {
+            hostNames = mkOption {
+              type = types.listOf types.str;
+              default = [];
+              description = ''
+                A list of host names and/or IP numbers used for accessing
+                the host's ssh service.
+              '';
+            };
+            publicKey = mkOption {
+              default = null;
+              type = types.nullOr types.str;
+              example = "ecdsa-sha2-nistp521 AAAAE2VjZHN...UEPg==";
+              description = ''
+                The public key data for the host. You can fetch a public key
+                from a running SSH server with the <command>ssh-keyscan</command>
+                command. The public key should not include any host names, only
+                the key type and the key itself.
+              '';
+            };
+            publicKeyFile = mkOption {
+              default = null;
+              type = types.nullOr types.path;
+              description = ''
+                The path to the public key file for the host. The public
+                key file is read at build time and saved in the Nix store.
+                You can fetch a public key file from a running SSH server
+                with the <command>ssh-keyscan</command> command. The content
+                of the file should follow the same format as described for
+                the <literal>publicKey</literal> option.
+              '';
+            };
+          };
+        });
         description = ''
           The set of system-wide known SSH hosts.
         '';
@@ -116,39 +150,6 @@ in
             publicKeyFile = literalExample "./pubkeys/myhost2_ssh_host_dsa_key.pub";
           }
         ];
-        options = {
-          hostNames = mkOption {
-            type = types.listOf types.str;
-            default = [];
-            description = ''
-              A list of host names and/or IP numbers used for accessing
-              the host's ssh service.
-            '';
-          };
-          publicKey = mkOption {
-            default = null;
-            type = types.nullOr types.str;
-            example = "ecdsa-sha2-nistp521 AAAAE2VjZHN...UEPg==";
-            description = ''
-              The public key data for the host. You can fetch a public key
-              from a running SSH server with the <command>ssh-keyscan</command>
-              command. The public key should not include any host names, only
-              the key type and the key itself.
-            '';
-          };
-          publicKeyFile = mkOption {
-            default = null;
-            type = types.nullOr types.path;
-            description = ''
-              The path to the public key file for the host. The public
-              key file is read at build time and saved in the Nix store.
-              You can fetch a public key file from a running SSH server
-              with the <command>ssh-keyscan</command> command. The content
-              of the file should follow the same format as described for
-              the <literal>publicKey</literal> option.
-            '';
-          };
-        };
       };
 
     };