fix(zackbiene): fix esphome hardening to allow socket creation, fix hostapd config syntax

This commit is contained in:
oddlama 2023-03-16 03:36:53 +01:00
parent fc8b59178b
commit 711c97b393
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
5 changed files with 92 additions and 63 deletions

View file

@ -57,10 +57,16 @@ in {
};
# Rename known network interfaces
services.udev.extraRules = lib.concatStringsSep "\n" (lib.mapAttrsToList (
interface: attrs: ''SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="${attrs.mac}", NAME="${interface}"''
)
nodeSecrets.networking.interfaces);
services.udev.packages = let
interfaceNamesUdevRules = pkgs.writeTextFile {
name = "interface-names-udev-rules";
text = lib.concatStringsSep "\n" (lib.mapAttrsToList (
interface: attrs: ''SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="${attrs.mac}", NAME:="${interface}"''
)
nodeSecrets.networking.interfaces);
destination = "/etc/udev/rules.d/01-interface-names.rules";
};
in [interfaceNamesUdevRules];
nix.nixPath = [
"nixos-config=${dummyConfig}"