summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Aristote <quentin@aristote.fr>2023-02-19 17:09:32 +0100
committerQuentin Aristote <quentin@aristote.fr>2023-02-19 17:09:32 +0100
commit7b29378f133ed49c341d996698bb1207edc950a4 (patch)
treeec03715b1bf42177d8becf5890a2733e0cba65a9
parent227900a95f3f3d263d6f98e722d9f6ff4ad43cec (diff)
openssh: handle NixOS 22.11 and 23.05 APIs
-rw-r--r--modules/nixos/personal/networking.nix14
1 files changed, 9 insertions, 5 deletions
diff --git a/modules/nixos/personal/networking.nix b/modules/nixos/personal/networking.nix
index 0c9c3a7..2385abd 100644
--- a/modules/nixos/personal/networking.nix
+++ b/modules/nixos/personal/networking.nix
@@ -1,4 +1,4 @@
-{ config, lib, pkgs, ... }:
+{ config, lib, pkgs, options, ... }:
let
cfg = config.personal.networking;
@@ -47,14 +47,18 @@ in {
services = lib.mkIf cfg.ssh.enable {
openssh = {
enable = true;
+ extraConfig = ''
+ AcceptEnv PS1
+ '';
+ } // (if options.services.openssh ? settings then {
settings = {
PermitRootLogin = "no";
PasswordAuthentication = false;
};
- extraConfig = ''
- AcceptEnv PS1
- '';
- };
+ } else {
+ permitRootLogin = "no";
+ passwordAuthentication = false;
+ });
fail2ban.enable = true;
};
hardware.bluetooth.enable = cfg.bluetooth.enable;