Skip to content

Commit

Permalink
nix: Deduplicate eachSystem
Browse files Browse the repository at this point in the history
Also bump quartz version.
  • Loading branch information
vimpostor committed Mar 17, 2024
1 parent fefa7fb commit a5c6c6a
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 28 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ qt_add_executable(${PROJECT_NAME} ${SRCS} ${RESOURCES})
qt_add_qml_module(${PROJECT_NAME} URI "Backend" VERSION 1.0 NO_RESOURCE_TARGET_PATH QML_FILES ${QMLS} SOURCES "src/backend.cpp")

include(FetchContent)
FetchContent_Declare(quartz GIT_REPOSITORY https://github.com/vimpostor/quartz.git GIT_TAG c67c8dc15dcf25573d2b70378f4fd22a65593939)
FetchContent_Declare(quartz GIT_REPOSITORY https://github.com/vimpostor/quartz.git GIT_TAG v0.4)
FetchContent_MakeAvailable(quartz)

target_link_libraries(${PROJECT_NAME} PRIVATE ${QT_PREFIXED_MODULES})
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

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

52 changes: 28 additions & 24 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,41 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};

outputs = { self, nixpkgs }: {
packages = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed (system:
outputs = { self, nixpkgs }:
let eachSystem = with nixpkgs.lib; f: foldAttrs mergeAttrs {} (map (s: mapAttrs (_: v: { ${s} = v; }) (f s)) systems.flakeExposed);
in eachSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
quartz = pkgs.fetchFromGitHub {
owner = "vimpostor";
repo = "quartz";
rev = builtins.head (builtins.match ".*FetchContent_Declare\\(.*GIT_TAG ([[:alnum:]\\.]+).*" (builtins.readFile ./CMakeLists.txt));
hash = "sha256-sbOoYO87NRF3J3FOnCAM40BtXPtdfyYPPfiNgK3q56o=";
hash = "sha256-gni+5kQkjU1LhoEK6/yVC0x6K36Ra30xM47w893nGJ4=";
};
in {
default = pkgs.stdenv.mkDerivation {
pname = "quickcurver";
version = "0.1";
in
{
packages = {
default = pkgs.stdenv.mkDerivation {
pname = "quickcurver";
version = "0.1";

src = ./.;
src = ./.;

nativeBuildInputs = with pkgs; [
cmake
pkg-config
qt6.wrapQtAppsHook
imagemagick
];
buildInputs = with pkgs; [
qt6.qtbase
qt6.qtdeclarative
qt6.qtsvg
];
cmakeFlags = [("-DFETCHCONTENT_SOURCE_DIR_QUARTZ=" + quartz)];
postBuild = "make linux-desktop-integration";
};
});
};
nativeBuildInputs = with pkgs; [
cmake
pkg-config
qt6.wrapQtAppsHook
imagemagick
];
buildInputs = with pkgs; [
qt6.qtbase
qt6.qtdeclarative
qt6.qtsvg
];
cmakeFlags = [("-DFETCHCONTENT_SOURCE_DIR_QUARTZ=" + quartz)];
postBuild = "make linux-desktop-integration";
};
};
}
);
}

0 comments on commit a5c6c6a

Please sign in to comment.