diff --git a/modules/default.nix b/modules/default.nix index 6a9d075..9a4cbb6 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -167,5 +167,15 @@ (lib.mkIf (!config.sbruder.full) { documentation.enable = lib.mkDefault false; }) + (lib.mkIf (config.services.resolved.enable) { + # With NixOS’s default database order for hosts, + # resolving the FQDN with hostname -f always returns “localhost” + # when resolved is enabled. + # This changes the priority of the files database, + # which fixes this. + # This workaround was taken from + # https://github.com/NixOS/nixpkgs/issues/132646#issuecomment-1782684381 + system.nssDatabases.hosts = lib.mkOrder 500 [ "files" ]; + }) ]; }