about summary refs log tree commit diff stats
path: root/modules/by-name/ss/ssh/module.nix
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-05-28 14:22:52 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-05-28 14:22:52 +0200
commita45e5417b279f350af5dfea964ca61c5fe8d8a40 (patch)
tree7a1a30133b9f723f45588a07f1cf403a75f9d8c5 /modules/by-name/ss/ssh/module.nix
parenttreewide: Use unflake to de-duplicate flake inputs (diff)
downloadnixos-config-a45e5417b279f350af5dfea964ca61c5fe8d8a40.zip
modules/ssh: Use new RFC41 settings option
Diffstat (limited to '')
-rw-r--r--modules/by-name/ss/ssh/module.nix38
1 files changed, 21 insertions, 17 deletions
diff --git a/modules/by-name/ss/ssh/module.nix b/modules/by-name/ss/ssh/module.nix
index f7218e36..87c50728 100644
--- a/modules/by-name/ss/ssh/module.nix
+++ b/modules/by-name/ss/ssh/module.nix
@@ -15,16 +15,16 @@
 }: let
   cfg = config.soispha.programs.ssh;
 
-  mkDefaultMatchBlock = userKnownHostsFile: {
-    addKeysToAgent = "no";
-    compression = true;
-    controlMaster = "no";
-    controlPersist = "no";
-    forwardAgent = false;
-    hashKnownHosts = false;
-    serverAliveCountMax = 3;
-    serverAliveInterval = 240;
-    inherit userKnownHostsFile;
+  mkDefaultMatchBlock = UserKnownHostsFile: {
+    AddKeysToAgent = "no";
+    Compression = true;
+    ControlMaster = "no";
+    ControlPersist = "no";
+    ForwardAgent = false;
+    HashKnownHosts = false;
+    ServerAliveCountMax = 3;
+    ServerAliveInterval = 240;
+    inherit UserKnownHostsFile;
   };
 in {
   options.soispha.programs.ssh = {
@@ -48,19 +48,23 @@ in {
         enable = true;
         enableDefaultConfig = false;
 
-        matchBlocks."*" = mkDefaultMatchBlock (
-          builtins.toString (pkgs.writeTextFile {
-            name = "root-known-hosts";
-            text = cfg.rootKnownHosts;
-          })
-        );
+        settings = {
+          "Host *" = mkDefaultMatchBlock (
+            builtins.toString (pkgs.writeTextFile {
+              name = "root-known-hosts";
+              text = cfg.rootKnownHosts;
+            })
+          );
+        };
       };
 
       soispha.programs.ssh = {
         enable = true;
         enableDefaultConfig = false;
 
-        matchBlocks."*" = mkDefaultMatchBlock "${config.home-manager.users.soispha.xdg.dataHome}/ssh/known_hosts";
+        settings = {
+          "Host *" = mkDefaultMatchBlock "${config.home-manager.users.soispha.xdg.dataHome}/ssh/known_hosts";
+        };
       };
     };
   };