nix: better nix develop + refactor (#490)
This commit is contained in:
parent
60e67e8505
commit
b648477b91
5 changed files with 48 additions and 11 deletions
|
|
@ -26,8 +26,13 @@ set(INSTALL_QSCONFDIR "etc/xdg/quickshell/caelestia" CACHE STRING "Quickshell co
|
||||||
|
|
||||||
add_compile_options(-Wall -Wextra)
|
add_compile_options(-Wall -Wextra)
|
||||||
|
|
||||||
add_subdirectory(assets/cpp)
|
if(NOT DONT_BUILD_ASSETS)
|
||||||
add_subdirectory(plugin)
|
add_subdirectory(assets/cpp)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT DONT_BUILD_PLUGIN)
|
||||||
|
add_subdirectory(plugin)
|
||||||
|
endif()
|
||||||
|
|
||||||
foreach(dir assets components config modules services utils)
|
foreach(dir assets components config modules services utils)
|
||||||
install(DIRECTORY ${dir} DESTINATION "${INSTALL_QSCONFDIR}")
|
install(DIRECTORY ${dir} DESTINATION "${INSTALL_QSCONFDIR}")
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
cmake_minimum_required(VERSION 3.19)
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
pkg_check_modules(PIPEWIRE REQUIRED libpipewire-0.3)
|
pkg_check_modules(PIPEWIRE REQUIRED libpipewire-0.3)
|
||||||
pkg_check_modules(AUBIO REQUIRED aubio)
|
pkg_check_modules(AUBIO REQUIRED aubio)
|
||||||
|
|
|
||||||
13
flake.nix
13
flake.nix
|
|
@ -45,10 +45,17 @@
|
||||||
default = let
|
default = let
|
||||||
shell = self.packages.${pkgs.system}.caelestia-shell;
|
shell = self.packages.${pkgs.system}.caelestia-shell;
|
||||||
in
|
in
|
||||||
pkgs.mkShellNoCC {
|
pkgs.mkShell {
|
||||||
inputsFrom = [shell];
|
inputsFrom = [shell shell.plugin shell.assets];
|
||||||
packages = with pkgs; [material-symbols rubik nerd-fonts.caskaydia-cove];
|
packages = with pkgs; [material-symbols rubik nerd-fonts.caskaydia-cove];
|
||||||
CAELESTIA_LIB_DIR = "${shell}/lib";
|
|
||||||
|
CAELESTIA_XKB_RULES_PATH = "${pkgs.xkeyboard-config}/share/xkeyboard-config-2/rules/base.lst";
|
||||||
|
shellHook = ''
|
||||||
|
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug
|
||||||
|
cmake --build build
|
||||||
|
export CAELESTIA_LIB_DIR="$PWD/build/assets/cpp";
|
||||||
|
export QML2_IMPORT_PATH="$PWD/build/qml";
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -63,25 +63,44 @@
|
||||||
fontconfig = makeFontsConf {
|
fontconfig = makeFontsConf {
|
||||||
fontDirectories = [material-symbols rubik nerd-fonts.caskaydia-cove];
|
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
|
in
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
inherit version;
|
inherit version;
|
||||||
pname = "caelestia-shell";
|
pname = "caelestia-shell";
|
||||||
src = ./..;
|
src = ./..;
|
||||||
|
|
||||||
nativeBuildInputs = [cmake ninja pkg-config makeWrapper qt6.wrapQtAppsHook];
|
nativeBuildInputs = [cmake ninja makeWrapper qt6.wrapQtAppsHook];
|
||||||
buildInputs = [quickshell aubio pipewire xkeyboard-config qt6.qtbase qt6.qtdeclarative];
|
buildInputs = [quickshell assets plugin xkeyboard-config qt6.qtbase];
|
||||||
propagatedBuildInputs = runtimeDeps;
|
propagatedBuildInputs = runtimeDeps;
|
||||||
|
|
||||||
cmakeBuildType = "Release";
|
cmakeBuildType = "Release";
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
(lib.cmakeFeature "VERSION" version)
|
(lib.cmakeFeature "VERSION" version)
|
||||||
(lib.cmakeFeature "INSTALL_LIBDIR" "${placeholder "out"}/lib")
|
(lib.cmakeFeature "DONT_BUILD_PLUGIN" "ON")
|
||||||
(lib.cmakeFeature "INSTALL_QMLDIR" qt6.qtbase.qtQmlPrefix)
|
(lib.cmakeFeature "DONT_BUILD_ASSETS" "ON")
|
||||||
(lib.cmakeFeature "INSTALL_QSCONFDIR" "${placeholder "out"}/share/caelestia-shell")
|
(lib.cmakeFeature "INSTALL_QSCONFDIR" "${placeholder "out"}/share/caelestia-shell")
|
||||||
];
|
];
|
||||||
|
|
||||||
patchPhase = ''
|
prePatch = ''
|
||||||
substituteInPlace assets/pam.d/fprint \
|
substituteInPlace assets/pam.d/fprint \
|
||||||
--replace-fail pam_fprintd.so /run/current-system/sw/lib/security/pam_fprintd.so
|
--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 \
|
makeWrapper ${quickshell}/bin/qs $out/bin/caelestia-shell \
|
||||||
--prefix PATH : "${lib.makeBinPath runtimeDeps}" \
|
--prefix PATH : "${lib.makeBinPath runtimeDeps}" \
|
||||||
--set FONTCONFIG_FILE "${fontconfig}" \
|
--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 \
|
--set CAELESTIA_XKB_RULES_PATH ${xkeyboard-config}/share/xkeyboard-config-2/rules/base.lst \
|
||||||
--add-flags "-p $out/share/caelestia-shell"
|
--add-flags "-p $out/share/caelestia-shell"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
passthru = {
|
||||||
|
inherit plugin assets;
|
||||||
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "A very segsy desktop shell";
|
description = "A very segsy desktop shell";
|
||||||
homepage = "https://github.com/caelestia-dots/shell";
|
homepage = "https://github.com/caelestia-dots/shell";
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
cmake_minimum_required(VERSION 3.19)
|
||||||
find_package(Qt6 REQUIRED COMPONENTS Core Qml)
|
find_package(Qt6 REQUIRED COMPONENTS Core Qml)
|
||||||
|
|
||||||
if(QT_KNOWN_POLICY_QTP0001)
|
if(QT_KNOWN_POLICY_QTP0001)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue