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 # constants
licenses = import ./licenses.nix; licenses = import ./licenses.nix;
platforms = import ./platforms.nix; systems = import ./systems;
systems = import ./systems.nix;
# misc # misc
debug = import ./debug.nix; debug = import ./debug.nix;
@ -42,13 +41,15 @@ in
attrsets lists strings stringsWithDeps attrsets lists strings stringsWithDeps
customisation maintainers meta sources customisation maintainers meta sources
modules options types modules options types
licenses platforms systems licenses systems
debug generators misc debug generators misc
sandbox fetchers filesystem; sandbox fetchers filesystem;
# back-compat aliases
platforms = systems.doubles;
} }
# !!! don't include everything at top-level; perhaps only the most # !!! don't include everything at top-level; perhaps only the most
# commonly used functions. # commonly used functions.
// trivial // lists // strings // stringsWithDeps // attrsets // sources // trivial // lists // strings // stringsWithDeps // attrsets // sources
// options // types // meta // debug // misc // modules // options // types // meta // debug // misc // modules
// systems
// customisation // 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 { rec {
all = linux ++ darwin ++ cygwin ++ freebsd ++ openbsd ++ netbsd ++ illumos; 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 # Define the list of system with their properties. Only systems tested for
# Nixpkgs are listed below # Nixpkgs are listed below
with import ./lists.nix; with import ../lists.nix;
with import ./types.nix; with import ../types.nix;
with import ./attrsets.nix; with import ../attrsets.nix;
let let
lib = import ./default.nix; lib = import ./default.nix;

View File

@ -303,7 +303,7 @@ with pkgs;
composableDerivation = callPackage ../../lib/composable-derivation.nix { }; composableDerivation = callPackage ../../lib/composable-derivation.nix { };
platforms = import ./platforms.nix; inherit (lib.systems) platforms;
setJavaClassPath = makeSetupHook { } ../build-support/setup-hooks/set-java-classpath.sh; 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 # Allow setting the platform in the config file. Otherwise, let's use a
# reasonable default. # reasonable default.
localSystem = localSystem =
{ platform = (import ./platforms.nix).selectPlatformBySystem args.localSystem.system; } { platform = lib.systems.platforms.selectPlatformBySystem args.localSystem.system; }
// builtins.intersectAttrs { platform = null; } config // builtins.intersectAttrs { platform = null; } config
// args.localSystem; // args.localSystem;

View File

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