Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/astro/nix-openwrt-imagebuilder
Build OpenWRT images in Nix derivations
https://github.com/astro/nix-openwrt-imagebuilder
nix nix-flake nixos openwrt
Last synced: 7 days ago
JSON representation
Build OpenWRT images in Nix derivations
- Host: GitHub
- URL: https://github.com/astro/nix-openwrt-imagebuilder
- Owner: astro
- License: mit
- Created: 2022-04-27T20:38:30.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T08:55:45.000Z (2 months ago)
- Last Synced: 2024-10-29T10:03:40.022Z (2 months ago)
- Topics: nix, nix-flake, nixos, openwrt
- Language: Nix
- Homepage:
- Size: 31.2 MB
- Stars: 140
- Watchers: 5
- Forks: 17
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - astro/nix-openwrt-imagebuilder - Build OpenWRT images in Nix derivations (Nix)
- awesome-starred - astro/nix-openwrt-imagebuilder - Build OpenWRT images in Nix derivations (Nix)
README
# nix-openwrt-imagebuilder
Generate OpenWRT images from Nix derivations using the official
ImageBuilders that are provided upstream.For OpenWRT releases since 19.07 there is profile helper functionality
that helps you find the proper image specification (target, variant)
according to your hardware's profile name.## Background
In an ideal world, OpenWRT would be built from source in many
fine-grained Nix derivations. Until someone implements that (please
do!), this project exists to reuse the binary ImageBuilders that are
included in every OpenWRT release. They are only available for
x86_64-linux hosts.The ImageBuilder can generate new *sysupgrade* images with a
customized set of packages and included files.## Usage with vanilla Nix
```nix
let
pkgs = import {};# use fetchurl, Hydra inputs, or something else to refer to this project
openwrt-imagebuilder = ../nix-openwrt-imagebuilder;profiles = import (openwrt-imagebuilder + "/profiles.nix") { inherit pkgs; };
# example: find target/variant for an old Fritzbox
config = profiles.identifyProfile "avm_fritz7412" // {
# add package to include in the image, ie. packages that you don't
# want to install manually later
packages = [ "tcpdump" ];disabledServices = [ "dnsmasq" ];
# include files in the images.
# to set UCI configuration, create a uci-defauts scripts as per
# official OpenWRT ImageBuilder recommendation.
files = pkgs.runCommand "image-files" {} ''
mkdir -p $out/etc/uci-defaults
cat > $out/etc/uci-defaults/99-custom < $out/etc/uci-defaults/99-custom <