Nix configurations for my homelab
at main 1.3 kB view raw
1{ lib, ... }: 2{ 3 options.garden.info.network = lib.mkOption { 4 description = "Information about every host in the network."; 5 type = 6 with lib.types; 7 attrsOf ( 8 submodule ( 9 { name, ... }: 10 { 11 options = { 12 name = lib.mkOption { 13 type = str; 14 description = "Name of the host"; 15 }; 16 ipv4 = lib.mkOption { 17 type = nullOr str; 18 default = null; 19 description = "IPv4 address of the host"; 20 }; 21 ipv4-local = lib.mkOption { 22 type = nullOr str; 23 default = null; 24 description = "Local IPv4 address of the host"; 25 }; 26 ipv6 = lib.mkOption { 27 type = nullOr str; 28 default = null; 29 description = "IPv6 address of the host"; 30 }; 31 netbird-ip = lib.mkOption { 32 type = nullOr str; 33 default = null; 34 description = "NetBird IP address of the host"; 35 }; 36 }; 37 38 config.name = name; 39 } 40 ) 41 ); 42 }; 43 44 config.garden.info.network = builtins.fromJSON (builtins.readFile ../hidden/network.json); 45}