commit ade17b91be5f57d92e1064e230314661a1f9c57f
parent c671360aa7f122d4707c08e749767bd7a2599a50
Author: Vincent Demeester <vincent@sbr.pm>
Date: Fri, 5 Jul 2019 17:31:05 +0200
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>
Diffstat:
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/machines/naruhodo.nix b/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;
};
diff --git a/modules/profiles/ssh.nix b/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;
};
};
}