lib: Collect system/platform related files

Previously, platforms was a random thing in top-level
This commit is contained in:
John Ericson 2017-02-08 21:27:22 -05:00
parent b477851f34
commit 2227789392
8 changed files with 18 additions and 12 deletions

View File

@ -22,8 +22,7 @@ let
# constants
licenses = import ./licenses.nix;
platforms = import ./platforms.nix;
systems = import ./systems.nix;
systems = import ./systems;
# misc
debug = import ./debug.nix;
@ -42,13 +41,15 @@ in
attrsets lists strings stringsWithDeps
customisation maintainers meta sources
modules options types
licenses platforms systems
licenses systems
debug generators misc
sandbox fetchers filesystem;
# back-compat aliases
platforms = systems.doubles;
}
# !!! don't include everything at top-level; perhaps only the most
# commonly used functions.
// trivial // lists // strings // stringsWithDeps // attrsets // sources
// options // types // meta // debug // misc // modules
// systems
// customisation

5
lib/systems/default.nix Normal file
View File

@ -0,0 +1,5 @@
rec {
doubles = import ./doubles.nix;
parse = import ./parse.nix;
platforms = import ./platforms.nix;
}

View File

@ -1,4 +1,4 @@
let lists = import ./lists.nix; in
let lists = import ../lists.nix; in
rec {
all = linux ++ darwin ++ cygwin ++ freebsd ++ openbsd ++ netbsd ++ illumos;

View File

@ -1,9 +1,9 @@
# Define the list of system with their properties. Only systems tested for
# Nixpkgs are listed below
with import ./lists.nix;
with import ./types.nix;
with import ./attrsets.nix;
with import ../lists.nix;
with import ../types.nix;
with import ../attrsets.nix;
let
lib = import ./default.nix;

View File

@ -303,7 +303,7 @@ with pkgs;
composableDerivation = callPackage ../../lib/composable-derivation.nix { };
platforms = import ./platforms.nix;
inherit (lib.systems) platforms;
setJavaClassPath = makeSetupHook { } ../build-support/setup-hooks/set-java-classpath.sh;

View File

@ -55,7 +55,7 @@ in let
# Allow setting the platform in the config file. Otherwise, let's use a
# reasonable default.
localSystem =
{ platform = (import ./platforms.nix).selectPlatformBySystem args.localSystem.system; }
{ platform = lib.systems.platforms.selectPlatformBySystem args.localSystem.system; }
// builtins.intersectAttrs { platform = null; } config
// args.localSystem;

View File

@ -136,7 +136,7 @@ in
float = "hard";
withTLS = true;
libc = "glibc";
platform = pkgs.platforms.fuloong2f_n32;
platform = lib.platforms.fuloong2f_n32;
openssl.system = "linux-generic32";
gcc = {
arch = "loongson2f";
@ -160,7 +160,7 @@ in
fpu = "vfp";
withTLS = true;
libc = "glibc";
platform = pkgs.platforms.raspberrypi;
platform = lib.platforms.raspberrypi;
openssl.system = "linux-generic32";
gcc = {
arch = "armv6";