summaryrefslogtreecommitdiff
path: root/nix
diff options
context:
space:
mode:
authorSoramane <61896496+soramanew@users.noreply.github.com>2025-08-29 15:30:09 +1000
committerSoramane <61896496+soramanew@users.noreply.github.com>2025-08-29 15:30:09 +1000
commitbe5748dff333adc6ec1180ada68fce58e9798af0 (patch)
treee8ed10d7eb1785711e4d2ecc97c5736e84c23f7d /nix
parentlib: add version script (diff)
downloadcaelestia-shell-be5748dff333adc6ec1180ada68fce58e9798af0.tar.gz
caelestia-shell-be5748dff333adc6ec1180ada68fce58e9798af0.tar.bz2
caelestia-shell-be5748dff333adc6ec1180ada68fce58e9798af0.zip
nix: fix + expose lib stuff
Also format
Diffstat (limited to 'nix')
-rw-r--r--nix/default.nix40
1 files changed, 30 insertions, 10 deletions
diff --git a/nix/default.nix b/nix/default.nix
index 3fd5325..c32aa87 100644
--- a/nix/default.nix
+++ b/nix/default.nix
@@ -68,28 +68,44 @@
cmakeVersionFlags = [
(lib.cmakeFeature "VERSION" version)
(lib.cmakeFeature "GIT_REVISION" rev)
- (lib.cmakeFeature "DISTRIBUTOR" "Nix Flake")
+ (lib.cmakeFeature "DISTRIBUTOR" "nix-flake")
];
assets = stdenv.mkDerivation {
name = "caelestia-assets";
- src = ./../assets/cpp;
+ src = lib.fileset.toSource {
+ root = ./..;
+ fileset = lib.fileset.union ./../CMakeLists.txt ./../assets/cpp;
+ };
nativeBuildInputs = [cmake ninja pkg-config];
buildInputs = [aubio pipewire];
- cmakeFlags = [(lib.cmakeFeature "INSTALL_LIBDIR" "${placeholder "out"}/lib")] ++ cmakeVersionFlags;
+ cmakeFlags =
+ [
+ (lib.cmakeBool "ASSETS_ONLY" true)
+ (lib.cmakeFeature "INSTALL_LIBDIR" "${placeholder "out"}/lib")
+ ]
+ ++ cmakeVersionFlags;
};
plugin = stdenv.mkDerivation {
name = "caelestia-qml-plugin";
- src = ./../plugin;
+ src = lib.fileset.toSource {
+ root = ./..;
+ fileset = lib.fileset.union ./../CMakeLists.txt ./../plugin;
+ };
nativeBuildInputs = [cmake ninja];
buildInputs = [qt6.qtbase qt6.qtdeclarative];
dontWrapQtApps = true;
- cmakeFlags = [(lib.cmakeFeature "INSTALL_QMLDIR" qt6.qtbase.qtQmlPrefix)] ++ cmakeVersionFlags;
+ cmakeFlags =
+ [
+ (lib.cmakeBool "PLUGIN_ONLY" true)
+ (lib.cmakeFeature "INSTALL_QMLDIR" qt6.qtbase.qtQmlPrefix)
+ ]
+ ++ cmakeVersionFlags;
};
in
stdenv.mkDerivation {
@@ -102,11 +118,12 @@ in
propagatedBuildInputs = runtimeDeps;
cmakeBuildType = "Release";
- cmakeFlags = [
- (lib.cmakeBool "DONT_BUILD_PLUGIN" true)
- (lib.cmakeBool "DONT_BUILD_ASSETS" true)
- (lib.cmakeFeature "INSTALL_QSCONFDIR" "${placeholder "out"}/share/caelestia-shell")
- ] ++ cmakeVersionFlags;
+ cmakeFlags =
+ [
+ (lib.cmakeBool "SHELL_ONLY" true)
+ (lib.cmakeFeature "INSTALL_QSCONFDIR" "${placeholder "out"}/share/caelestia-shell")
+ ]
+ ++ cmakeVersionFlags;
prePatch = ''
substituteInPlace assets/pam.d/fprint \
@@ -120,6 +137,9 @@ in
--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"
+
+ mkdir -p $out/lib
+ ln -s ${assets}/lib/* $out/lib/
'';
passthru = {