Commit 45cc6e2a authored by Matthew Bauer's avatar Matthew Bauer
Browse files

lib/systems: use lookup for uname.system

This is a little bit cleaner and avoids the if ... else if ... chain.
parent e3de8a92
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -50,13 +50,14 @@ rec {
      # 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;
        system = {
          "linux" = "Linux";
          "windows" = "Windows";
          "darwin" = "Darwin";
          "netbsd" = "NetBSD";
          "freebsd" = "FreeBSD";
          "openbsd" = "OpenBSD";
        }.${final.parsed.kernel.name} or null;

         # uname -p
         processor = final.parsed.cpu.name;