Skip to content

Commit

Permalink
nix: move to hyprland-qt-support (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
outfoxxed authored Jan 8, 2025
1 parent 196e043 commit 8c9483a
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 6 deletions.
36 changes: 30 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
inputs.nixpkgs.follows = "nixpkgs";
inputs.systems.follows = "systems";
};

hyprland-qt-support = {
url = "github:hyprwm/hyprland-qt-support";
inputs.nixpkgs.follows = "nixpkgs";
inputs.systems.follows = "systems";
};
};

outputs = {
Expand All @@ -34,5 +40,12 @@
default = self.packages.${system}.hyprland-qtutils;
inherit (pkgsFor.${system}) hyprland-qtutils;
});

devShells = eachSystem (system: {
default = import ./nix/shell.nix {
pkgs = pkgsFor.${system};
inherit (pkgsFor.${system}) hyprland-qtutils;
};
});
};
}
2 changes: 2 additions & 0 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
cmake,
pkg-config,
hyprutils,
hyprland-qt-support,
pciutils,
qt6,
version ? "0",
Expand Down Expand Up @@ -31,6 +32,7 @@ in

buildInputs = [
hyprutils
hyprland-qt-support
qt6.qtbase
qt6.qtsvg
qt6.qtwayland
Expand Down
1 change: 1 addition & 0 deletions nix/overlays.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ in {

hyprland-qtutils = lib.composeManyExtensions [
inputs.hyprutils.overlays.default
inputs.hyprland-qt-support.overlays.default
(final: prev: {
hyprland-qtutils = final.callPackage ./. {
stdenv = final.gcc14Stdenv;
Expand Down
26 changes: 26 additions & 0 deletions nix/shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
pkgs ? import <nixpkgs> {},
hyprland-qtutils ? pkgs.callPackage ./default.nix {},
...
}: pkgs.mkShell {
inputsFrom = [ hyprland-qtutils ];
nativeBuildInputs = [ pkgs.clang-tools pkgs.pciutils ];

shellHook = let
inherit (pkgs.lib.strings) concatMapStringsSep;
qtLibPath = f: concatMapStringsSep ":" f (with pkgs.qt6; [
qtbase
qtdeclarative
qtwayland
pkgs.hyprland-qt-support
]);
in ''
# Add Qt-related environment variables.
export QT_PLUGIN_PATH=${qtLibPath (p: "${p}/lib/qt-6/plugins")}
export QML2_IMPORT_PATH=${qtLibPath (p: "${p}/lib/qt-6/qml")}
# Generate compile_commands.json
CMAKE_EXPORT_COMPILE_COMMANDS=1 cmake -S . -B ./build
ln -s build/compile_commands.json .
'';
}

0 comments on commit 8c9483a

Please sign in to comment.