-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
48 lines (45 loc) · 1.36 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{
description = "Flake for building a Qt GUI program";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
};
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
coreLib = pkgs.callPackage ./src/core/default.nix {};
guiApp = pkgs.callPackage ./src/GUI/default.nix {
inherit coreLib;
};
in{
apps.${system}.default = {
type = "app";
program = "${guiApp}/bin/gui_program";
};
packages.${system}.default = pkgs.buildEnv {
name = "combinedEnv";
paths = [ guiApp ]; # Include the packages in the environment
};
devShells.${system}.default = pkgs.mkShell {
buildInputs = [
pkgs.qt5.qtbase
pkgs.qt5.qtquickcontrols2
pkgs.qt5.qtquickcontrols
pkgs.qt5.wrapQtAppsHook
pkgs.gdb
pkgs.bashInteractive
pkgs.makeWrapper
# Add other required Qt modules here
coreLib
#guiApp
];
nativeBuildInputs = [ pkgs.qt5.wrapQtAppsHook ];
shellHook = ''
export CMAKE_PREFIX_PATH="${pkgs.qt5.qtbase}/lib/cmake/Qt5:$CMAKE_PREFIX_PATH"
bashdir=$(mktemp -d)
makeWrapper "$(type -p bash)" "$bashdir/bash" "''${qtWrapperArgs[@]}"
exec "$bashdir/bash"
'';
};
};
}