2
0
Fork 0
Browse Source

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.
20.02
Emery Hemingway 3 years ago
parent
commit
7634f2fc08
  1. 107
      flake.nix

107
flake.nix

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

Loading…
Cancel
Save