chore: refactor user modules
This commit is contained in:
23
users/modules/security/ssh.nix
Normal file
23
users/modules/security/ssh.nix
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.home.security.ssh;
|
||||
in {
|
||||
options.home.security.ssh = {
|
||||
enable = mkEnableOption "enables SSH";
|
||||
hosts = mkOption {
|
||||
type = types.nullOr types.path;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
programs.ssh = mkIf cfg.enable {
|
||||
enable = true;
|
||||
includes = lists.optional (cfg.hosts != null) cfg.hosts;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user