Skip to content

Commit 9fee0ce

Browse files
Update flake.nix (#406)
1 parent 8104856 commit 9fee0ce

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

flake.nix

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,28 @@
1818
mkPackage = pkgs: {
1919
swayfx-unwrapped =
2020
(pkgs.swayfx-unwrapped.override {
21+
# This override block is currently empty, you might remove it
22+
# unless you intend to override function arguments later.
2123
}).overrideAttrs
2224
(old: {
2325
version = "0.4.0-git";
2426
src = pkgs.lib.cleanSource ./.;
2527
nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.cmake ];
26-
buildInputs = old.buildInputs ++ [ pkgs.scenefx ];
28+
# Add wlroots_0_18 here
29+
buildInputs = old.buildInputs ++ [
30+
pkgs.scenefx
31+
pkgs.wlroots_0_18 # <-- Added this line
32+
];
2733
providedSessions = [ pkgs.swayfx-unwrapped.meta.mainProgram ];
28-
patches = []; ## this should probably be fixed properly
34+
patches = []; ## Consider if you need patches from the original derivation
2935
mesonFlags = let
3036
inherit (pkgs.lib.strings) mesonEnable mesonOption;
3137
in
3238
[
3339
(mesonOption "sd-bus-provider" "libsystemd")
3440
(mesonEnable "tray" true)
41+
# You might need to explicitly enable fx if the default changed
42+
# (mesonEnable "fx" true) # <-- Potentially add this if needed
3543
];
3644
});
3745
};
@@ -65,8 +73,16 @@
6573
devShells = forEachSystem (pkgs: {
6674
default = pkgs.mkShell {
6775
name = "swayfx-shell";
76+
# inputsFrom propagates buildInputs, nativeBuildInputs etc. from the listed derivations
77+
# Adding wlroots and scenefx explicitly here is fine, but they are also included via inputsFrom
6878
inputsFrom = [
6979
self.packages.${pkgs.system}.swayfx-unwrapped
80+
# pkgs.wlroots_0_18 # Included via swayfx-unwrapped buildInputs now
81+
# pkgs.scenefx # Included via swayfx-unwrapped buildInputs now
82+
];
83+
# You still might want wlroots/scenefx here if you need tools/headers directly in the shell
84+
# outside of what swayfx uses.
85+
buildInputs = [
7086
pkgs.wlroots_0_18
7187
pkgs.scenefx
7288
];
@@ -76,10 +92,16 @@
7692
shellHook = ''
7793
(
7894
# Copy the nix version of wlroots and scenefx into the project
95+
# This is useful if you want meson to use them as subprojects during manual dev/testing
96+
echo "Copying wlroots and scenefx sources to ./subprojects for dev environment..."
7997
mkdir -p "$PWD/subprojects" && cd "$PWD/subprojects"
98+
rm -rf wlroots scenefx # Clean previous copies if they exist
8099
cp -R --no-preserve=mode,ownership ${pkgs.wlroots_0_18.src} wlroots
81100
cp -R --no-preserve=mode,ownership ${pkgs.scenefx.src} scenefx
82-
)'';
101+
echo "Done copying sources."
102+
cd "$OLDPWD"
103+
) || echo "Failed to copy subproject sources."
104+
'';
83105
};
84106
});
85107

0 commit comments

Comments
 (0)