-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
58 lines (52 loc) · 1.58 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
49
50
51
52
53
54
55
56
57
58
# run with: nix develop
# see metadata with: nix flake metadata
# debug with: nix repl
# :lf .#
# check with: nix flake check
# If you want to update a locked input to the latest version, you need to ask
# for it: nix flake lock --update-input nixpkgs
# show available packages: nix-env -qa
# nix search nixpkgs
# show nixos version: nixos-version
#
{
description = "C++ Development with Nix 24.05";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
};
outputs = { self, nixpkgs }: {
devShells = {
x86_64-linux.default = self.buildDevShell "x86_64-linux";
aarch64-linux.default = self.buildDevShell "aarch64-linux";
x86_64-darwin.default = self.buildDevShell "x86_64-darwin";
};
} // {
buildDevShell = system: let
pkgs = import nixpkgs {
inherit system;
config = {
qt.enable = true; # Enable Qt configuration globally
};
};
in
pkgs.mkShell {
nativeBuildInputs = with pkgs; [
cmake
pkg-config
qt6.qttools
qt6.wrapQtAppsHook
qt6.qtwayland
gdb
makeWrapper
bashInteractive
];
QT_PLUGIN_PATH = "${pkgs.qt6.qtgraphs}/lib";
# # set the environment variables that Qt apps expect
shellHook = ''
bashdir=$(mktemp -d)
makeWrapper "$(type -p bash)" "$bashdir/bash" "''${qtWrapperArgs[@]}"
exec "$bashdir/bash"
'';
};
};
}