Sridhar Ratnakumar
Sridhar Ratnakumar

Reputation: 85502

Retrieving the list of supported systems in Nix

What is the canonical way (by way of writing Nix expressions) to retrieve the list of systems that Nix can build a derivation for on a given system?

My current approach is:

    let
      extra-systems =
        if lib.hasAttr "extra-platforms" config.nix.settings
        then lib.strings.splitString " " config.nix.settings.extra-platforms
        else [ ];
      host-system = config.nixpkgs.hostPlatform.system;
    in
    lib.unique ([ host-system ] ++ extra-systems);

But I'm not sure if I'm missing something.

Upvotes: 0

Views: 98

Answers (0)

Related Questions