diff --git a/configMaker.nix b/configMaker.nix index ded07fe..f818513 100644 --- a/configMaker.nix +++ b/configMaker.nix @@ -104,6 +104,10 @@ let module_inst = { "me0" ]; in (import ).evalModules { - modules = [ module module_inst ]; + specialArgs.pkgs = import {}; + modules = [ + module + module_inst + ]; } diff --git a/moduleMaker.nix b/moduleMaker.nix index bc9f59e..a6b5c8d 100644 --- a/moduleMaker.nix +++ b/moduleMaker.nix @@ -1,5 +1,5 @@ interfaces: -{ lib, config, ... }: +{ lib, pkgs, config, ... }: let cfg = config; in with lib; { options = { @@ -41,6 +41,7 @@ in with lib; { in types.listOf vlan_type; default = [ ]; }; + # TODO: use this option dhcp_trusted = mkOption { type = types.bool; default = false; @@ -147,18 +148,39 @@ in with lib; { '' else ""; - in [ '' - - ${builtins.concatStringsSep "\n" interface_xmls} - ${irb_intf} - - - - ${builtins.concatStringsSep "\n" rstps} - - - - ${builtins.concatStringsSep "\n" vlans} - '' vlan_trust_table - ]; + config = '' + + ${builtins.concatStringsSep "\n" interface_xmls} + ${irb_intf} + + + + ${builtins.concatStringsSep "\n" rstps} + + + + ${builtins.concatStringsSep "\n" vlans} + + ''; + rpc_requests = pkgs.writeText "config_rpc.xml" '' + + + + + ${config} + + + + + + + + + + + ''; + in pkgs.writeShellScript "deploy.sh" '' + ${pkgs.openssh}/bin/ssh jourdan01.dgn -p 830 -s netconf < ${rpc_requests} + '' + ; }