Genode cross-compilation
This commit is contained in:
parent
5a6d42f28e
commit
3b27d93e6e
14
flake.lock
14
flake.lock
|
@ -4,14 +4,20 @@
|
|||
"inputs": {
|
||||
"nixpkgs": {
|
||||
"inputs": {},
|
||||
"narHash": "sha256-aLJ6PHTU1VbWBdyZbI/lLoj2JelUCGgovUsHlnAFIOE=",
|
||||
"narHash": "sha256-aFixJLbJ9ubH5I6ST8k9NRjb/d7o/MAu1Qc/1Sv6eRY=",
|
||||
"originalUrl": "nixpkgs",
|
||||
"url": "git+file:///home/repo/nixpkgs?ref=genode-19.09&rev=cc2b10a7ed78f62dc2b3afa50d34d613c36e619e"
|
||||
"url": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=genode-19.09&rev=489c8ae221fde2b011ebfc207eb3acb6573816ce"
|
||||
}
|
||||
},
|
||||
"narHash": "sha256-ZzL+Gdl1R7UJK1I8s/ff+aQVaMCB9pu0gFmTZJeb8mA=",
|
||||
"narHash": "sha256-5QBWE3wHBpVx0L3bdYzYsUFz/qPxjekThlMNrMqu6xw=",
|
||||
"originalUrl": "git+https://git.sr.ht/~ehmry/nimble_flake",
|
||||
"url": "git+https://git.sr.ht/~ehmry/nimble_flake?ref=master&rev=11ee779063eb4c78f7bfa281e36e1cc3ae161635"
|
||||
"url": "git+https://git.sr.ht/~ehmry/nimble_flake?ref=master&rev=da0efe3af853cf597b52d47a04848074a6a31a13"
|
||||
},
|
||||
"nixpkgs": {
|
||||
"inputs": {},
|
||||
"narHash": "sha256-aFixJLbJ9ubH5I6ST8k9NRjb/d7o/MAu1Qc/1Sv6eRY=",
|
||||
"originalUrl": "git+https://gitea.c3d2.de/ehmry/nixpkgs?ref=genode",
|
||||
"url": "git+https://gitea.c3d2.de/ehmry/nixpkgs?ref=genode&rev=489c8ae221fde2b011ebfc207eb3acb6573816ce"
|
||||
}
|
||||
},
|
||||
"version": 3
|
||||
|
|
53
flake.nix
53
flake.nix
|
@ -4,16 +4,51 @@
|
|||
edition = 201909;
|
||||
|
||||
inputs.nimble.uri = "git+https://git.sr.ht/~ehmry/nimble_flake";
|
||||
inputs.nixpkgs.uri = "git+https://gitea.c3d2.de/ehmry/nixpkgs?ref=genode";
|
||||
|
||||
outputs = { self, nimble }: {
|
||||
outputs = { self, nixpkgs, nimble }:
|
||||
let
|
||||
localSystems = [ "x86_64-linux" ];
|
||||
crossSystems = [ "x86_64-genode" ];
|
||||
|
||||
packages.x86_64-linux.hqtoxbot =
|
||||
nimble.defaultPackage.x86_64-linux.buildNimble {
|
||||
name = "hqtoxbot";
|
||||
src = self;
|
||||
homepage = "https://gitea.c3d2.de/ehmry/hqtoxbot";
|
||||
};
|
||||
forAllLocalSystems = f:
|
||||
nixpkgs.lib.genAttrs localSystems (system:
|
||||
f {
|
||||
inherit system;
|
||||
localSystem = system;
|
||||
crossSystem = system;
|
||||
});
|
||||
|
||||
defaultPackage.x86_64-linux = self.packages.x86_64-linux.hqtoxbot;
|
||||
};
|
||||
forAllCrossSystems = f:
|
||||
with builtins;
|
||||
let
|
||||
f' = localSystem: crossSystem:
|
||||
let system = localSystem + "-" + crossSystem;
|
||||
in {
|
||||
name = system;
|
||||
value = f { inherit system localSystem crossSystem; };
|
||||
};
|
||||
list = nixpkgs.lib.lists.crossLists f' [ localSystems crossSystems ];
|
||||
in listToAttrs list;
|
||||
|
||||
forAllSystems = f: (forAllLocalSystems f) // (forAllCrossSystems f);
|
||||
|
||||
buildBot = { system, localSystem, crossSystem }:
|
||||
|
||||
nimble.defaultPackage."${system}".buildNimble {
|
||||
name = "hqtoxbot";
|
||||
src = self;
|
||||
homepage = "https://gitea.c3d2.de/ehmry/hqtoxbot";
|
||||
};
|
||||
|
||||
in {
|
||||
|
||||
defaultPackage = forAllSystems buildBot;
|
||||
|
||||
packages = let
|
||||
f = { system, localSystem, crossSystem }: {
|
||||
hqtoxbot = builtins.getAttr system self.defaultPackage;
|
||||
};
|
||||
in forAllSystems f;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue