Commit ade17b91be5f

Vincent Demeester <vincent@sbr.pm>
2019-07-05 17:31:05
profiles.ssh: add a "extra" machines options
This allows to add extra `Host` in the generated ssh config. Also adds a `~/.config/ssh/.placeholder` file to make sure the folder exists. Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent c671360
Changed files (2)
machines
modules
profiles
machines/naruhodo.nix
@@ -1,6 +1,6 @@
 { pkgs, ... }:
 
-{
+with import ../assets/machines.nix;{
   imports = [
     ./base.fedora.nix
   ];
@@ -15,6 +15,7 @@
   profiles.zsh = {
     enable = true;
   };
+  profiles.ssh.machines = sshConfig;
   profiles.dev = {
     enable = true;
   };
modules/profiles/ssh.nix
@@ -12,10 +12,15 @@ in
         description = "Enable ssh profile and configuration";
         type = types.bool;
       };
+      machines = mkOption {
+        default = {};
+        type = types.attrs;
+      };
     };
   };
   config = mkIf cfg.enable {
     home.file.".ssh/sockets/.placeholder".text = '''';
+    xdg.configFile.".ssh/.placeholder".text = '''';
     programs.ssh = {
       enable = true;
 
@@ -40,16 +45,10 @@ in
             controlPersist = "360";
           };
         };
-        "*.local" = {
-          extraOptions = {
-            controlMaster = "auto";
-            controlPersist = "360";
-          };
-        };
         "*.redhat.com" = {
           user = "vdemeest";
         };
-      };
+      } //cfg.machines;
     };
   };
 }