1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-17 13:10:29 +03:00

Merge pull request #257 from noneucat/patch-1

Fix attribute 'selectBySystem' missing
This commit is contained in:
Samuel Dionne-Riel 2020-12-25 14:02:15 -05:00 committed by GitHub
commit 194384cc6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,32 +5,18 @@ let
cfg = config.mobile.system;
inherit (config.nixpkgs) localSystem;
# Mapping from system types to config types
# A simplified view of <nixpkgs/lib/systems/examples.nix>
config_types = {
aarch64-linux = "aarch64-unknown-linux-gnu";
armv7l-linux = "armv7l-unknown-linux-gnueabihf";
x86_64-linux = "x86_64-unknown-linux-gnu";
};
# Derived from config_types
target_types = lib.attrNames config_types;
# Builds the expected "platform" set for cross-compilation from the given
# system name.
selectPlatform = system: {
inherit system;
platform = lib.systems.platforms.selectBySystem system;
config = config_types.${system};
};
# The platform selected by the configuration
selectedPlatform = selectPlatform cfg.system;
selectedPlatform = lib.systems.elaborate cfg.system;
in
{
options.mobile = {
system.system = mkOption {
type = types.enum target_types;
# Known supported target types for Mobile NixOS
type = types.enum [
"aarch64-linux"
"armv7l-linux"
"x86_64-linux"
];
description = ''
Defines the kind of target architecture system the device is.