diff options
author | Azat Bahawi <azat@bahawi.net> | 2024-04-21 02:15:42 +0300 |
---|---|---|
committer | Azat Bahawi <azat@bahawi.net> | 2024-04-21 02:15:42 +0300 |
commit | e6ed60548397627bf10f561f9438201dbba0a36e (patch) | |
tree | f9a84c5957d2cc4fcd148065ee9365a0c851ae1c /modules/common/openssh.nix | |
parent | 2024-04-18 (diff) |
2024-04-21
Diffstat (limited to '')
-rw-r--r-- | modules/common/openssh.nix | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/modules/common/openssh.nix b/modules/common/openssh.nix deleted file mode 100644 index f60a1ef..0000000 --- a/modules/common/openssh.nix +++ /dev/null @@ -1,72 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -with lib; -let - cfg = config.nixfiles.modules.openssh; -in -{ - options.nixfiles.modules.openssh.client.enable = mkEnableOption "OpenSSH client"; - - config = mkIf cfg.client.enable { - hm = { - home.packages = with pkgs; [ - mosh - sshfs - sshpass - ]; - - programs.ssh = { - enable = true; - - hashKnownHosts = true; - - controlMaster = "auto"; - controlPersist = "24H"; - - serverAliveCountMax = 30; - serverAliveInterval = 60; - - matchBlocks = - let - mkBlock = - name: - { - hostname ? name, - port ? 22022, # NOTE This is not the default OpenSSH port. - user ? my.username, - identityFile ? "${config.my.home}/.ssh/${my.username}_${my.ssh.type}", - extraAttrs ? { }, - }: - nameValuePair name ( - { - inherit - hostname - port - user - identityFile - ; - } - // extraAttrs - ); - - internalServers = mapAttrs' mkBlock ( - mapAttrs (name: _: { hostname = "${name}.${my.domain.shire}"; }) ( - filterAttrs (_: attr: hasAttr "wireguard" attr && attr.isHeadless) my.configurations - ) - ); - in - internalServers - // (mapAttrs' mkBlock { - gitolite = { - user = "git"; - hostname = "git.${my.domain.shire}"; - }; - }); - }; - }; - }; -} |