ssh: don't install a client by default (#4016)
Make use of the recently added nullable `mkPackageOption` feature to disable installing an SSH client by default: most people should use the client provided by their system.
This commit is contained in:
parent
6a19225683
commit
2d963854ae
|
@ -1028,9 +1028,9 @@ in
|
|||
time = "2023-05-13T14:34:21+00:00";
|
||||
condition = config.programs.ssh.enable;
|
||||
message = ''
|
||||
The module 'programs.ssh' now installs an SSH client. The installed
|
||||
The module 'programs.ssh' can now install an SSH client. The installed
|
||||
client is controlled by the 'programs.ssh.package` option, which
|
||||
defaults to 'pkgs.openssh'.
|
||||
defaults to 'null'.
|
||||
'';
|
||||
}
|
||||
{
|
||||
|
|
|
@ -361,7 +361,11 @@ in
|
|||
options.programs.ssh = {
|
||||
enable = mkEnableOption "SSH client configuration";
|
||||
|
||||
package = mkPackageOption pkgs "openssh" { };
|
||||
package = mkPackageOption pkgs "openssh" {
|
||||
nullable = true;
|
||||
default = null;
|
||||
extraDescription = "By default, the client provided by your system is used.";
|
||||
};
|
||||
|
||||
forwardAgent = mkOption {
|
||||
default = false;
|
||||
|
@ -527,7 +531,7 @@ in
|
|||
}
|
||||
];
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
home.packages = optional (cfg.package != null) cfg.package;
|
||||
|
||||
home.file.".ssh/config".text =
|
||||
let
|
||||
|
|
|
@ -6,8 +6,6 @@ with lib;
|
|||
config = {
|
||||
programs.ssh = { enable = true; };
|
||||
|
||||
test.stubs.openssh = { };
|
||||
|
||||
home.file.assertions.text = builtins.toJSON
|
||||
(map (a: a.message) (filter (a: !a.assertion) config.assertions));
|
||||
|
||||
|
|
|
@ -17,8 +17,6 @@ with lib;
|
|||
};
|
||||
};
|
||||
|
||||
test.stubs.openssh = { };
|
||||
|
||||
test.asserts.assertions.expected = [ "Forwarded paths cannot have ports." ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -27,8 +27,6 @@ with lib;
|
|||
home.file.result.text = builtins.toJSON
|
||||
(map (a: a.message) (filter (a: !a.assertion) config.assertions));
|
||||
|
||||
test.stubs.openssh = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.ssh/config
|
||||
assertFileContent \
|
||||
|
|
|
@ -21,8 +21,6 @@ with lib;
|
|||
};
|
||||
};
|
||||
|
||||
test.stubs.openssh = { };
|
||||
|
||||
test.asserts.assertions.expected = [ "Forwarded paths cannot have ports." ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -21,8 +21,6 @@ with lib;
|
|||
};
|
||||
};
|
||||
|
||||
test.stubs.openssh = { };
|
||||
|
||||
test.asserts.assertions.expected = [ "Forwarded paths cannot have ports." ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -21,8 +21,6 @@ with lib;
|
|||
};
|
||||
};
|
||||
|
||||
test.stubs.openssh = { };
|
||||
|
||||
test.asserts.assertions.expected = [ "Forwarded paths cannot have ports." ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -21,8 +21,6 @@ with lib;
|
|||
};
|
||||
};
|
||||
|
||||
test.stubs.openssh = { };
|
||||
|
||||
test.asserts.assertions.expected = [ "Forwarded paths cannot have ports." ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
includes = [ "config.d/*" "other/dir" ];
|
||||
};
|
||||
|
||||
test.stubs.openssh = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.ssh/config
|
||||
assertFileContains home-files/.ssh/config "Include config.d/* other/dir"
|
||||
|
|
|
@ -51,8 +51,6 @@ with lib;
|
|||
home.file.assertions.text = builtins.toJSON
|
||||
(map (a: a.message) (filter (a: !a.assertion) config.assertions));
|
||||
|
||||
test.stubs.openssh = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.ssh/config
|
||||
assertFileContent \
|
||||
|
|
|
@ -21,8 +21,6 @@ with lib;
|
|||
home.file.assertions.text = builtins.toJSON
|
||||
(map (a: a.message) (filter (a: !a.assertion) config.assertions));
|
||||
|
||||
test.stubs.openssh = { };
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.ssh/config
|
||||
assertFileContent \
|
||||
|
|
Loading…
Reference in a new issue