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.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. {
  2. description = "C3D2 Tox bot";
  3. edition = 201909;
  4. inputs.nimble.uri = "github:nix-community/flake-nimble";
  5. outputs = { self, nixpkgs, nimble }:
  6. let
  7. localSystems = [ "x86_64-linux" ];
  8. crossSystems = [ "x86_64-genode" ];
  9. forAllLocalSystems = f:
  10. nixpkgs.lib.genAttrs localSystems (system:
  11. f {
  12. inherit system;
  13. localSystem = system;
  14. crossSystem = system;
  15. });
  16. forAllCrossSystems = f:
  17. with builtins;
  18. let
  19. f' = localSystem: crossSystem:
  20. let system = localSystem + "-" + crossSystem;
  21. in {
  22. name = system;
  23. value = f { inherit system localSystem crossSystem; };
  24. };
  25. list = nixpkgs.lib.lists.crossLists f' [ localSystems crossSystems ];
  26. in listToAttrs list;
  27. forAllSystems = f: (forAllLocalSystems f) // (forAllCrossSystems f);
  28. buildBot = { system, localSystem, crossSystem }:
  29. nimble.defaultPackage.${system}.buildNimble {
  30. name = "hqtoxbot";
  31. src = self;
  32. homepage = "https://gitea.c3d2.de/ehmry/hqtoxbot";
  33. };
  34. in {
  35. defaultPackage = forAllSystems buildBot;
  36. packages = let
  37. f = { system, localSystem, crossSystem }: {
  38. hqtoxbot = builtins.getAttr system self.defaultPackage;
  39. };
  40. in forAllSystems f;
  41. };
  42. }