From 0e0894c37d398c9c0fe8bf52815c7cef127ac583 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 16 Oct 2018 21:48:43 -0500 Subject: [PATCH] lib/systems: add uname attrs --- lib/systems/default.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/systems/default.nix b/lib/systems/default.nix index 5eacc9eb23e1..6c6ce5c6ef62 100644 --- a/lib/systems/default.nix +++ b/lib/systems/default.nix @@ -46,6 +46,24 @@ rec { # Misc boolean options useAndroidPrebuilt = false; useiOSPrebuilt = false; + + # Output from uname + uname = { + # uname -s + system = if final.isLinux then "Linux" + else if final.isDarwin then "Darwin" + else if final.isWindows then "Windows" + else if final.isFreeBSD then "FreeBSD" + else if final.isNetBSD then "NetBSD" + else if final.isOpenBSD then "OpenBSD" + else null; + + # uname -p + processor = final.parsed.cpu.name; + + # uname -r + release = null; + }; } // mapAttrs (n: v: v final.parsed) inspect.predicates // args; in assert final.useAndroidPrebuilt -> final.isAndroid;