Skip to content

Commit

Permalink
flake.nix: fix openssh settings for nixos 22.11
Browse files Browse the repository at this point in the history
  • Loading branch information
astro committed May 17, 2023
1 parent 5cec173 commit 1f69b26
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,16 @@
networking.firewall.allowedTCPPorts = lib.optional (hypervisor == "qemu") 22;
services.openssh = lib.optionalAttrs (hypervisor == "qemu") {
enable = true;
settings.PermitRootLogin = "yes";
};
} // (
if builtins.compareVersions lib.version "22.11" <= 0
then {
# NixOS<23.05 option
permitRootLogin = "yes";
} else {
# NixOS>=23.05 setting
settings.PermitRootLogin = "yes";
}
);
})
config
];
Expand Down

0 comments on commit 1f69b26

Please sign in to comment.