infra/modules/darwin/common/network.nix

25 lines
757 B
Nix
Raw Normal View History

2024-07-31 15:41:40 +10:00
{ config, lib, ... }:
{
options.nixCommunity.darwin.ipv6 = lib.mkOption {
type = lib.types.singleLineStr;
default = null;
description = ''
<address> <prefixlength> <router>
'';
};
config = {
# disable application layer firewall, telegraf needs an incoming connection
system.defaults.alf.globalstate = 0;
# Make sure to disable netbios on activation
system.activationScripts.postActivation.text = lib.mkBefore ''
echo disabling netbios... >&2
launchctl disable system/netbiosd
launchctl unload -w /System/Library/LaunchDaemons/com.apple.netbiosd.plist 2>/dev/null || true
echo setting ipv6... >&2
networksetup -setv6manual Ethernet ${config.nixCommunity.darwin.ipv6}
'';
};
}