network options working for basic functionality

This commit is contained in:
Git Sagar 2024-06-03 20:36:30 -03:00
parent e4cdc2cae5
commit 392375b046
9 changed files with 348 additions and 221 deletions

View file

@ -3,27 +3,8 @@ with lib;
let
vmixLib = import ./../lib {inherit pkgs lib; };
vmixCfg = config.vmix;
vmixNetwork = import ./modules/network.nix { inherit config pkgs lib ;};
vmixNetworkFunctions = import ./functions/network.nix { inherit pkgs lib ;};
#vmixVM = import ./modules/network.nix { inherit config pkgs lib ;};
args = { inherit config pkgs lib vmixLib; };
in
{
options.vmix = {
networks = lib.mkOption {
type = types.attrsOf
(types.submodule vmixNetwork);
default = { };
};
};
config =
with vmixNetworkFunctions;
#with vmixVMFunctions;
let
networkServices = lib.concatMapAttrs mkNetworkService vmixCfg.networks;
#vmServices = lib.concatMapAttrs mkVMService vmixCfg.vms;
in
{
systemd.services = namespaceGlobalService // networkServices;
};
imports = [ (import ./network args) ];
}