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 1f69b26 commit 59008a1
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
nixpkgs.lib.optionalAttrs (builtins.elem hypervisor self.lib.hypervisorsWithNetwork) {
"${system}-${hypervisor}-example-with-tap" = makeExample {
inherit system hypervisor;
config = {
config = { lib, ...}: {
microvm.interfaces = [ {
type = "tap";
id = "vm-${builtins.substring 0 4 hypervisor}";
Expand All @@ -211,8 +211,16 @@
networking.firewall.allowedTCPPorts = [ 22 ];
services.openssh = {
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";
}
);
};
};
};
Expand Down

0 comments on commit 59008a1

Please sign in to comment.