Skip to content

Commit 126a229

Browse files
authored
nix: move to hyprland-qt-support (#25)
1 parent d870718 commit 126a229

File tree

5 files changed

+69
-16
lines changed

5 files changed

+69
-16
lines changed

flake.lock

+30-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+9-8
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
inputs.nixpkgs.follows = "nixpkgs";
1111
inputs.systems.follows = "systems";
1212
};
13+
14+
hyprland-qt-support = {
15+
url = "github:hyprwm/hyprland-qt-support";
16+
inputs.nixpkgs.follows = "nixpkgs";
17+
inputs.systems.follows = "systems";
18+
};
1319
};
1420

1521
outputs = {
@@ -36,14 +42,9 @@
3642
});
3743

3844
devShells = eachSystem (system: {
39-
default = pkgsFor.${system}.mkShell {
40-
inputsFrom = [self.packages.${system}.hyprpolkitagent];
41-
42-
shellHook = ''
43-
# Generate compile_commands.json
44-
CMAKE_EXPORT_COMPILE_COMMANDS=1 cmake -S . -B ./build
45-
ln -s build/compile_commands.json .
46-
'';
45+
default = import ./nix/shell.nix {
46+
pkgs = pkgsFor.${system};
47+
inherit (pkgsFor.${system}) hyprpolkitagent;
4748
};
4849
});
4950
};

nix/default.nix

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
cmake,
55
pkg-config,
66
hyprutils,
7+
hyprland-qt-support,
78
kdePackages,
89
polkit,
910
qt6,
@@ -32,9 +33,9 @@ in
3233

3334
buildInputs = [
3435
hyprutils
35-
kdePackages.kirigami-addons
36-
kdePackages.polkit-qt-1
36+
hyprland-qt-support
3737
polkit
38+
kdePackages.polkit-qt-1
3839
qt6.qtbase
3940
qt6.qtsvg
4041
qt6.qtwayland

nix/overlays.nix

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ in {
1515

1616
hyprpolkitagent = lib.composeManyExtensions [
1717
inputs.hyprutils.overlays.default
18+
inputs.hyprland-qt-support.overlays.default
1819
(final: prev: {
1920
hyprpolkitagent = final.callPackage ./. {
2021
stdenv = final.gcc14Stdenv;

nix/shell.nix

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
pkgs ? import <nixpkgs> {},
3+
hyprpolkitagent ? pkgs.callPackage ./default.nix {},
4+
...
5+
}: pkgs.mkShell {
6+
inputsFrom = [ hyprpolkitagent ];
7+
nativeBuildInputs = [ pkgs.clang-tools ];
8+
9+
shellHook = let
10+
inherit (pkgs.lib.strings) concatMapStringsSep;
11+
qtLibPath = f: concatMapStringsSep ":" f (with pkgs.qt6; [
12+
qtbase
13+
qtdeclarative
14+
qtwayland
15+
pkgs.hyprland-qt-support
16+
]);
17+
in ''
18+
# Add Qt-related environment variables.
19+
export QT_PLUGIN_PATH=${qtLibPath (p: "${p}/lib/qt-6/plugins")}
20+
export QML2_IMPORT_PATH=${qtLibPath (p: "${p}/lib/qt-6/qml")}
21+
22+
# Generate compile_commands.json
23+
CMAKE_EXPORT_COMPILE_COMMANDS=1 cmake -S . -B ./build
24+
ln -s build/compile_commands.json .
25+
'';
26+
}

0 commit comments

Comments
 (0)