Simplify flake.nix
This commit is contained in:
parent
165cf60551
commit
73c8b62645
47
flake.nix
47
flake.nix
|
@ -35,23 +35,6 @@
|
||||||
crossSystem = system;
|
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 {
|
in rec {
|
||||||
|
|
||||||
overlay =
|
overlay =
|
||||||
|
@ -164,19 +147,33 @@
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
legacyPackages =
|
/* The nixpkgs.legacyPackages after overlaying
|
||||||
# The nixpkgs.legacyPackages after overlaying
|
and with some additional Genode packages.
|
||||||
# and with some additional Genode packages
|
*/
|
||||||
forAllSystems
|
legacyPackages = let f = import nixpkgs;
|
||||||
({ system, localSystem, crossSystem }: nixpkgsFor.${system});
|
in forAllSystems ({ system, localSystem, crossSystem }:
|
||||||
# pass thru Nixpkgs
|
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 =
|
packages =
|
||||||
# Genode native packages, not packages in the traditional
|
# Genode native packages, not packages in the traditional
|
||||||
# sense in that these cannot be installed within a profile
|
# sense in that these cannot be installed within a profile
|
||||||
forAllCrossSystems ({ system, localSystem, crossSystem }:
|
forAllCrossSystems ({ system, localSystem, crossSystem }:
|
||||||
nixpkgs.lib.filterAttrs (n: v: v != null)
|
nixpkgs.lib.filterAttrs (n: v: v != null)
|
||||||
nixpkgsFor.${system}.genodePackages);
|
self.legacyPackages.${system}.genodePackages);
|
||||||
|
|
||||||
devShell =
|
devShell =
|
||||||
# Development shell for working with the
|
# Development shell for working with the
|
||||||
|
@ -232,7 +229,7 @@
|
||||||
inherit system localSystem crossSystem;
|
inherit system localSystem crossSystem;
|
||||||
pkgs = self.legacyPackages.${system};
|
pkgs = self.legacyPackages.${system};
|
||||||
} // {
|
} // {
|
||||||
ports = nixpkgsFor.${localSystem}.symlinkJoin {
|
ports = self.legacyPackages.${localSystem}.symlinkJoin {
|
||||||
name = "ports";
|
name = "ports";
|
||||||
paths = (builtins.attrValues
|
paths = (builtins.attrValues
|
||||||
self.packages.${system}.genodeSources.ports);
|
self.packages.${system}.genodeSources.ports);
|
||||||
|
|
Loading…
Reference in New Issue