From c1c82426d1b8a0f623ec453c09a62cd369eb294e Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 6 Jan 2022 16:43:12 +0100 Subject: ... --- flake.nix | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 73b7425..beff838 100644 --- a/flake.nix +++ b/flake.nix @@ -90,6 +90,7 @@ # glibc.static pkgconfig + ubnt-mkfwimage ]; openwrtWithPackages = pkgs.stdenv.mkDerivation { @@ -118,6 +119,28 @@ cp -r . $out ''; }; + + ubnt-mkfwimage = pkgs.stdenv.mkDerivation rec { + pname = "ubnt-mkfwimage"; + version = "70594ca"; + src = pkgs.fetchFromGitHub { + owner = "aliosa27"; + repo = "ubnt-mkfwimage"; + rev = version; + hash = "sha256-NTOSQzRYO/3N2sNLBUa6uzA8LZSshL8W36kW2ociqrA="; + }; + + buildInputs = with pkgs; [ gcc zlib ]; + + sourceRoot = "source/src"; + buildPhase = '' + gcc -lz -o ubnt-mkfwimage ubnt-mkfwimage.c + ''; + installPhase = '' + mkdir -p $out/bin + install -m 0555 -t $out/bin ubnt-mkfwimage + ''; + }; in { devShell = pkgs.mkShell { name = "openwrt"; @@ -151,7 +174,7 @@ }; packages = { - inherit openwrtWithPackages; + inherit openwrtWithPackages ubnt-mkfwimage; }; }); } -- cgit v1.2.3