2
0
Fork 0

Expose x86_64-linux-x86_64-genode as x86_64-linux

These packages will execute with the Linux kernel, so pass them thru as
a convience.
This commit is contained in:
Ehmry - 2019-12-20 07:38:34 +00:00
parent 43989b1e0f
commit 7634f2fc08
1 changed files with 66 additions and 39 deletions

105
flake.nix
View File

@ -13,56 +13,83 @@
outputs = { self, dhall-haskell, genode-depot, genode, nixpkgs }: outputs = { self, dhall-haskell, genode-depot, genode, nixpkgs }:
let let
systems = [ "x86_64-genode" ]; mkOutput = { system, localSystem, crossSystem }:
let thisSystem = builtins.getAttr system;
in rec {
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system); packages = import ./packages.nix {
in {
lib = nixpkgs.lib.forAllCrossSystems
({ system, localSystem, crossSystem }:
nixpkgs.lib // (import ./lib {
inherit system localSystem crossSystem nixpkgs dhall-haskell
genode-depot;
genodepkgs = self;
}));
packages = nixpkgs.lib.forAllCrossSystems
({ system, localSystem, crossSystem }:
let thisSystem = builtins.getAttr system;
in import ./packages.nix {
inherit system nixpkgs; inherit system nixpkgs;
depot = thisSystem genode-depot.packages; depot = thisSystem genode-depot.packages;
genode = thisSystem genode.packages; genode = thisSystem genode.packages;
} // thisSystem genode.packages) // } // thisSystem genode.packages;
{ x86_64-linux = self.packages.x86_64-linux-x86_64-genode; };
defaultPackage.x86_64-linux = legacyPackages = thisSystem nixpkgs.legacyPackages;
self.packages.x86_64-linux-x86_64-genode.base-linux; # pass thru Nixpkgs
checks = nixpkgs.lib.forAllCrossSystems defaultPackage = packages.base-linux;
({ system, localSystem, crossSystem }:
let thisSystem = builtins.getAttr system; devShell = packages.stdenv;
in import ./tests {
inherit self system localSystem crossSystem nixpkgs dhall-haskell lib = (nixpkgs.lib) // (import ./lib {
genode-depot; inherit system localSystem crossSystem;
genodepkgs = thisSystem self.packages; inherit nixpkgs dhall-haskell genode-depot;
genodepkgs = self;
});
nixosModule = ./nixos;
checks = (import ./tests {
inherit system localSystem crossSystem;
inherit self nixpkgs dhall-haskell genode-depot;
lib = thisSystem self.lib; lib = thisSystem self.lib;
genodepkgs = thisSystem self.packages;
}) // { }) // {
x86_64-linux.nixos = nixos = import ./nixos/test.nix {
let pkgs' = nixpkgs.legacyPackages.x86_64-linux // { }; system = localSystem;
in import ./nixos/test.nix { depot = genode-depot;
system = "x86_64-linux"; genodepkgs = self;
depot = genode-depot; inherit nixpkgs;
genodepkgs = self; };
inherit nixpkgs;
};
}; };
nixosModule = import ./nixos; };
devShell.x86_64-linux = self.packages.x86_64-linux-x86_64-genode.stdenv; localSystems = [ "x86_64-linux" ];
crossSystems = [ "x86_64-genode" ];
}; 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 ];
attrSet = listToAttrs list;
in attrSet;
finalize = outputs:
with builtins;
let
outputs' = outputs // {
x86_64-linux = getAttr "x86_64-linux-x86_64-genode" outputs;
};
systems = attrNames outputs';
outputAttrs = attrNames (head (attrValues outputs'));
list = map (attr: {
name = attr;
value = listToAttrs (map (system: {
name = system;
value = getAttr attr (getAttr system outputs');
}) systems);
}) outputAttrs;
in listToAttrs list;
final = finalize (forAllCrossSystems mkOutput);
in final;
} }