From c689d2715c66c3f2bd13509eaf054ccc7d6cfb01 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Fri, 27 May 2022 10:12:26 -0500 Subject: [PATCH] Initial test --- flake.lock | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 40 +++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..09d5a32 --- /dev/null +++ b/flake.lock @@ -0,0 +1,75 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1653326962, + "narHash": "sha256-W8feCYqKTsMre4nAEpv5Kx1PVFC+hao/LwqtB2Wci/8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "41cc1d5d9584103be4108c1815c350e07c807036", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1651024496, + "narHash": "sha256-uKSrrw/neSkxX6TXPSaMyfu7iKzFrK7F6HOt6vQefGY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d9e593ed5889f3906dc72811c45bf684be8865cf", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "openwrt": { + "flake": false, + "locked": { + "lastModified": 1651013664, + "narHash": "sha256-efpsYc8KfjIbcD0vdE+VC9tWS471NFAxUB884kJhUEE=", + "ref": "master", + "rev": "f757a8a09885e3c8bb76371e037b8c0731111980", + "revCount": 53988, + "type": "git", + "url": "https://git.openwrt.org/openwrt/openwrt.git?tag=v21.02.3" + }, + "original": { + "type": "git", + "url": "https://git.openwrt.org/openwrt/openwrt.git?tag=v21.02.3" + } + }, + "openwrt-imagebuilder": { + "inputs": { + "nixpkgs": "nixpkgs_2", + "openwrt": "openwrt" + }, + "locked": { + "lastModified": 1653663077, + "narHash": "sha256-tXTrdT6Lru6TmRer/7wWp5sXUbNLlV79cO5dPPhgBaU=", + "owner": "IowaCityMesh", + "repo": "nix-openwrt-imagebuilder", + "rev": "e59021b707a646b9cd05edb2e9b2d183bf2d55b4", + "type": "github" + }, + "original": { + "owner": "IowaCityMesh", + "repo": "nix-openwrt-imagebuilder", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "openwrt-imagebuilder": "openwrt-imagebuilder" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..9ad7010 --- /dev/null +++ b/flake.nix @@ -0,0 +1,40 @@ +{ + inputs.openwrt-imagebuilder.url = + "github:IowaCityMesh/nix-openwrt-imagebuilder"; + + outputs = { self, nixpkgs, openwrt-imagebuilder }: + let inherit (nixpkgs) lib; + 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 = [ "batman-adv" ]; + + 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 <