diff --git a/flake.lock b/flake.lock index fcbe262..5702552 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,28 @@ { "nodes": { + "hyprland-qt-support": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "systems": [ + "systems" + ] + }, + "locked": { + "lastModified": 1736376766, + "narHash": "sha256-tZG+mkJJzqoi/gH8nN6P/yY1/PEYtom9+2WdYKKv5YM=", + "owner": "hyprwm", + "repo": "hyprland-qt-support", + "rev": "0ecf224f213497c45b12c4dc7bdc2c2edd0e3084", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-qt-support", + "type": "github" + } + }, "hyprutils": { "inputs": { "nixpkgs": [ @@ -10,11 +33,11 @@ ] }, "locked": { - "lastModified": 1734796073, - "narHash": "sha256-TnuKsa8OHrSJEmHm3TLGOWbPNA1gRjmZLsRzKrCqOsg=", + "lastModified": 1736164519, + "narHash": "sha256-1LimBKvDpBbeX+qW7T240WEyw+DBVpDotZB4JYm8Aps=", "owner": "hyprwm", "repo": "hyprutils", - "rev": "c3331116ebd0b71df5ae8c6efe9a7f94148b03bf", + "rev": "3c895da64b0eb19870142196fa48c07090b441c4", "type": "github" }, "original": { @@ -25,11 +48,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1734649271, - "narHash": "sha256-4EVBRhOjMDuGtMaofAIqzJbg4Ql7Ai0PSeuVZTHjyKQ=", + "lastModified": 1736012469, + "narHash": "sha256-/qlNWm/IEVVH7GfgAIyP6EsVZI6zjAx1cV5zNyrs+rI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d70bd19e0a38ad4790d3913bf08fcbfc9eeca507", + "rev": "8f3e1f807051e32d8c95cd12b9b421623850a34d", "type": "github" }, "original": { @@ -41,6 +64,7 @@ }, "root": { "inputs": { + "hyprland-qt-support": "hyprland-qt-support", "hyprutils": "hyprutils", "nixpkgs": "nixpkgs", "systems": "systems" diff --git a/flake.nix b/flake.nix index 13e6d17..f944bf3 100644 --- a/flake.nix +++ b/flake.nix @@ -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 = { @@ -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; + }; + }); }; } diff --git a/nix/default.nix b/nix/default.nix index 8686474..cf7b43c 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -4,6 +4,7 @@ cmake, pkg-config, hyprutils, + hyprland-qt-support, pciutils, qt6, version ? "0", @@ -31,6 +32,7 @@ in buildInputs = [ hyprutils + hyprland-qt-support qt6.qtbase qt6.qtsvg qt6.qtwayland diff --git a/nix/overlays.nix b/nix/overlays.nix index cff7bd9..c575654 100644 --- a/nix/overlays.nix +++ b/nix/overlays.nix @@ -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; diff --git a/nix/shell.nix b/nix/shell.nix new file mode 100644 index 0000000..a3bb46f --- /dev/null +++ b/nix/shell.nix @@ -0,0 +1,26 @@ +{ + pkgs ? import {}, + 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 . + ''; +}