{ inputs.openwrt-imagebuilder.url = "github:IowaCityMesh/nix-openwrt-imagebuilder"; outputs = { self, openwrt-imagebuilder }: let inherit (openwrt-imagebuilder.inputs) nixpkgs; inherit (nixpkgs) lib; sshAuthorizedKeys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCqAXBEROEfldkHdUbF3TinBhfeX5l4DQ/5MAOhLh09avqCqcHY2FanZN+qmWpD695UZ71Cl+XF6Bj0KO7Rt4SAemvkEDPMBoidkt+ZjLsdnb8GVvbDhu/62JnqW9meYTN5GcjfmKMPDtKFbgSx9PPcjsDaO6LI/GWeyTz+EYQqwTdc7TKffjLXp6bREYLf0oKIBTvW9/oPCBI7ywYmyBaadFKrYSnujJbMejH91L+JN2fJoxjjhsGcRR78ottbjz4q6JxYjt9CG5oa7Lm60xdZkiiA3c4dMuHU9+EWGshjBKL1Fb9BafeAKhHobcs7UG8IVlqHRJC5VAGQlmus/fNagAArz9PnGW4MAOgg+yLjQJLLKqePBMsAsMHZ9XT+sqPyJfcai5dWynGXFP1B63C/oosVMkeZAlBIwDz/CmufpKBCJZXCfFoC3PotWsH/JT3ir/RSdtVHQ169CEgm+AUd7gjBuRwn6j2eBHcYkn0nCbQ93KLPlnYCLXzjByGved8= emery@zuni" ]; in { packages = lib.attrsets.mapAttrs (system: pkgs: let profiles = openwrt-imagebuilder.lib.profiles { inherit pkgs; }; customConfig = { # add package to include in the image, ie. packages that you don't # want to install manually later packages = [ ]; disabledServices = [ ]; # dnsmasq # include files in the images. # to set UCI configuration, create a uci-defauts scripts as per # official OpenWRT ImageBuilder recommendation. files = pkgs.runCommandNoCC "image-files" { } '' mkdir -p $out/etc/uci-defaults cat > $out/etc/uci-defaults/99-custom << EOF uci -q batch << EOI set system.@system[0].hostname='meshic-testrouter' set wireless.@wifi-iface[0].ssid='MeshIC' commit EOI EOF mkdir -p $out/etc/dropbear cat > $out/etc/dropbear/authorized_keys << EOF ${lib.strings.concatStringsSep "\n" sshAuthorizedKeys} EOF ''; }; in { trendnet_tew-691gr = openwrt-imagebuilder.lib.build (profiles.identifyProfile "trendnet_tew-691gr" // customConfig); }) { inherit (nixpkgs.legacyPackages) x86_64-linux; }; hydraJobs = self.packages.x86_64-linux; }; }