From a5c6c6a63ac848d8a7d44b8c42d055bcf84b63d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Gro=C3=9F?= Date: Sun, 17 Mar 2024 16:06:04 +0100 Subject: [PATCH] nix: Deduplicate eachSystem Also bump quartz version. --- CMakeLists.txt | 2 +- flake.lock | 6 +++--- flake.nix | 52 +++++++++++++++++++++++++++----------------------- 3 files changed, 32 insertions(+), 28 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 257fa4d..65eb90f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}) diff --git a/flake.lock b/flake.lock index 63e6cbe..c62d2cc 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1704722960, - "narHash": "sha256-mKGJ3sPsT6//s+Knglai5YflJUF2DGj7Ai6Ynopz0kI=", + "lastModified": 1710451336, + "narHash": "sha256-pP86Pcfu3BrAvRO7R64x7hs+GaQrjFes+mEPowCfkxY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "317484b1ead87b9c1b8ac5261a8d2dd748a0492d", + "rev": "d691274a972b3165335d261cc4671335f5c67de9", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 3a35848..e03956f 100644 --- a/flake.nix +++ b/flake.nix @@ -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"; + }; + }; + } + ); }