Simplify flake.nix

This commit is contained in:
Ehmry - 2021-03-02 23:35:55 +01:00
parent 165cf60551
commit 73c8b62645
1 changed files with 22 additions and 25 deletions

View File

@ -35,23 +35,6 @@
crossSystem = system;
}));
nixpkgsFor = forAllSystems ({ system, localSystem, crossSystem }:
if localSystem == crossSystem then
import nixpkgs {
inherit system;
overlays = [ self.overlay nimble.overlay ];
}
else
import nixpkgs {
inherit localSystem;
crossSystem = {
system = crossSystem;
useLLVM = true;
};
config.allowUnsupportedSystem = true;
overlays = [ self.overlay nimble.overlay ];
});
in rec {
overlay =
@ -164,19 +147,33 @@
});
legacyPackages =
# The nixpkgs.legacyPackages after overlaying
# and with some additional Genode packages
forAllSystems
({ system, localSystem, crossSystem }: nixpkgsFor.${system});
# pass thru Nixpkgs
/* The nixpkgs.legacyPackages after overlaying
and with some additional Genode packages.
*/
legacyPackages = let f = import nixpkgs;
in forAllSystems ({ system, localSystem, crossSystem }:
if localSystem == crossSystem then
f {
inherit system;
overlays = [ self.overlay nimble.overlay ];
}
else
f {
inherit localSystem;
crossSystem = {
system = crossSystem;
useLLVM = true;
};
config.allowUnsupportedSystem = true;
overlays = [ self.overlay nimble.overlay ];
});
packages =
# Genode native packages, not packages in the traditional
# sense in that these cannot be installed within a profile
forAllCrossSystems ({ system, localSystem, crossSystem }:
nixpkgs.lib.filterAttrs (n: v: v != null)
nixpkgsFor.${system}.genodePackages);
self.legacyPackages.${system}.genodePackages);
devShell =
# Development shell for working with the
@ -232,7 +229,7 @@
inherit system localSystem crossSystem;
pkgs = self.legacyPackages.${system};
} // {
ports = nixpkgsFor.${localSystem}.symlinkJoin {
ports = self.legacyPackages.${localSystem}.symlinkJoin {
name = "ports";
paths = (builtins.attrValues
self.packages.${system}.genodeSources.ports);