Skip to content

Commit 49cabbd

Browse files
committed
nix: add debug package
Also use clangStdenv to build Use RelWithDebInfo for release builds
1 parent c723386 commit 49cabbd

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

flake.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
packages = forAllSystems (pkgs: rec {
3232
caelestia-shell = pkgs.callPackage ./nix {
3333
rev = self.rev or self.dirtyRev;
34+
stdenv = pkgs.clangStdenv;
3435
quickshell = inputs.quickshell.packages.${pkgs.system}.default.override {
3536
withX11 = false;
3637
withI3 = false;
@@ -39,6 +40,7 @@
3940
caelestia-cli = inputs.caelestia-cli.packages.${pkgs.system}.default;
4041
};
4142
with-cli = caelestia-shell.override {withCli = true;};
43+
debug = caelestia-shell.override {debug = true;};
4244
default = caelestia-shell;
4345
});
4446

nix/default.nix

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
ninja,
3434
pkg-config,
3535
caelestia-cli,
36+
debug ? false,
3637
withCli ? false,
3738
extraRuntimeDeps ? [],
3839
}: let
@@ -72,7 +73,7 @@
7273
];
7374

7475
assets = stdenv.mkDerivation {
75-
name = "caelestia-assets";
76+
name = "caelestia-assets${lib.optionalString debug "-debug"}";
7677
src = lib.fileset.toSource {
7778
root = ./..;
7879
fileset = lib.fileset.union ./../CMakeLists.txt ./../assets/cpp;
@@ -90,7 +91,7 @@
9091
};
9192

9293
plugin = stdenv.mkDerivation {
93-
name = "caelestia-qml-plugin";
94+
name = "caelestia-qml-plugin${lib.optionalString debug "-debug"}";
9495
src = lib.fileset.toSource {
9596
root = ./..;
9697
fileset = lib.fileset.union ./../CMakeLists.txt ./../plugin;
@@ -110,21 +111,26 @@
110111
in
111112
stdenv.mkDerivation {
112113
inherit version;
113-
pname = "caelestia-shell";
114+
pname = "caelestia-shell${lib.optionalString debug "-debug"}";
114115
src = ./..;
115116

116117
nativeBuildInputs = [cmake ninja makeWrapper qt6.wrapQtAppsHook];
117118
buildInputs = [quickshell assets plugin xkeyboard-config qt6.qtbase];
118119
propagatedBuildInputs = runtimeDeps;
119120

120-
cmakeBuildType = "Release";
121+
cmakeBuildType =
122+
if debug
123+
then "Debug"
124+
else "RelWithDebInfo";
121125
cmakeFlags =
122126
[
123127
(lib.cmakeFeature "ENABLE_MODULES" "shell")
124128
(lib.cmakeFeature "INSTALL_QSCONFDIR" "${placeholder "out"}/share/caelestia-shell")
125129
]
126130
++ cmakeVersionFlags;
127131

132+
dontStrip = debug;
133+
128134
prePatch = ''
129135
substituteInPlace assets/pam.d/fprint \
130136
--replace-fail pam_fprintd.so /run/current-system/sw/lib/security/pam_fprintd.so

0 commit comments

Comments
 (0)