Use cross-compile pairs in Flake

This commit is contained in:
Ehmry - 2019-12-02 15:53:26 +01:00
parent 94266a7bb0
commit 32f8b603cb
3 changed files with 28 additions and 23 deletions

View File

@ -1,15 +1,15 @@
{ localSystem ? "x86_64-linux", crossSystem ? "x86_64-genode", self ? { }, ...
}@args:
let
nixpkgsGit = builtins.fetchGit {
pinnedNixpkgs = import (builtins.fetchGit {
url = "https://gitea.c3d2.de/ehmry/nixpkgs.git";
ref = "genode";
};
pinnedNixpkgs = import nixpkgsGit {
localSystem = "x86_64-linux";
crossSystem = "x86_64-genode";
};
});
nixpkgs =
args.nixpkgs or (pinnedNixpkgs { inherit localSystem crossSystem; });
in { system ? "x86_64-genode", self ? { }, nixpkgs ? pinnedNixpkgs }:
let
inherit (nixpkgs) stdenv buildPackages fetchgit llvmPackages;
src = self.outPath or ./.;
@ -25,15 +25,23 @@ let
buildRepo = { repo, repoInputs }:
let
tupArch = with stdenv.targetPlatform;
if isAarch32 then
"arm"
else if isAarch64 then
else
if isAarch64 then
"arm64"
else if isx86_32 then
else
if isx86_32 then
"i386"
else if isx86_64 then
else
if isx86_64 then
"x86_64"
else
abort "unhandled targetPlatform";
toTupConfig = attrs:

View File

@ -2,9 +2,9 @@
"inputs": {
"nixpkgs": {
"inputs": {},
"narHash": "sha256-g++A7ut8qyY3yi6WskTHwYbci6+MeTxJDLyzSrTjruM=",
"narHash": "sha256-/9hMb9pgV8awDYYchUueplyKF6bz23b7z5gqQ999nro=",
"originalUrl": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=genode",
"url": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=genode&rev=9426fc2248cfc706f7a659b04fcd6935515232bc"
"url": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=genode&rev=d63ee96d86672a9cb23d83d50ee02687eded2818"
}
},
"version": 3

View File

@ -5,19 +5,16 @@
inputs.nixpkgs.uri = "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=genode";
outputs = { self, nixpkgs }:
let
systems = [ "x86_64-genode" ];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
in {
packages = forAllSystems (system:
outputs = { self, nixpkgs }: {
packages = nixpkgs.lib.forAllCrossSystems
({ system, localSystem, crossSystem }:
import ./default.nix {
inherit system self;
inherit localSystem crossSystem self;
nixpkgs = builtins.getAttr system nixpkgs.legacyPackages;
});
defaultPackage = forAllSystems (system: self.packages."${system}".os);
defaultPackage.x86_64-linux = self.packages.x86_64-linux-x86_64-genode.os;
hydraJobs = self.packages;
};
hydraJobs = self.packages;
};
}