1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
|
{
rev,
lib,
stdenv,
makeWrapper,
makeFontsConf,
fish,
ddcutil,
brightnessctl,
app2unit,
cava,
networkmanager,
lm_sensors,
grim,
swappy,
wl-clipboard,
libqalculate,
inotify-tools,
bluez,
bash,
hyprland,
coreutils,
findutils,
file,
material-symbols,
rubik,
nerd-fonts,
gcc,
qt6,
quickshell,
aubio,
pipewire,
wayland,
wayland-protocols,
wayland-scanner,
xkeyboard-config,
cmake,
ninja,
caelestia-cli,
withCli ? false,
extraRuntimeDeps ? [],
}: let
runtimeDeps =
[
fish
ddcutil
brightnessctl
app2unit
cava
networkmanager
lm_sensors
grim
swappy
wl-clipboard
libqalculate
inotify-tools
bluez
bash
hyprland
coreutils
findutils
file
]
++ extraRuntimeDeps
++ lib.optional withCli caelestia-cli;
fontconfig = makeFontsConf {
fontDirectories = [material-symbols rubik nerd-fonts.caskaydia-cove];
};
beatDetector = stdenv.mkDerivation {
pname = "beat-detector";
version = "1.0";
src = ./..;
nativeBuildInputs = [gcc];
buildInputs = [aubio pipewire];
buildPhase = ''
mkdir -p bin
g++ -std=c++17 -Wall -Wextra \
-I${pipewire.dev}/include/pipewire-0.3 \
-I${pipewire.dev}/include/spa-0.2 \
-I${aubio}/include/aubio \
assets/cpp/beat-detector.cpp \
-o bin/beat_detector \
-lpipewire-0.3 -laubio
'';
installPhase = ''
install -Dm755 bin/beat_detector $out/bin/beat_detector
'';
};
idleInhibitor = stdenv.mkDerivation {
pname = "wayland-idle-inhibitor";
version = "1.0";
src = ./..;
nativeBuildInputs = [gcc wayland-scanner wayland-protocols];
buildInputs = [wayland];
buildPhase = ''
wayland-scanner client-header < ${wayland-protocols}/share/wayland-protocols/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml > idle-inhibitor.h
wayland-scanner private-code < ${wayland-protocols}/share/wayland-protocols/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml > idle-inhibitor.c
cp assets/cpp/idle-inhibitor.cpp .
gcc -o idle-inhibitor.o -c idle-inhibitor.c
g++ -o inhibit_idle idle-inhibitor.cpp idle-inhibitor.o -lwayland-client
'';
installPhase = ''
mkdir -p $out/bin
install -Dm755 inhibit_idle $out/bin/inhibit_idle
'';
};
plugin = stdenv.mkDerivation {
pname = "caelestia-qt-plugin";
version = "0.0.1";
src = ./../plugin;
dontWrapQtApps = true;
nativeBuildInputs = [cmake ninja];
buildInputs = [qt6.qtbase qt6.qtdeclarative];
cmakeBuildType = "Release";
cmakeFlags = [
(lib.cmakeFeature "INSTALL_QMLDIR" qt6.qtbase.qtQmlPrefix)
(lib.cmakeFeature "GIT_REVISION" rev)
];
};
in
stdenv.mkDerivation {
pname = "caelestia-shell";
version = "${rev}";
src = ./..;
nativeBuildInputs = [gcc makeWrapper qt6.wrapQtAppsHook];
buildInputs = [quickshell plugin beatDetector idleInhibitor xkeyboard-config qt6.qtbase];
propagatedBuildInputs = runtimeDeps;
patchPhase = ''
substituteInPlace assets/pam.d/fprint \
--replace-fail pam_fprintd.so /run/current-system/sw/lib/security/pam_fprintd.so
'';
installPhase = ''
mkdir -p $out/share/caelestia-shell
cp -r ./* $out/share/caelestia-shell
makeWrapper ${quickshell}/bin/qs $out/bin/caelestia-shell \
--prefix PATH : "${lib.makeBinPath runtimeDeps}" \
--set FONTCONFIG_FILE "${fontconfig}" \
--set CAELESTIA_BD_PATH ${beatDetector}/bin/beat_detector \
--set CAELESTIA_II_PATH ${idleInhibitor}/bin/inhibit_idle \
--set CAELESTIA_XKB_RULES_PATH ${xkeyboard-config}/share/xkeyboard-config-2/rules/base.lst \
--add-flags "-p $out/share/caelestia-shell"
ln -sf ${beatDetector}/bin/beat_detector $out/bin
ln -sf ${idleInhibitor}/bin/inhibit_idle $out/bin
'';
meta = {
description = "A very segsy desktop shell";
homepage = "https://github.com/caelestia-dots/shell";
license = lib.licenses.gpl3Only;
mainProgram = "caelestia-shell";
};
}
|