diff options
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 25 |
1 files changed, 24 insertions, 1 deletions
@@ -90,6 +90,7 @@ | |||
90 | # glibc.static | 90 | # glibc.static |
91 | 91 | ||
92 | pkgconfig | 92 | pkgconfig |
93 | ubnt-mkfwimage | ||
93 | ]; | 94 | ]; |
94 | 95 | ||
95 | openwrtWithPackages = pkgs.stdenv.mkDerivation { | 96 | openwrtWithPackages = pkgs.stdenv.mkDerivation { |
@@ -118,6 +119,28 @@ | |||
118 | cp -r . $out | 119 | cp -r . $out |
119 | ''; | 120 | ''; |
120 | }; | 121 | }; |
122 | |||
123 | ubnt-mkfwimage = pkgs.stdenv.mkDerivation rec { | ||
124 | pname = "ubnt-mkfwimage"; | ||
125 | version = "70594ca"; | ||
126 | src = pkgs.fetchFromGitHub { | ||
127 | owner = "aliosa27"; | ||
128 | repo = "ubnt-mkfwimage"; | ||
129 | rev = version; | ||
130 | hash = "sha256-NTOSQzRYO/3N2sNLBUa6uzA8LZSshL8W36kW2ociqrA="; | ||
131 | }; | ||
132 | |||
133 | buildInputs = with pkgs; [ gcc zlib ]; | ||
134 | |||
135 | sourceRoot = "source/src"; | ||
136 | buildPhase = '' | ||
137 | gcc -lz -o ubnt-mkfwimage ubnt-mkfwimage.c | ||
138 | ''; | ||
139 | installPhase = '' | ||
140 | mkdir -p $out/bin | ||
141 | install -m 0555 -t $out/bin ubnt-mkfwimage | ||
142 | ''; | ||
143 | }; | ||
121 | in { | 144 | in { |
122 | devShell = pkgs.mkShell { | 145 | devShell = pkgs.mkShell { |
123 | name = "openwrt"; | 146 | name = "openwrt"; |
@@ -151,7 +174,7 @@ | |||
151 | }; | 174 | }; |
152 | 175 | ||
153 | packages = { | 176 | packages = { |
154 | inherit openwrtWithPackages; | 177 | inherit openwrtWithPackages ubnt-mkfwimage; |
155 | }; | 178 | }; |
156 | }); | 179 | }); |
157 | } | 180 | } |