WIP: network module

This commit is contained in:
Sagar Ch 2024-05-28 21:01:46 +00:00
parent ade7b261ae
commit e4cdc2cae5
4 changed files with 354 additions and 0 deletions

29
nixos/default.nix Normal file
View file

@ -0,0 +1,29 @@
{ config, pkgs, lib, ... }:
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 ;};
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;
};
}