Skip to content

Instantly share code, notes, and snippets.

@prithvihv
Created May 30, 2021 12:58
Show Gist options
  • Save prithvihv/45b3f8dbbe7bbd54350600cc7a0c23c3 to your computer and use it in GitHub Desktop.
Save prithvihv/45b3f8dbbe7bbd54350600cc7a0c23c3 to your computer and use it in GitHub Desktop.
let
pathToFile = if pkgs.stdenv.isLinux then
"./location1"
else
"./location2";
someFile = import pathToFile;
in rec {
somePkgsWithPlatformSupport = someFile;
}
# General recommendation for problems like this is to have a different main Nix file for each platform that just imports a Nix file containing the common code.
# (phv) Or have a nix file that imports all platform specific software.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment