From 4a13da8f36fa321fa8d98868eccd4345b4d4d2a2 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Wed, 18 Dec 2024 13:58:30 +0300 Subject: [PATCH] Ssh: Replace with a plain file. --- .treefmt.toml | 11 ++++---- home/file/default.nix | 3 +- home/file/ssh/config | 59 +++++++++++++++++++++++++++++++++++++++ home/file/ssh/default.nix | 29 ------------------- 4 files changed, 66 insertions(+), 36 deletions(-) create mode 100644 home/file/ssh/config delete mode 100644 home/file/ssh/default.nix diff --git a/.treefmt.toml b/.treefmt.toml index 49dabddf..5132d7fb 100644 --- a/.treefmt.toml +++ b/.treefmt.toml @@ -3,13 +3,14 @@ walk = "git" excludes = [ - "*.key", - "*.patch", - "*.ogg", - "*.lock", "*.conf", + "*.key", + "*.lock", + "*.ogg", + "*.patch", "License", - "home/file/jetbrains/ideavimrc" + "home/file/jetbrains/ideavimrc", + "home/file/ssh/config", ] [formatter.nixfmt-rfc-style] diff --git a/home/file/default.nix b/home/file/default.nix index 13ac6187..fd7817bb 100644 --- a/home/file/default.nix +++ b/home/file/default.nix @@ -15,7 +15,6 @@ let mako = import ./mako args; mangohud = import ./mangohud args; nvim = import ./nvim args; - ssh = import ./ssh args; swappy = import ./swappy args; sway = import ./sway args; tmux = import ./tmux args; @@ -50,7 +49,7 @@ in ".nix".source = self; ".nixpkgs".source = inputs.nixpkgs; ".parallel/will-cite".text = ""; - ".ssh/config".text = ssh.text; + ".ssh/config".source = ./ssh/config; ".template".source = ./template; # ".nixpkgs_master".source = inputs.nixpkgs; # ".nixpkgs_unstable".source = inputs.nixpkgs; diff --git a/home/file/ssh/config b/home/file/ssh/config new file mode 100644 index 00000000..82b9a0fc --- /dev/null +++ b/home/file/ssh/config @@ -0,0 +1,59 @@ +Host * + ControlMaster auto + ControlPath ~/.ssh/%C.socket + ControlPersist yes + +Host dasha + HostName 10.0.0.7 + User root + Port 22143 + +Host desktop + HostName 10.0.0.3 + User root + Port 22143 + +Host fmpmaven + HostName 10.30.22.10 + User root + Port 22 + +Host home + HostName 10.0.0.1 + User root + Port 22143 + +Host laptop + HostName 192.168.1.9 + User root + Port 22143 + +Host max + HostName 10.0.0.13 + User root + Port 22143 + +Host nixbuilder + HostName 10.0.0.1 + User nixbuilder + Port 22143 + +Host pi + HostName 192.168.1.6 + User root + Port 22143 + +Host pocket + HostName 192.168.1.11 + User root + Port 22143 + +Host vpn + HostName 194.113.233.38 + User root + Port 22143 + +Host work + HostName 192.168.1.5 + User root + Port 22143 diff --git a/home/file/ssh/default.nix b/home/file/ssh/default.nix deleted file mode 100644 index 368e3b1b..00000000 --- a/home/file/ssh/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ ... }: -let - mkHost = name: address: port: user: '' - Host ${name} - HostName ${address} - User ${user} - Port ${toString port} - ''; -in -{ - text = - '' - Host * - ControlMaster auto - ControlPath ~/.ssh/%C.socket - ControlPersist yes - '' - + mkHost "dasha" "10.0.0.7" 22143 "root" - + mkHost "desktop" "10.0.0.3" 22143 "root" - + mkHost "fmpmaven" "10.30.22.10" 22 "root" - + mkHost "home" "10.0.0.1" 22143 "root" - + mkHost "laptop" "192.168.1.9" 22143 "root" - + mkHost "max" "10.0.0.13" 22143 "root" - + mkHost "nixbuilder" "10.0.0.1" 22143 "nixbuilder" - + mkHost "pi" "192.168.1.6" 22143 "root" - + mkHost "pocket" "192.168.1.11" 22143 "root" - + mkHost "vpn" "194.113.233.38" 22143 "root" - + mkHost "work" "192.168.1.5" 22143 "root"; -}