Working Config With Libs!

This commit is contained in:
2023-03-01 19:14:31 +00:00
parent 10b1faa250
commit 41d73d457e
20 changed files with 88 additions and 198 deletions

View File

@@ -1,13 +1,17 @@
{ lib, config, pkgs, ... }: {
{ lib, pkgs, config, ... }:
with lib;
let cfg = config.custom.sshd;
in {
#define option to enable this
options.mymods.sshd.enable = lib.mkEnableOption "Enable SSH";
options.custom.sshd.enable = mkEnableOption "Enable SSH";
config = lib.mkIf config.mymods.sshd.enable {
config = mkIf cfg.enable {
services.openssh = {
enable = true;
settings.permitRootLogin = "no";
settings.passwordAuthentication = false;
permitRootLogin = "no";
passwordAuthentication = false;
};
networking.firewall.allowedTCPPorts = [ 22 ];