Skip to content

Commit

Permalink
core: use hyprutils and std again
Browse files Browse the repository at this point in the history
  • Loading branch information
outfoxxed committed Oct 15, 2024
1 parent 6738e7d commit ff647a2
Show file tree
Hide file tree
Showing 10 changed files with 170 additions and 172 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ string(STRIP ${VER_RAW} VER)

project(hsi VERSION ${VER} LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(Qt6 6.5 REQUIRED COMPONENTS Widgets Quick QuickControls2)
set(CMAKE_CXX_STANDARD 20)
find_package(PkgConfig REQUIRED)

pkg_check_modules(hyprutils REQUIRED IMPORTED_TARGET hyprutils)

qt_standard_project_setup(REQUIRES 6.5)

Expand Down
24 changes: 24 additions & 0 deletions flake.lock

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

17 changes: 9 additions & 8 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/default-linux";

hyprutils = {
url = "github:hyprwm/hyprutils";
inputs.nixpkgs.follows = "nixpkgs";
inputs.systems.follows = "systems";
};
};

outputs = {
Expand All @@ -30,14 +36,9 @@
});

devShells = eachSystem (system: {
default = pkgsFor.${system}.mkShell {
inputsFrom = [self.packages.${system}.hyprsysteminfo];

shellHook = ''
# Generate compile_commands.json
CMAKE_EXPORT_COMPILE_COMMANDS=1 cmake -S . -B ./build
ln -s build/compile_commands.json .
'';
default = import ./nix/shell.nix {
pkgs = pkgsFor.${system};
inherit (pkgsFor.${system}) hyprsysteminfo;
};
});
};
Expand Down
4 changes: 4 additions & 0 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
kdePackages,
pciutils,
qt6,
pkg-config,
hyprutils,
version ? "0",
}: let
inherit (lib.sources) cleanSource cleanSourceWith;
Expand All @@ -24,6 +26,7 @@ in

nativeBuildInputs = [
cmake
pkg-config
qt6.wrapQtAppsHook
];

Expand All @@ -32,6 +35,7 @@ in
qt6.qtbase
qt6.qtsvg
qt6.qtwayland
hyprutils
];

preFixup = ''
Expand Down
1 change: 1 addition & 0 deletions nix/overlays.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ in {
default = self.overlays.hyprsysteminfo;

hyprsysteminfo = lib.composeManyExtensions [
inputs.hyprutils.overlays.default
(final: prev: {
hyprsysteminfo = final.callPackage ./. {
version = "${version}+date=${date}_${self.shortRev or "dirty"}";
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ qt_add_qml_module(hyprsysteminfo
QML_FILES main.qml
)

target_link_libraries(hyprsysteminfo PRIVATE Qt6::Widgets Qt6::QuickControls2)
target_link_libraries(hyprsysteminfo PRIVATE Qt6::Widgets Qt6::QuickControls2 PkgConfig::hyprutils)
Loading

0 comments on commit ff647a2

Please sign in to comment.