diff --git a/flake.nix b/flake.nix index a912e9a..d1131d1 100644 --- a/flake.nix +++ b/flake.nix @@ -75,7 +75,7 @@ "all-device-scripts" = hydraJob; "export-config" = exportFileWrapper; "switch-.*" = exportFileWrapper; - "ap.*" = exportFileWrapper; + "ap.*-image" = exportFileWrapper; }; in builtins.mapAttrs (name: pkg: diff --git a/nix/pkgs/default.nix b/nix/pkgs/default.nix index f208b2a..3645b8b 100644 --- a/nix/pkgs/default.nix +++ b/nix/pkgs/default.nix @@ -71,7 +71,10 @@ let openwrt = import ./openwrt { inherit self nixpkgs system openwrt-imagebuilder; }; - openwrt-images = builtins.foldl' (images: hostName: images // { + openwrt-packages = builtins.foldl' (images: hostName: images // { + ${hostName} = pkgs.writeScriptBin "${hostName}.sh" ( + openwrt.sshScript hostName + ); "${hostName}-image" = openwrt.buildImage hostName; }) {} ( builtins.attrNames ( @@ -101,7 +104,7 @@ let inherit self nixpkgs system; }; in -rootfs-packages // vm-packages // device-templates // openwrt-images // network-graphs // network-cypher-graphs // starlink // subnetplans // { +rootfs-packages // vm-packages // device-templates // openwrt-packages // network-graphs // network-cypher-graphs // starlink // subnetplans // { inherit export-openwrt-models export-config dns-slaves encrypt-secrets decrypt-secrets switch-to-production vlan-report diff --git a/nix/pkgs/device-templates.nix b/nix/pkgs/device-templates.nix index b5bab6e..d63c35a 100644 --- a/nix/pkgs/device-templates.nix +++ b/nix/pkgs/device-templates.nix @@ -11,18 +11,13 @@ let args = { inherit self hostName config hostConfig pkgs; }; - in { - ap = openwrt.sshScript hostName; - switch = import (./switches + "/${model}.nix") - (args // - import ./switches/shared.nix args - ); - }.${role} + in import (./switches + "/${model}.nix") ( + args // import ./switches/shared.nix args + ) ) ) ( filterAttrs (_: { role, model, ... }: - role == "ap" || - (role == "switch" && model != "dumb") + role == "switch" && model != "dumb" ) config.site.hosts );