nix: consistent build type

This commit is contained in:
2 * r + 2 * t 2025-09-24 12:27:28 +10:00
parent e294adf96a
commit 1466adc629

View file

@ -56,6 +56,11 @@
fontDirectories = [material-symbols rubik nerd-fonts.caskaydia-cove]; fontDirectories = [material-symbols rubik nerd-fonts.caskaydia-cove];
}; };
cmakeBuildType =
if debug
then "Debug"
else "RelWithDebInfo";
cmakeVersionFlags = [ cmakeVersionFlags = [
(lib.cmakeFeature "VERSION" version) (lib.cmakeFeature "VERSION" version)
(lib.cmakeFeature "GIT_REVISION" rev) (lib.cmakeFeature "GIT_REVISION" rev)
@ -63,6 +68,7 @@
]; ];
extras = stdenv.mkDerivation { extras = stdenv.mkDerivation {
inherit cmakeBuildType;
name = "caelestia-extras${lib.optionalString debug "-debug"}"; name = "caelestia-extras${lib.optionalString debug "-debug"}";
src = lib.fileset.toSource { src = lib.fileset.toSource {
root = ./..; root = ./..;
@ -80,6 +86,7 @@
}; };
plugin = stdenv.mkDerivation { plugin = stdenv.mkDerivation {
inherit cmakeBuildType;
name = "caelestia-qml-plugin${lib.optionalString debug "-debug"}"; name = "caelestia-qml-plugin${lib.optionalString debug "-debug"}";
src = lib.fileset.toSource { src = lib.fileset.toSource {
root = ./..; root = ./..;
@ -99,7 +106,7 @@
}; };
in in
stdenv.mkDerivation { stdenv.mkDerivation {
inherit version; inherit version cmakeBuildType;
pname = "caelestia-shell${lib.optionalString debug "-debug"}"; pname = "caelestia-shell${lib.optionalString debug "-debug"}";
src = ./..; src = ./..;
@ -107,10 +114,6 @@ in
buildInputs = [quickshell extras plugin xkeyboard-config qt6.qtbase]; buildInputs = [quickshell extras plugin xkeyboard-config qt6.qtbase];
propagatedBuildInputs = runtimeDeps; propagatedBuildInputs = runtimeDeps;
cmakeBuildType =
if debug
then "Debug"
else "RelWithDebInfo";
cmakeFlags = cmakeFlags =
[ [
(lib.cmakeFeature "ENABLE_MODULES" "shell") (lib.cmakeFeature "ENABLE_MODULES" "shell")