File tree Expand file tree Collapse file tree 3 files changed +7
-19
lines changed Expand file tree Collapse file tree 3 files changed +7
-19
lines changed Original file line number Diff line number Diff line change 19
19
++ lib . optional ( lib . versionAtLeast ( lib . versions . majorMinor config . nix . package . version ) "2.19" )
20
20
# Allow the use of the impure-env setting.
21
21
"configurable-impure-env" ;
22
-
23
- # for container in builds support
24
- nix . settings . system-features = lib . mkDefault [ "uid-range" ] ;
25
22
}
Original file line number Diff line number Diff line change 1
1
{ config , lib , ... } :
2
2
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 ;
13
4
in
14
5
{
15
6
# Avahi is an alternative implementation. If it's enabled, than we don't need the code below.
16
7
config = lib . mkIf ( ! config . services . avahi . enable ) {
17
8
networking . firewall . allowedUDPPorts = [ 5353 ] ; # Multicast DNS
18
9
19
10
# 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 ;
21
17
} ;
22
18
}
Original file line number Diff line number Diff line change 43
43
44
44
} ;
45
45
config = lib . mkIf ( cfg . flake != null ) {
46
-
47
- nixpkgs . flake = {
48
- source = lib . mkDefault ( cfg . flake . inputs . nixpkgs or null ) ;
49
- } ;
50
-
51
46
nix . registry = lib . optionalAttrs cfg . registerSelf {
52
47
self . to = lib . mkDefault {
53
48
type = "path" ;
You can’t perform that action at this time.
0 commit comments