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

37 lines
968 B
Nix

{ stdenv, pkgs, target-os }:
with pkgs;
with stdenv;
let
targetLinux = {
"linux" = true;
"" = true;
}.${target-os} or false;
targetWindows = {
"windows" = true;
"" = true;
}.${target-os} or false;
windowsPlatform = callPackage ./windows { };
appimagekit = callPackage ./appimagekit { };
linuxdeployqt = callPackage ./linuxdeployqt { inherit appimagekit; };
in
{
buildInputs = [
cmake
extra-cmake-modules
file
gnupg # Used by appimagetool
go
] ++ lib.optional targetLinux [ appimagekit linuxdeployqt patchelf ]
++ 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
'');
}