summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2022-01-06 16:43:12 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2022-01-06 16:43:12 +0100
commitc1c82426d1b8a0f623ec453c09a62cd369eb294e (patch)
tree998d6c1903e20a666e498093a025ff3c0e77ec11 /flake.nix
parentb4a4d569c5d00872d8ce0922b8a2f4aaafa0846d (diff)
downloadap01-c1c82426d1b8a0f623ec453c09a62cd369eb294e.tar
ap01-c1c82426d1b8a0f623ec453c09a62cd369eb294e.tar.gz
ap01-c1c82426d1b8a0f623ec453c09a62cd369eb294e.tar.bz2
ap01-c1c82426d1b8a0f623ec453c09a62cd369eb294e.tar.xz
ap01-c1c82426d1b8a0f623ec453c09a62cd369eb294e.zip
...
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix25
1 files changed, 24 insertions, 1 deletions
diff --git a/flake.nix b/flake.nix
index 73b7425..beff838 100644
--- a/flake.nix
+++ b/flake.nix
@@ -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}