blob: 30572535bc53fa8297f6c99ae46a28c0717f19c7 [file] [log] [blame]
root4418e292022-05-19 07:03:04 +01001{
2 description = "A flake to build android's partition-tools package";
3
4 inputs.nixpkgs.url = github:NixOS/nixpkgs/nixos-21.11;
5
6 outputs = { self, nixpkgs }: {
7
8 packages.x86_64-linux.partition-tools =
9 with import nixpkgs { system = "x86_64-linux"; };
10 stdenv.mkDerivation {
11 name = "partition-tools";
12 src = fetchurl { url = "https://android.googlesource.com/platform/system/extras/+archive/master/partition_tools.tar.gz"; hash = "sha256-bsO2QEcO9HuR4lZ6j+CmEIrvfT2YaynWvK4ZZLIv/CU="; };
13 unpackPhase = "tar xzf ${src}";
14 buildPhase = "tar xzf partition_tools.tar.gz && g++ -o out *.cc";
15 installPhase = "mkdir -p $out/bin && cp out/* $out/bin";
16 };
17
18 defaultPackage.x86_64-linux = self.packages.x86_64-linux.partition-tools;
19
20 };
21}