From b648477b91e3cb1aefd5b6b8fdd94ffbbd79fcb1 Mon Sep 17 00:00:00 2001 From: Davi Ribeiro <104164579+Markus328@users.noreply.github.com> Date: Fri, 29 Aug 2025 01:07:47 -0300 Subject: nix: better nix develop + refactor (#490) --- nix/default.nix | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) (limited to 'nix') diff --git a/nix/default.nix b/nix/default.nix index dc1c9ac..11ea33d 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -63,25 +63,44 @@ fontconfig = makeFontsConf { fontDirectories = [material-symbols rubik nerd-fonts.caskaydia-cove]; }; + + assets = stdenv.mkDerivation { + name = "caelestia-assets"; + src = ./../assets/cpp; + + nativeBuildInputs = [cmake pkg-config]; + buildInputs = [aubio pipewire]; + + cmakeFlags = [(lib.cmakeFeature "INSTALL_LIBDIR" "${placeholder "out"}/lib")]; + }; + + plugin = stdenv.mkDerivation { + name = "caelestia-qml-plugin"; + src = ./../plugin; + nativeBuildInputs = [cmake]; + buildInputs = [qt6.qtbase qt6.qtdeclarative]; + dontWrapQtApps = true; + cmakeFlags = [(lib.cmakeFeature "INSTALL_QMLDIR" qt6.qtbase.qtQmlPrefix)]; + }; in stdenv.mkDerivation { inherit version; pname = "caelestia-shell"; src = ./..; - nativeBuildInputs = [cmake ninja pkg-config makeWrapper qt6.wrapQtAppsHook]; - buildInputs = [quickshell aubio pipewire xkeyboard-config qt6.qtbase qt6.qtdeclarative]; + nativeBuildInputs = [cmake ninja makeWrapper qt6.wrapQtAppsHook]; + buildInputs = [quickshell assets plugin xkeyboard-config qt6.qtbase]; propagatedBuildInputs = runtimeDeps; cmakeBuildType = "Release"; cmakeFlags = [ (lib.cmakeFeature "VERSION" version) - (lib.cmakeFeature "INSTALL_LIBDIR" "${placeholder "out"}/lib") - (lib.cmakeFeature "INSTALL_QMLDIR" qt6.qtbase.qtQmlPrefix) + (lib.cmakeFeature "DONT_BUILD_PLUGIN" "ON") + (lib.cmakeFeature "DONT_BUILD_ASSETS" "ON") (lib.cmakeFeature "INSTALL_QSCONFDIR" "${placeholder "out"}/share/caelestia-shell") ]; - patchPhase = '' + prePatch = '' substituteInPlace assets/pam.d/fprint \ --replace-fail pam_fprintd.so /run/current-system/sw/lib/security/pam_fprintd.so ''; @@ -90,11 +109,15 @@ in makeWrapper ${quickshell}/bin/qs $out/bin/caelestia-shell \ --prefix PATH : "${lib.makeBinPath runtimeDeps}" \ --set FONTCONFIG_FILE "${fontconfig}" \ - --set CAELESTIA_LIB_DIR $out/lib \ + --set CAELESTIA_LIB_DIR ${assets}/lib \ --set CAELESTIA_XKB_RULES_PATH ${xkeyboard-config}/share/xkeyboard-config-2/rules/base.lst \ --add-flags "-p $out/share/caelestia-shell" ''; + passthru = { + inherit plugin assets; + }; + meta = { description = "A very segsy desktop shell"; homepage = "https://github.com/caelestia-dots/shell"; -- cgit v1.2.3-freya