bash: add alias ssh-unknown
[julm/julm-nix.git] / nixos / profiles / networking.nix
index e297fa9bc40796bc3ee7b232da782de69505bde5..3e78b952296162a270b940a4b9c7a44859be40cc 100644 (file)
@@ -52,7 +52,6 @@ with lib;
       allowPing = mkDefault true;
     };
     networkmanager = {
-      enable = mkDefault config.services.xserver.enable;
       #dhcp = "dhcpcd";
       logLevel = mkDefault "INFO";
       wifi = {
@@ -69,7 +68,7 @@ with lib;
   programs.usbtop.enable = true;
 
   services.avahi = {
-    nssmdns = mkDefault true;
+    nssmdns4 = mkDefault true;
     openFirewall = mkDefault false;
     publish.enable = mkDefault false;
   };
@@ -90,7 +89,7 @@ with lib;
   services.openssh.enable = mkDefault true;
 
   # Fix https://github.com/NixOS/nixpkgs/issues/180175 by removing -s (aka. --wait-for-startup)
-  systemd.services.NetworkManager-wait-online = {
+  systemd.services.NetworkManager-wait-online = lib.mkIf config.networking.networkmanager.enable {
     unitConfig.StartLimitIntervalSec = 0;
     serviceConfig = {
       ExecStart = [ "" "${pkgs.networkmanager}/bin/nm-online -q" ];
@@ -117,4 +116,18 @@ with lib;
       esac
     '';
   };
+
+  # The notion of "online" is a broken concept
+  #systemd.services.NetworkManager-wait-online.enable = false;
+  #systemd.network.wait-online.enable = false;
+
+  # Do not take down the network for too long when upgrading,
+  # This also prevents failures of services that are restarted instead of stopped.
+  # It will use `systemctl restart` rather than stopping it with `systemctl stop`
+  # followed by a delayed `systemctl start`.
+  systemd.services.systemd-networkd.stopIfChanged = false;
+
+  # Services that are only restarted might be not able
+  # to resolve when resolved is stopped before.
+  systemd.services.systemd-resolved.stopIfChanged = false;
 }