status-mobile/scripts/lib/setup/nix/desktop/default.nix

43 lines
1.0 KiB
Nix

{ stdenv, pkgs, target-os }:
with pkgs;
with stdenv;
let
targetLinux = {
"linux" = true;
"" = isLinux;
}.${target-os} or false;
targetDarwin = {
"macos" = true;
"" = isDarwin;
}.${target-os} or false;
targetWindows = {
"windows" = true;
"" = isLinux;
}.${target-os} or false;
linuxPlatform = callPackage ./linux { };
darwinPlatform = callPackage ./macos { };
windowsPlatform = callPackage ./windows { };
in
{
buildInputs = [
cmake
extra-cmake-modules
file
go
] ++ lib.optional targetLinux linuxPlatform.buildInputs
++ lib.optional targetDarwin darwinPlatform.buildInputs
++ lib.optional (! targetWindows) qt5.full
++ lib.optional targetWindows windowsPlatform.buildInputs;
shellHook = (if target-os == "windows" then ''
unset QT_PATH
'' else ''
export QT_PATH="${qt5.full}"
export PATH="${stdenv.lib.makeBinPath [ qt5.full ]}:$PATH"
'') + (lib.optionalString isDarwin ''
export MACOSX_DEPLOYMENT_TARGET=10.9
'');
}