NixOS home-manager ssh config permissions

Having a weird issue with ssh config using the hyper terminal

Using home-manager I set up matchBlocks

home-manager.users.me = { pkgs, ... }: {
  programs.ssh.enable = true;
  programs.ssh.matchBlocks = {
    fooServer = {
    port = 1022;
    hostname =  "example.com";
    user = "me";
  };
};

The hyper terminal-emulator is working fine but I’m getting this error when using ssh

Bad owner or permissions on /home/me/.ssh/config

I think the permissions on .ssh/config should be 600:

drwx------  2 me users 4096 Aug 22 11:58 .
drwx------ 23 me users 4096 Aug 22 11:58 ..
lrwxrwxrwx  1 me users   74 Aug 22 11:58 config -> /nix/store/jn8hzb72d0bjh4894k7h1ys819z96qpl-home-manager-files/.ssh/config
-rw-------  1 me users 3243 Jul 18 13:59 id_rsa
-rw-r--r--  1 me users  749 Jul 18 13:59 id_rsa.pub
-rw-------  1 me users 2234 Aug 13 20:35 known_hosts

But this file is automatically generated. Is there a way to change it with home-manager?

I also find it strange that if I use gnome-shell or vscode terminal ssh with config works fine. They all agree on these:

[me@computer:~]$ echo $USER
me

[me@computer:~]$ echo $SHELL
/run/current-system/sw/bin/bash

[me@computer:~]$ which ssh
/run/current-system/sw/bin/ssh

ssh will work in hyper if I disable config:

ssh me@example.com -F none

Should also note that I made my own hyper package because the nix package was broken. Using the AppImage instead of the .deb:

{ lib, fetchurl, appimageTools, pkgs }:

let
  pname = "hyper";
  version = "3.4.1";
  name = "${pname}-${version}";

  src = fetchurl {
    url = "https://github.com/vercel/hyper/releases/download/v3.4.1/Hyper-3.4.1.AppImage";
    name = "${pname}-${version}.AppImage";
    sha512 = "d50c08943063beb9b506a5f70c2946cea38c004eda77e40e54e0451d2883c50b9c31b53977cded8befb8b9a52726eeb40c9990331c16b6af0af37b52009bb22c";
  };

  appimageContents = appimageTools.extractType2 {
    inherit name src;
  };
in
appimageTools.wrapType2 {
  inherit name src;

  multiPkgs = null; # no 32bit needed
  extraPkgs = pkgs: appimageTools.defaultFhsEnvArgs.multiPkgs pkgs ++ [ pkgs.bash ];

  extraInstallCommands = ''
    mv $out/bin/{${name},${pname}}
    install -m 444 -D ${appimageContents}/${pname}.desktop $out/share/applications/${pname}.desktop
    install -m 444 -D ${appimageContents}/${pname}.png \
      $out/share/icons/hicolor/512x512/apps/${pname}.png
    substituteInPlace $out/share/applications/${pname}.desktop \
      --replace 'Exec=AppRun' 'Exec=${pname}'
  '';

  meta = with lib; {
    description = "An Electron-based terminal";
    homepage = "https://hyper.is";
    license = licenses.mit;
    platforms = [ "x86_64-linux" ];
  };
}

I posted this on stack overflow too if you want the points:

I opened this issue back in 2018 Bad owner or permissions on ~/.ssh/config ssh error · Issue #322 · nix-community/home-manager · GitHub.

ah, this explains everything TY

are you doing this to solve?
https://github.com/nix-community/home-manager/issues/322#issuecomment-1178614454

At this point I just removed this from home-manager.