fix: nix build

This commit is contained in:
2 * r + 2 * t 2026-06-07 23:33:31 +10:00
parent e65e918a9e
commit ddd5c270d1
4 changed files with 54 additions and 6 deletions

View file

@ -34,7 +34,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
set(DISTRIBUTOR "Unset" CACHE STRING "Distributor")
set(ENABLE_MODULES "extras;plugin;shell" CACHE STRING "Modules to build/install")
set(ENABLE_MODULES "extras;plugin;shell;m3shapes" CACHE STRING "Modules to build/install")
set(INSTALL_LIBDIR "usr/lib/caelestia" CACHE STRING "Library install dir")
set(INSTALL_QMLDIR "usr/lib/qt6/qml" CACHE STRING "QML install dir")
set(INSTALL_QSCONFDIR "etc/xdg/quickshell/caelestia" CACHE STRING "Quickshell config install dir")
@ -72,7 +72,7 @@ if("shell" IN_LIST ENABLE_MODULES)
install(FILES LICENSE DESTINATION "${INSTALL_QSCONFDIR}")
endif()
if("plugin" IN_LIST ENABLE_MODULES OR "shell" IN_LIST ENABLE_MODULES)
if("m3shapes" IN_LIST ENABLE_MODULES)
message(STATUS "Fetching M3Shapes module")
include(FetchContent)
FetchContent_Declare(

17
flake.lock generated
View file

@ -21,6 +21,22 @@
"type": "github"
}
},
"m3shapes": {
"flake": false,
"locked": {
"lastModified": 1777812556,
"narHash": "sha256-E5nqOucRQBWKuT31AMekmfgMywRdHgSbU86R7t4BKKA=",
"owner": "soramanew",
"repo": "m3shapes",
"rev": "356825d31f16052a782735cce264331cba0cb71b",
"type": "github"
},
"original": {
"owner": "soramanew",
"repo": "m3shapes",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1780243769,
@ -60,6 +76,7 @@
"root": {
"inputs": {
"caelestia-cli": "caelestia-cli",
"m3shapes": "m3shapes",
"nixpkgs": "nixpkgs",
"quickshell": "quickshell"
}

View file

@ -14,6 +14,11 @@
inputs.nixpkgs.follows = "nixpkgs";
inputs.caelestia-shell.follows = "";
};
m3shapes = {
url = "github:soramanew/m3shapes";
flake = false;
};
};
outputs = {
@ -30,6 +35,7 @@
packages = forAllSystems (pkgs: rec {
caelestia-shell = pkgs.callPackage ./nix {
inherit (inputs) m3shapes;
rev = self.rev or self.dirtyRev;
stdenv = pkgs.clangStdenv;
quickshell = inputs.quickshell.packages.${pkgs.stdenv.hostPlatform.system}.default.override {
@ -48,7 +54,7 @@
shell = self.packages.${pkgs.stdenv.hostPlatform.system}.caelestia-shell;
in
pkgs.mkShell.override {stdenv = shell.stdenv;} {
inputsFrom = [shell shell.plugin shell.extras];
inputsFrom = [shell shell.plugin shell.extras shell.m3shapesModule];
packages = with pkgs; [clazy material-symbols rubik nerd-fonts.caskaydia-cove];
CAELESTIA_XKB_RULES_PATH = "${pkgs.xkeyboard-config}/share/xkeyboard-config-2/rules/base.lst";
};

View file

@ -29,6 +29,7 @@
ninja,
pkg-config,
caelestia-cli,
m3shapes,
debug ? false,
withCli ? false,
extraRuntimeDeps ? [],
@ -67,6 +68,9 @@
(lib.cmakeFeature "DISTRIBUTOR" "nix-flake")
];
# The build sandbox has no network access so add it as a flake input instead
m3shapesFlag = lib.cmakeFeature "FETCHCONTENT_SOURCE_DIR_M3SHAPES_EXTERNAL" "${m3shapes}";
extras = stdenv.mkDerivation {
inherit cmakeBuildType;
name = "caelestia-extras${lib.optionalString debug "-debug"}";
@ -94,7 +98,7 @@
};
nativeBuildInputs = [cmake ninja pkg-config];
buildInputs = [qt6.qtbase qt6.qtdeclarative libqalculate pipewire aubio libcava fftw];
buildInputs = [qt6.qtbase qt6.qtdeclarative qt6.qtshadertools libqalculate pipewire aubio libcava fftw lm_sensors];
dontWrapQtApps = true;
cmakeFlags =
@ -104,6 +108,27 @@
]
++ cmakeVersionFlags;
};
m3shapesModule = stdenv.mkDerivation {
inherit cmakeBuildType;
name = "caelestia-m3shapes${lib.optionalString debug "-debug"}";
src = lib.fileset.toSource {
root = ./..;
fileset = ./../CMakeLists.txt;
};
nativeBuildInputs = [cmake ninja];
buildInputs = [qt6.qtbase qt6.qtdeclarative];
dontWrapQtApps = true;
cmakeFlags =
[
(lib.cmakeFeature "ENABLE_MODULES" "m3shapes")
(lib.cmakeFeature "INSTALL_QMLDIR" qt6.qtbase.qtQmlPrefix)
m3shapesFlag
]
++ cmakeVersionFlags;
};
in
stdenv.mkDerivation {
inherit version cmakeBuildType;
@ -111,7 +136,7 @@ in
src = ./..;
nativeBuildInputs = [cmake ninja makeWrapper qt6.wrapQtAppsHook];
buildInputs = [quickshell extras plugin xkeyboard-config qt6.qtbase];
buildInputs = [quickshell extras plugin m3shapesModule xkeyboard-config qt6.qtbase];
propagatedBuildInputs = runtimeDeps;
cmakeFlags =
@ -144,7 +169,7 @@ in
'';
passthru = {
inherit plugin extras;
inherit plugin extras m3shapesModule;
};
meta = {