From 635b7625690d9f8f61da0a187e7ed4a7ec274fdc Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 4 Jun 2019 11:10:03 -0400 Subject: systems: allow passing in string for cross/localSystem MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes things a little bit more convenient. Just pass in like: $ nix-build ’’ -A hello --argstr localSystem x86_64-linux --argstr crossSystem aarch64-linux --- lib/systems/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/systems') diff --git a/lib/systems/default.nix b/lib/systems/default.nix index ea18904cc63..8aa413f5381 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -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); -- cgit 1.4.1