refactor(flake): split host guest and module assembly

This commit is contained in:
2026-08-28 22:45:47 -04:00
parent b3c2cedf2b
commit 9366a90bca
18 changed files with 470 additions and 561 deletions

12
lib/network.nix Normal file
View File

@@ -0,0 +1,12 @@
{ lib }:
{
bridgeName = id: "br-vlan${toString id}";
deriveMac =
name:
let
hash = builtins.hashString "sha256" name;
octet = i: builtins.substring (i * 2) 2 hash;
in
lib.concatStringsSep ":" ([ "02" ] ++ map octet [ 0 1 2 3 4 ]);
}