Skip to content

Commit e3b4048

Browse files
authored
Merge pull request #590 from nix-community/misc
Various fixes (macOS, mdns)
2 parents 2a30339 + a48f731 commit e3b4048

File tree

3 files changed

+7
-19
lines changed

3 files changed

+7
-19
lines changed

darwin/mixins/nix-experimental.nix

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,4 @@
1919
++ lib.optional (lib.versionAtLeast (lib.versions.majorMinor config.nix.package.version) "2.19")
2020
# Allow the use of the impure-env setting.
2121
"configurable-impure-env";
22-
23-
# for container in builds support
24-
nix.settings.system-features = lib.mkDefault [ "uid-range" ];
2522
}

nixos/mixins/mdns.nix

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
{ config, lib, ... }:
22
let
3-
# The default value of useDHCP for individual interfaces is null!
4-
mapInterfaceEnabled = i: lib.nameValuePair "40-${i.name}" (i.useDHCP == true);
5-
mapMDNSConfig = enableMDNS: {
6-
networkConfig.MulticastDNS = lib.mkDefault enableMDNS;
7-
};
8-
9-
configs = {
10-
"99-ethernet-default-dhcp" = config.networking.useDHCP;
11-
"99-wireless-client-dhcp" = config.networking.useDHCP;
12-
} // (lib.mapAttrs' (_: mapInterfaceEnabled) config.networking.interfaces);
3+
dhcpInterfaces = lib.filterAttrs (i: i.useDHCP == true) config.networking.interfaces;
134
in
145
{
156
# Avahi is an alternative implementation. If it's enabled, than we don't need the code below.
167
config = lib.mkIf (!config.services.avahi.enable) {
178
networking.firewall.allowedUDPPorts = [ 5353 ]; # Multicast DNS
189

1910
# Allows to find machines on the local network by name, i.e. useful for printer discovery
20-
systemd.network.networks = builtins.mapAttrs (_: mapMDNSConfig) configs;
11+
systemd.network.networks =
12+
lib.optionalAttrs (config.networking.useDHCP) {
13+
"99-ethernet-default-dhcp".networkConfig.MulticastDNS = lib.mkDefault true;
14+
"99-wireless-client-dhcp".networkConfig.MulticastDNS = lib.mkDefault true;
15+
}
16+
// builtins.mapAttrs (_: { networkConfig.MulticastDNS = lib.mkDefault true; }) dhcpInterfaces;
2117
};
2218
}

shared/common/flake.nix

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@ in
4343

4444
};
4545
config = lib.mkIf (cfg.flake != null) {
46-
47-
nixpkgs.flake = {
48-
source = lib.mkDefault (cfg.flake.inputs.nixpkgs or null);
49-
};
50-
5146
nix.registry = lib.optionalAttrs cfg.registerSelf {
5247
self.to = lib.mkDefault {
5348
type = "path";

0 commit comments

Comments
 (0)