fixup ssh: add autostart option

This commit is contained in:
Zhaofeng Li 2022-09-24 21:05:19 +00:00
parent f861f458e7
commit b416b58595

View file

@ -45,6 +45,16 @@ in {
type = types.bool; type = types.bool;
default = false; default = false;
}; };
autostart = lib.mkOption {
description = ''
Whether to automatically start the OpenSSH daemon.
If false, the server has to be manually started using
`supervisorctl`.
'';
type = types.bool;
default = true;
};
package = lib.mkOption { package = lib.mkOption {
description = '' description = ''
The package to use for OpenSSH. The package to use for OpenSSH.
@ -100,6 +110,7 @@ in {
}; };
supervisord.programs.sshd = { supervisord.programs.sshd = {
inherit (cfg) autostart;
path = [ cfg.package ]; path = [ cfg.package ];
autoRestart = true; autoRestart = true;
script = '' script = ''