mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 09:07:21 +01:00
feat: switch proxt host
This commit is contained in:
parent
5d27d18f85
commit
0cb34c98cb
61 changed files with 1147 additions and 736 deletions
|
|
@ -2,7 +2,7 @@
|
|||
let
|
||||
netConfig = config.repo.secrets.local.networking;
|
||||
netPrefix = "${if config.swarselsystems.isCloud then config.node.name else "home"}";
|
||||
netName = "${netPrefix}-${config.swarselsystems.server.localNetwork}";
|
||||
# netName = "${netPrefix}-${config.swarselsystems.server.localNetwork}";
|
||||
in
|
||||
{
|
||||
options = {
|
||||
|
|
@ -14,7 +14,7 @@ in
|
|||
};
|
||||
netConfigName = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = netName;
|
||||
default = "${netPrefix}-${config.swarselsystems.server.localNetwork}";
|
||||
readOnly = true;
|
||||
};
|
||||
netConfigPrefix = lib.mkOption {
|
||||
|
|
@ -28,10 +28,21 @@ in
|
|||
|
||||
swarselsystems.server.localNetwork = netConfig.localNetwork or "";
|
||||
|
||||
globals.networks.${netName}.hosts.${config.node.name} = {
|
||||
inherit (netConfig.networks.${netConfig.localNetwork}) id;
|
||||
mac = netConfig.networks.${netConfig.localNetwork}.mac or null;
|
||||
};
|
||||
# globals.networks.${netName}.hosts.${config.node.name} = {
|
||||
# inherit (netConfig.networks.${netConfig.localNetwork}) id;
|
||||
# mac = netConfig.networks.${netConfig.localNetwork}.mac or null;
|
||||
# };
|
||||
|
||||
globals.networks = lib.mapAttrs'
|
||||
(netName: _:
|
||||
lib.nameValuePair "${netPrefix}-${netName}" {
|
||||
hosts.${config.node.name} = {
|
||||
inherit (netConfig.networks.${netName}) id;
|
||||
mac = netConfig.networks.${netName}.mac or null;
|
||||
};
|
||||
}
|
||||
)
|
||||
netConfig.networks;
|
||||
|
||||
globals.hosts.${config.node.name} = {
|
||||
inherit (config.repo.secrets.local.networking) defaultGateway4;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue