Skip to content

Instantly share code, notes, and snippets.

@shift
Last active January 8, 2024 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shift/f003dce1507f2b8b65304a2ef4e9886b to your computer and use it in GitHub Desktop.
Save shift/f003dce1507f2b8b65304a2ef4e9886b to your computer and use it in GitHub Desktop.
Very bare flake example using the image builder for the dynalink_dl-wrx36 access point.
{
inputs = {
openwrt-imagebuilder.url = "github:astro/nix-openwrt-imagebuilder";
};
outputs = { self, nixpkgs, openwrt-imagebuilder }: {
packages.x86_64-linux.ap1 =
let
pkgs = nixpkgs.legacyPackages.x86_64-linux;
profiles = openwrt-imagebuilder.lib.profiles { inherit pkgs; };
config = profiles.identifyProfile "dynalink_dl-wrx36" // {
packages = [ "wpad-mbedtls" "acme-acmesh-dnsapi" "dawn" "ddns-scripts-cloudflare" "-wpad-basic-mbedtls" ];
disabledServices = [ "dnsmasq" ];
# official OpenWRT ImageBuilder recommendation.
files = pkgs.runCommand "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='testap'
commit
EOI
EOF
'';
};
in
openwrt-imagebuilder.lib.build config;
};
}
@shift
Copy link
Author

shift commented Jan 8, 2024

Used via nix run .#packages.x86_64-linux.ap1.
Output:

ls result/
nix-support
openwrt-23.05.0-ipq807x-generic-dynalink_dl-wrx36.manifest
openwrt-23.05.0-ipq807x-generic-dynalink_dl-wrx36-squashfs-factory.ubi
openwrt-23.05.0-ipq807x-generic-dynalink_dl-wrx36-squashfs-sysupgrade.bin
profiles.json
sha256sums

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment