2024-03-04 05:04:29 -08:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
nix-gitignore,
|
|
|
|
pkgs,
|
|
|
|
keepDebugInfo,
|
2024-11-23 05:08:12 -08:00
|
|
|
buildStdenv ? pkgs.clangStdenv,
|
2024-03-04 05:04:29 -08:00
|
|
|
|
2025-06-12 04:48:09 -07:00
|
|
|
pkg-config,
|
2024-03-04 05:04:29 -08:00
|
|
|
cmake,
|
|
|
|
ninja,
|
2024-11-17 17:05:44 -08:00
|
|
|
spirv-tools,
|
2025-06-12 04:48:09 -07:00
|
|
|
qt6,
|
2024-08-20 00:41:20 -07:00
|
|
|
breakpad,
|
2024-05-31 01:28:35 -07:00
|
|
|
jemalloc,
|
2025-06-12 04:48:09 -07:00
|
|
|
cli11,
|
2024-03-04 05:04:29 -08:00
|
|
|
wayland,
|
|
|
|
wayland-protocols,
|
2025-06-12 04:48:09 -07:00
|
|
|
wayland-scanner,
|
|
|
|
xorg,
|
2025-01-14 04:43:05 -08:00
|
|
|
libdrm,
|
|
|
|
libgbm ? null,
|
2024-05-20 02:16:44 -07:00
|
|
|
pipewire,
|
2024-06-17 18:32:13 -07:00
|
|
|
pam,
|
2024-03-04 05:04:29 -08:00
|
|
|
|
2024-03-08 23:08:50 -08: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 00:44:13 -07:00
|
|
|
|
2024-03-04 05:04:29 -08:00
|
|
|
debug ? false,
|
2024-08-20 00:41:20 -07:00
|
|
|
withCrashReporter ? true,
|
2024-05-31 01:28:35 -07:00
|
|
|
withJemalloc ? true, # masks heap fragmentation
|
2024-06-02 15:37:47 -07:00
|
|
|
withQtSvg ? true,
|
|
|
|
withWayland ? true,
|
|
|
|
withX11 ? true,
|
|
|
|
withPipewire ? true,
|
2024-06-17 18:32:13 -07:00
|
|
|
withPam ? true,
|
2024-06-02 15:37:47 -07:00
|
|
|
withHyprland ? true,
|
2024-11-02 03:52:27 +01:00
|
|
|
withI3 ? true,
|
2024-03-11 18:18:55 -07:00
|
|
|
}: buildStdenv.mkDerivation {
|
2024-03-04 05:04:29 -08:00
|
|
|
pname = "quickshell${lib.optionalString debug "-debug"}";
|
2024-03-04 05:49:37 -08:00
|
|
|
version = "0.1.0";
|
2025-06-15 23:00:56 -07:00
|
|
|
src = nix-gitignore.gitignoreSource [] ./.;
|
2024-03-04 05:04:29 -08:00
|
|
|
|
2025-06-12 04:48:09 -07:00
|
|
|
nativeBuildInputs = [
|
2024-03-04 05:04:29 -08:00
|
|
|
cmake
|
|
|
|
ninja
|
2024-11-17 17:05:44 -08:00
|
|
|
qt6.qtshadertools
|
|
|
|
spirv-tools
|
2024-03-04 05:04:29 -08:00
|
|
|
qt6.wrapQtAppsHook
|
|
|
|
pkg-config
|
2025-06-15 23:00:56 -07:00
|
|
|
]
|
|
|
|
++ lib.optional withWayland wayland-scanner;
|
2024-03-04 05:04:29 -08:00
|
|
|
|
2024-05-20 02:16:44 -07:00
|
|
|
buildInputs = [
|
2024-03-04 05:04:29 -08:00
|
|
|
qt6.qtbase
|
|
|
|
qt6.qtdeclarative
|
2025-06-15 23:00:56 -07:00
|
|
|
cli11
|
2024-04-19 02:46:38 -07:00
|
|
|
]
|
2025-06-15 23:00:56 -07:00
|
|
|
++ lib.optional withQtSvg qt6.qtsvg
|
2024-09-09 03:23:27 -07:00
|
|
|
++ lib.optional withCrashReporter breakpad
|
|
|
|
++ lib.optional withJemalloc jemalloc
|
2025-06-15 23:00:56 -07:00
|
|
|
++ lib.optionals withWayland [ qt6.qtwayland wayland wayland-protocols ]
|
|
|
|
++ lib.optionals (withWayland && libgbm != null) [ libdrm libgbm ]
|
2024-09-09 03:23:27 -07:00
|
|
|
++ lib.optional withX11 xorg.libxcb
|
|
|
|
++ lib.optional withPam pam
|
|
|
|
++ lib.optional withPipewire pipewire;
|
2024-03-04 05:04:29 -08:00
|
|
|
|
2024-08-02 13:56:30 -07:00
|
|
|
cmakeBuildType = if debug then "Debug" else "RelWithDebInfo";
|
2024-03-04 05:04:29 -08:00
|
|
|
|
2024-09-09 03:23:27 -07:00
|
|
|
cmakeFlags = [
|
2024-10-15 23:01:14 -07:00
|
|
|
(lib.cmakeFeature "DISTRIBUTOR" "Official-Nix-Flake")
|
2024-11-04 13:42:21 -08:00
|
|
|
(lib.cmakeFeature "INSTALL_QML_PREFIX" qt6.qtbase.qtQmlPrefix)
|
2024-10-15 23:01:14 -07:00
|
|
|
(lib.cmakeBool "DISTRIBUTOR_DEBUGINFO_AVAILABLE" true)
|
2024-09-09 03:23:27 -07:00
|
|
|
(lib.cmakeFeature "GIT_REVISION" gitRev)
|
|
|
|
(lib.cmakeBool "CRASH_REPORTER" withCrashReporter)
|
|
|
|
(lib.cmakeBool "USE_JEMALLOC" withJemalloc)
|
|
|
|
(lib.cmakeBool "WAYLAND" withWayland)
|
2025-01-14 04:43:05 -08:00
|
|
|
(lib.cmakeBool "SCREENCOPY" (libgbm != null))
|
2024-09-09 03:23:27 -07:00
|
|
|
(lib.cmakeBool "SERVICE_PIPEWIRE" withPipewire)
|
|
|
|
(lib.cmakeBool "SERVICE_PAM" withPam)
|
|
|
|
(lib.cmakeBool "HYPRLAND" withHyprland)
|
2024-11-02 03:52:27 +01:00
|
|
|
(lib.cmakeBool "I3" withI3)
|
2024-09-09 03:23:27 -07:00
|
|
|
];
|
2024-08-02 13:56:30 -07:00
|
|
|
|
|
|
|
# How to get debuginfo in gdb from a release build:
|
|
|
|
# 1. build `quickshell.debug`
|
|
|
|
# 2. set NIX_DEBUG_INFO_DIRS="<quickshell.debug store path>/lib/debug"
|
|
|
|
# 3. launch gdb / coredumpctl and debuginfo will work
|
|
|
|
separateDebugInfo = !debug;
|
|
|
|
dontStrip = debug;
|
2024-03-04 05:04:29 -08:00
|
|
|
|
|
|
|
meta = with lib; {
|
2025-06-12 04:48:09 -07:00
|
|
|
homepage = "https://quickshell.outfoxxed.me";
|
2024-09-09 03:23:27 -07:00
|
|
|
description = "Flexbile QtQuick based desktop shell toolkit";
|
2024-03-04 05:49:37 -08:00
|
|
|
license = licenses.lgpl3Only;
|
2024-03-04 05:04:29 -08:00
|
|
|
platforms = platforms.linux;
|
2025-06-12 04:48:09 -07:00
|
|
|
mainProgram = "quickshell";
|
2024-03-04 05:04:29 -08:00
|
|
|
};
|
|
|
|
}
|