Skip to content

Commit

Permalink
feat(build): add nix-shell support
Browse files Browse the repository at this point in the history
Add a metadata file and build rules to build and test from a development
shell provided by the Nix package manager.
  • Loading branch information
ehmry committed Dec 16, 2019
1 parent f252816 commit faeb699
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ qtox
build-*-Release
build-*-Profile
build-*-Debug
.qtox-wrapped

# Folders
_[Bb]uild*/
Expand Down
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -714,3 +714,12 @@ target_link_libraries(${PROJECT_NAME}

include(Testing)
include(Installation)

if (DEFINED ENV{IN_NIX_SHELL})
# the qtox binary must be "wrapped" to find the Qt platform plugin
# and other dependencies at runtime
add_custom_command(
TARGET ${PROJECT_NAME}
POST_BUILD
COMMAND nix-shell --run "wrapQtApp ${PROJECT_NAME}")
endif()
2 changes: 2 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{ pkgs ? import <nixpkgs> { } }:
pkgs.mkShell { inputsFrom = with pkgs; [ qtox ]; }

0 comments on commit faeb699

Please sign in to comment.