Nix flake of prebuilt Genode binaries
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

flake.nix 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. {
  2. description = "Cache of pre-built Genode binaries";
  3. edition = 201909;
  4. outputs = { self, nixpkgs }:
  5. let
  6. unpack = baseUrl:
  7. { name, value }: {
  8. inherit name;
  9. value = nixpkgs.legacyPackages.x86_64-linux.stdenvNoCC.mkDerivation {
  10. pname = name;
  11. inherit (value) version;
  12. preferLocalBuild = true;
  13. src = nixpkgs.legacyPackages.x86_64-linux.fetchurl {
  14. url = "${baseUrl}${name}/${value.version}.tar.xz";
  15. inherit (value) sha256;
  16. };
  17. dontConfigure = true;
  18. dontBuild = true;
  19. installPhase = ''
  20. find . -type f | while read FILE; do
  21. case $FILE in
  22. *.a | *.o) install -Dm444 -t $out/lib $FILE;;
  23. *.so) install -Dm555 -t $out/lib $FILE;;
  24. *.tar) install -Dm444 -t $out/tar $FILE;;
  25. *) install -Dm555 -t $out/bin $FILE;;
  26. esac
  27. done
  28. '';
  29. meta = {
  30. license = [ "LicenseRef-Genode" ];
  31. downloadPage = "${baseUrl}${name}/";
  32. };
  33. };
  34. };
  35. expand = baseUrl: listing:
  36. builtins.listToAttrs (map (unpack baseUrl) listing);
  37. base = expand "http://depot.hq.c3d2.de/user/bin/x86_64/"
  38. (import ./base-list.nix);
  39. genodelabs = expand "http://depot.genode.org/genodelabs/bin/x86_64/"
  40. (import ./genodelabs-list.nix);
  41. in { packages.x86_64-genode = base // genodelabs; };
  42. }