Use cross-compile pairs in Flake
This commit is contained in:
parent
94266a7bb0
commit
32f8b603cb
30
default.nix
30
default.nix
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
17
flake.nix
17
flake.nix
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue