Skip to content

Commit 1b2ae58

Browse files
shymegajohnrizzo1
andcommitted
feat(nix): Add Nix Flake to Breezy
This derives from @johnrizzo1's Nix packages for the Nix Flake, which were REALLY helpful for me. Co-authored-by: John Rizzo <johnrizzo1@gmail.com>
1 parent 3ba62cf commit 1b2ae58

6 files changed

Lines changed: 465 additions & 0 deletions

File tree

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
self,
3+
version,
4+
lib,
5+
stdenv,
6+
glib,
7+
}:
8+
let
9+
extensionUuid = "breezydesktop@xronlinux.com";
10+
in
11+
stdenv.mkDerivation (finalAttrs: {
12+
pname = "gnome-shell-extension-breezy-desktop";
13+
inherit version;
14+
15+
src = self;
16+
17+
nativeBuildInputs = [
18+
glib # for glib-compile-schemas
19+
];
20+
21+
dontConfigure = true;
22+
dontBuild = true;
23+
24+
passthru = {
25+
inherit extensionUuid;
26+
};
27+
28+
installPhase = ''
29+
runHook preInstall
30+
31+
extDir=$out/share/gnome-shell/extensions/${extensionUuid}
32+
mkdir -p $extDir
33+
34+
# JavaScript source files
35+
cd gnome/src
36+
for f in *.js metadata.json; do
37+
install -Dm644 "$f" "$extDir/$f"
38+
done
39+
40+
# Fragment shader (resolve symlink)
41+
cp -L Sombrero.frag "$extDir/Sombrero.frag"
42+
43+
# D-Bus interfaces
44+
mkdir -p "$extDir/dbus-interfaces"
45+
cp dbus-interfaces/*.xml "$extDir/dbus-interfaces/"
46+
47+
# Textures (resolve symlinks)
48+
mkdir -p "$extDir/textures"
49+
cp -L textures/* "$extDir/textures/"
50+
51+
# GSettings schema (resolve symlink and compile)
52+
mkdir -p "$extDir/schemas"
53+
cp -L schemas/*.xml "$extDir/schemas/"
54+
glib-compile-schemas "$extDir/schemas"
55+
56+
runHook postInstall
57+
'';
58+
59+
meta = {
60+
description = "GNOME Shell extension for Breezy Desktop XR virtual display";
61+
homepage = "https://github.com/wheaney/breezy-desktop";
62+
license = lib.licenses.gpl3Only;
63+
platforms = lib.platforms.linux;
64+
};
65+
})
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
{
2+
self,
3+
version,
4+
lib,
5+
stdenv,
6+
fetchFromGitHub,
7+
cmake,
8+
pkg-config,
9+
kdePackages,
10+
libepoxy,
11+
}:
12+
stdenv.mkDerivation (finalAttrs: {
13+
pname = "breezy-kwin";
14+
inherit version;
15+
16+
src = self;
17+
18+
sourceRoot = ".";
19+
20+
unpackPhase = ''
21+
cp -r $src $TMPDIR/breezy-desktop
22+
chmod -R u+w $TMPDIR/breezy-desktop
23+
cd $TMPDIR/breezy-desktop/kwin
24+
'';
25+
26+
nativeBuildInputs = [
27+
cmake
28+
kdePackages.extra-cmake-modules
29+
kdePackages.wrapQtAppsHook
30+
pkg-config
31+
];
32+
33+
buildInputs = with kdePackages; [
34+
kconfig
35+
kconfigwidgets
36+
kcoreaddons
37+
kglobalaccel
38+
ki18n
39+
kcmutils
40+
kwindowsystem
41+
kxmlgui
42+
kwin
43+
qtbase
44+
qtdeclarative
45+
qt3d
46+
qtquick3d
47+
libepoxy
48+
];
49+
50+
postPatch = ''
51+
# VERSION is read relative to kwin/src/../VERSION = kwin/VERSION
52+
# and also from kwin/../VERSION for the top-level CMakeLists.txt
53+
echo "${finalAttrs.version}" > ../VERSION
54+
echo "${finalAttrs.version}" > VERSION
55+
56+
# Copy files expected by CMake install but located elsewhere in the mono-repo
57+
cp ../ui/modules/PyXRLinuxDriverIPC/xrdriveripc.py src/xrdriveripc/xrdriveripc.py
58+
cp ../ui/data/icons/hicolor/scalable/apps/com.xronlinux.BreezyDesktop.svg src/kcm/com.xronlinux.BreezyDesktop.svg
59+
60+
# Fix hardcoded /usr/include/kwin path
61+
substituteInPlace cmake/info.cmake \
62+
--replace-fail '/usr/include/kwin/effect/effect.h' \
63+
'${kdePackages.kwin.dev}/include/kwin/effect/effect.h'
64+
65+
# Fix QtQuick3D QML module detection - bypass qmake query
66+
substituteInPlace CMakeLists.txt \
67+
--replace-fail 'execute_process(
68+
COMMAND ''${QT6_QMAKE_EXECUTABLE} -query QT_INSTALL_QML
69+
OUTPUT_VARIABLE QT6_QML_DIR
70+
OUTPUT_STRIP_TRAILING_WHITESPACE
71+
)' 'set(QT6_QML_DIR "${kdePackages.qtquick3d}/lib/qt-6/qml")'
72+
73+
# Remove the hardcoded /usr/include reference
74+
substituteInPlace src/CMakeLists.txt \
75+
--replace-fail 'target_include_directories(breezy_desktop PRIVATE /usr/include/kwin)' \
76+
'target_include_directories(breezy_desktop PRIVATE ${kdePackages.kwin.dev}/include/kwin)'
77+
'';
78+
79+
cmakeFlags = [
80+
"-DCMAKE_BUILD_TYPE=Release"
81+
];
82+
83+
meta = {
84+
description = "KWin effect plugin for Breezy Desktop XR virtual display";
85+
homepage = "https://github.com/wheaney/breezy-desktop";
86+
license = lib.licenses.gpl3Only;
87+
platforms = lib.platforms.linux;
88+
};
89+
})
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
{
2+
self,
3+
version,
4+
lib,
5+
stdenv,
6+
fetchFromGitHub,
7+
meson,
8+
ninja,
9+
pkg-config,
10+
gettext,
11+
glib,
12+
gtk4,
13+
libadwaita,
14+
desktop-file-utils,
15+
gobject-introspection,
16+
wrapGAppsHook4,
17+
python3Packages,
18+
python3,
19+
gst_all_1,
20+
appstream,
21+
}:
22+
stdenv.mkDerivation (finalAttrs: {
23+
pname = "breezy-desktop-ui";
24+
inherit version;
25+
26+
# Use the ui/ subtree but need root for VERSION file
27+
src = self;
28+
sourceRoot = "ui";
29+
30+
# The source is a nix store path, not a directory name
31+
unpackPhase = ''
32+
cp -r $src $TMPDIR/breezy-desktop
33+
chmod -R u+w $TMPDIR/breezy-desktop
34+
cd $TMPDIR/breezy-desktop/ui
35+
sourceRoot=$(pwd)
36+
'';
37+
38+
nativeBuildInputs = [
39+
meson
40+
ninja
41+
pkg-config
42+
gettext
43+
glib # glib-compile-schemas
44+
gtk4 # gtk-update-icon-cache
45+
desktop-file-utils
46+
gobject-introspection
47+
wrapGAppsHook4
48+
appstream # appstreamcli for validation
49+
];
50+
51+
buildInputs = [
52+
gtk4
53+
libadwaita
54+
glib
55+
gst_all_1.gstreamer
56+
gst_all_1.gst-plugins-base
57+
(python3.withPackages (
58+
ps: with ps; [
59+
pygobject3
60+
pydbus
61+
]
62+
))
63+
];
64+
65+
# Patch the entry scripts to use Nix store paths instead of XDG_DATA_HOME
66+
postPatch = ''
67+
substituteInPlace src/breezydesktop.in \
68+
--replace-fail "appdir = os.getenv('APPDIR', xdg_data_home)" \
69+
"appdir = os.getenv('APPDIR', '$out/share')"
70+
substituteInPlace src/virtualdisplay.in \
71+
--replace-fail "appdir = os.getenv('APPDIR', xdg_data_home)" \
72+
"appdir = os.getenv('APPDIR', '$out/share')" || true
73+
74+
# Upstream bug: virtualdisplayrow.py is missing from meson.build install list
75+
substituteInPlace src/meson.build \
76+
--replace-fail "'virtualdisplay.py'," "'virtualdisplay.py', 'virtualdisplayrow.py',"
77+
'';
78+
79+
# Skip tests that need network or display
80+
mesonFlags = [
81+
];
82+
83+
# wrapGAppsHook4 handles GI_TYPELIB_PATH, GDK_PIXBUF, etc.
84+
85+
meta = {
86+
description = "GTK4 settings UI for Breezy Desktop XR";
87+
homepage = "https://github.com/wheaney/breezy-desktop";
88+
license = lib.licenses.gpl3Only;
89+
platforms = lib.platforms.linux;
90+
};
91+
})
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
self,
3+
version,
4+
lib,
5+
stdenv,
6+
fetchFromGitHub,
7+
meson,
8+
ninja,
9+
pkg-config,
10+
glslang,
11+
spirv-headers,
12+
vulkan-headers,
13+
vulkan-loader,
14+
libx11,
15+
}:
16+
stdenv.mkDerivation (finalAttrs: {
17+
pname = "breezy-vulkan";
18+
inherit version;
19+
20+
src = "${self}/vulkan/modules/vkBasalt";
21+
22+
nativeBuildInputs = [
23+
meson
24+
ninja
25+
pkg-config
26+
glslang
27+
];
28+
29+
buildInputs = [
30+
spirv-headers
31+
vulkan-headers
32+
vulkan-loader
33+
libx11
34+
];
35+
36+
postInstall =
37+
let
38+
sombreroSrc = "${self}/modules/sombrero";
39+
vulkanSrc = "${self}/vulkan";
40+
in
41+
''
42+
# Install sombrero shaders
43+
mkdir -p $out/share/breezy-vulkan/shaders
44+
cp ${sombreroSrc}/Sombrero.frag $out/share/breezy-vulkan/shaders/
45+
cp ${sombreroSrc}/calibrating.png $out/share/breezy-vulkan/shaders/ || true
46+
47+
# Install breezy vulkan config
48+
install -Dm644 ${vulkanSrc}/config/vkBasalt.conf $out/share/breezy-vulkan/vkBasalt.conf
49+
50+
# Install custom banner
51+
cp ${vulkanSrc}/custom_banner.png $out/share/breezy-vulkan/ || true
52+
'';
53+
54+
meta = {
55+
description = "Vulkan post-processing layer for Breezy Desktop XR gaming";
56+
homepage = "https://github.com/wheaney/breezy-desktop";
57+
license = lib.licenses.gpl3Only;
58+
platforms = [ "x86_64-linux" ];
59+
};
60+
})

0 commit comments

Comments
 (0)