From 10b8faeb23728465694cf6fceb088723d006a223 Mon Sep 17 00:00:00 2001 From: Astro Date: Thu, 23 Jun 2022 23:11:56 +0200 Subject: [PATCH] pkgs/device-templates: exclude all ap* from all-device-scripts --- flake.nix | 2 +- nix/pkgs/default.nix | 7 +++++-- nix/pkgs/device-templates.nix | 13 ++++--------- 3 files changed, 10 insertions(+), 12 deletions(-) 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 );