]> Git — Sourcephile - sourcephile-nix.git/blob - shell/modules/tools/networking/openssh.nix
mermet: knot: remove sourcehut
[sourcephile-nix.git] / shell / modules / tools / networking / openssh.nix
1 { pkgs, lib, config, ... }:
2 let
3 cfg = config.openssh;
4 inherit (lib) types;
5 in
6 {
7 options.openssh = {
8 enable = lib.mkEnableOption "OpenSSH shell utilities";
9 sshConf = lib.mkOption {
10 type = types.lines;
11 apply = s: pkgs.writeText "ssh_config" s;
12 default = ''
13 '';
14 description = ''
15 OpenSSH's ssh_config content.
16 '';
17 };
18 };
19 config = lib.mkIf cfg.enable {
20 nix-shell.buildInputs =
21 let
22 ssh = pkgs.writeShellScriptBin "ssh" ''
23 ${pkgs.openssh}/bin/ssh -F ${cfg.sshConf} "$@"
24 '';
25 in
26 [ ssh ];
27 };
28 }