blob: 22fc2064739e181db64d846a467b40fd563ee222 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
{
config,
lib,
pkgs,
...
}:
let
cfg = config.os.core.network;
in
{
options.os.core.network = {
enable = lib.mkEnableOption "system-wide networking setup";
profile = lib.mkOption {
type = lib.types.enum [
"client"
"server"
];
default = "client";
description = "Which networking profile configuration to apply";
};
};
config = lib.mkIf cfg.enable (
lib.mkMerge [
{
networking.networkmanager = {
enable = true;
dns = "systemd-resolved";
};
services.resolved.enable = true;
}
(lib.mkIf (cfg.profile == "client") {
networking.networkmanager = {
wifi.macAddress = "random";
wifi.backend = "iwd";
ethernet.macAddress = "random";
};
systemd.services."NetworkManager-wait-online".enable = false;
environment.systemPackages = [
pkgs.impala
];
})
(lib.mkIf (cfg.profile == "server") {
networking.networkmanager = {
wifi.macAddress = "keep";
ethernet.macAddress = "keep";
};
})
]
);
}
|