2024-03-04 13:04:29 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
nix-gitignore,
|
|
|
|
pkgs,
|
|
|
|
keepDebugInfo,
|
2024-03-12 01:18:55 +00:00
|
|
|
buildStdenv ? pkgs.clang17Stdenv,
|
2024-03-04 13:04:29 +00:00
|
|
|
|
|
|
|
cmake,
|
|
|
|
ninja,
|
|
|
|
qt6,
|
2024-05-31 08:28:35 +00:00
|
|
|
jemalloc,
|
2024-03-04 13:04:29 +00:00
|
|
|
wayland,
|
|
|
|
wayland-protocols,
|
2024-05-20 09:16:44 +00:00
|
|
|
xorg,
|
|
|
|
pipewire,
|
2024-03-04 13:04:29 +00:00
|
|
|
|
2024-03-09 07:08:50 +00:00
|
|
|
gitRev ? (let
|
|
|
|
headExists = builtins.pathExists ./.git/HEAD;
|
|
|
|
headContent = builtins.readFile ./.git/HEAD;
|
|
|
|
in if headExists
|
|
|
|
then (let
|
|
|
|
matches = builtins.match "ref: refs/heads/(.*)\n" headContent;
|
|
|
|
in if matches != null
|
|
|
|
then builtins.readFile ./.git/refs/heads/${builtins.elemAt matches 0}
|
|
|
|
else headContent)
|
|
|
|
else "unknown"),
|
2024-03-27 07:44:13 +00:00
|
|
|
|
2024-03-04 13:04:29 +00:00
|
|
|
debug ? false,
|
2024-05-31 08:28:35 +00:00
|
|
|
withJemalloc ? true, # masks heap fragmentation
|
2024-06-02 22:37:47 +00:00
|
|
|
withQtSvg ? true,
|
|
|
|
withWayland ? true,
|
|
|
|
withX11 ? true,
|
|
|
|
withPipewire ? true,
|
|
|
|
withHyprland ? true,
|
2024-03-12 01:18:55 +00:00
|
|
|
}: buildStdenv.mkDerivation {
|
2024-03-04 13:04:29 +00:00
|
|
|
pname = "quickshell${lib.optionalString debug "-debug"}";
|
2024-03-04 13:49:37 +00:00
|
|
|
version = "0.1.0";
|
2024-03-10 10:02:40 +00:00
|
|
|
src = nix-gitignore.gitignoreSource "/docs\n/examples\n" ./.;
|
2024-03-04 13:04:29 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
|
|
cmake
|
|
|
|
ninja
|
|
|
|
qt6.wrapQtAppsHook
|
|
|
|
pkg-config
|
2024-06-02 22:37:47 +00:00
|
|
|
] ++ (lib.optionals withWayland [
|
2024-03-04 13:04:29 +00:00
|
|
|
wayland-protocols
|
|
|
|
wayland-scanner
|
|
|
|
]);
|
|
|
|
|
2024-05-20 09:16:44 +00:00
|
|
|
buildInputs = [
|
2024-03-04 13:04:29 +00:00
|
|
|
qt6.qtbase
|
|
|
|
qt6.qtdeclarative
|
2024-04-19 09:46:38 +00:00
|
|
|
]
|
2024-05-31 08:28:35 +00:00
|
|
|
++ (lib.optional withJemalloc jemalloc)
|
|
|
|
++ (lib.optional withQtSvg qt6.qtsvg)
|
2024-06-02 22:37:47 +00:00
|
|
|
++ (lib.optionals withWayland [ qt6.qtwayland wayland ])
|
|
|
|
++ (lib.optional withX11 xorg.libxcb)
|
|
|
|
++ (lib.optional withPipewire pipewire);
|
2024-03-04 13:04:29 +00:00
|
|
|
|
2024-06-02 22:37:47 +00:00
|
|
|
QTWAYLANDSCANNER = lib.optionalString withWayland "${qt6.qtwayland}/libexec/qtwaylandscanner";
|
2024-03-04 13:04:29 +00:00
|
|
|
|
|
|
|
configurePhase = let
|
|
|
|
cmakeBuildType = if debug
|
|
|
|
then "Debug"
|
|
|
|
else "RelWithDebInfo";
|
|
|
|
in ''
|
|
|
|
cmakeBuildType=${cmakeBuildType} # qt6 setup hook resets this for some godforsaken reason
|
|
|
|
cmakeConfigurePhase
|
|
|
|
'';
|
|
|
|
|
2024-03-09 07:08:50 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DGIT_REVISION=${gitRev}"
|
2024-05-31 08:28:35 +00:00
|
|
|
]
|
|
|
|
++ lib.optional (!withJemalloc) "-DUSE_JEMALLOC=OFF"
|
2024-06-02 22:37:47 +00:00
|
|
|
++ lib.optional (!withWayland) "-DWAYLAND=OFF"
|
|
|
|
++ lib.optional (!withPipewire) "-DSERVICE_PIPEWIRE=OFF"
|
|
|
|
++ lib.optional (!withHyprland) "-DHYPRLAND=OFF";
|
2024-03-04 13:04:29 +00:00
|
|
|
|
|
|
|
buildPhase = "ninjaBuildPhase";
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://git.outfoxxed.me/outfoxxed/quickshell";
|
|
|
|
description = "Simple and flexbile QtQuick based desktop shell toolkit";
|
2024-03-04 13:49:37 +00:00
|
|
|
license = licenses.lgpl3Only;
|
2024-03-04 13:04:29 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|