systems: allow passing in string for cross/localSystem
This makes things a little bit more convenient. Just pass in like: $ nix-build ’<nixpkgs>’ -A hello --argstr localSystem x86_64-linux --argstr crossSystem aarch64-linux
This commit is contained in:
@@ -14,7 +14,9 @@ rec {
|
||||
# `parsed` is inferred from args, both because there are two options with one
|
||||
# clearly prefered, and to prevent cycles. A simpler fixed point where the RHS
|
||||
# always just used `final.*` would fail on both counts.
|
||||
elaborate = args: let
|
||||
elaborate = args': let
|
||||
args = if lib.isString args' then { system = args'; }
|
||||
else args';
|
||||
final = {
|
||||
# Prefer to parse `config` as it is strictly more informative.
|
||||
parsed = parse.mkSystemFromString (if args ? config then args.config else args.system);
|
||||
|
||||
Reference in New Issue
Block a user