nixosModules/clanCore: support nix-darwin

This commit is contained in:
Michael Hoang
2025-04-12 17:11:34 +02:00
parent 2bbf4b168a
commit a575894a83
13 changed files with 173 additions and 133 deletions

View File

@@ -1,4 +1,9 @@
{ config, lib, ... }:
{
_class,
config,
lib,
...
}:
{
options.clan.core = {
networking = {
@@ -96,23 +101,25 @@
]
)
];
config = lib.mkIf config.clan.core.enableRecommendedDefaults {
# conflicts with systemd-resolved
networking.useHostResolvConf = false;
config = lib.optionalAttrs (_class == "nixos") (
lib.mkIf config.clan.core.enableRecommendedDefaults {
# conflicts with systemd-resolved
networking.useHostResolvConf = false;
# Allow PMTU / DHCP
networking.firewall.allowPing = true;
# Allow PMTU / DHCP
networking.firewall.allowPing = true;
# The notion of "online" is a broken concept
# https://github.com/systemd/systemd/blob/e1b45a756f71deac8c1aa9a008bd0dab47f64777/NEWS#L13
systemd.services.NetworkManager-wait-online.enable = false;
systemd.network.wait-online.enable = false;
# The notion of "online" is a broken concept
# https://github.com/systemd/systemd/blob/e1b45a756f71deac8c1aa9a008bd0dab47f64777/NEWS#L13
systemd.services.NetworkManager-wait-online.enable = false;
systemd.network.wait-online.enable = false;
systemd.network.networks."99-ethernet-default-dhcp".networkConfig.MulticastDNS = lib.mkDefault true;
systemd.network.networks."99-wireless-client-dhcp".networkConfig.MulticastDNS = lib.mkDefault true;
networking.firewall.allowedUDPPorts = [ 5353 ]; # Multicast DNS
systemd.network.networks."99-ethernet-default-dhcp".networkConfig.MulticastDNS = lib.mkDefault true;
systemd.network.networks."99-wireless-client-dhcp".networkConfig.MulticastDNS = lib.mkDefault true;
networking.firewall.allowedUDPPorts = [ 5353 ]; # Multicast DNS
# Use networkd instead of the pile of shell scripts
networking.useNetworkd = lib.mkDefault true;
};
# Use networkd instead of the pile of shell scripts
networking.useNetworkd = lib.mkDefault true;
}
);
}