Skip to content

RediWM is a Wayland compositor written in Zig (OpenGL ES) that includes everything in one process

nix fixes

oxydizer805d86632c18
diff --git a/docs/nix.md b/docs/nix.md
index d28e60b..19b4955 100644
--- a/docs/nix.md
+++ b/docs/nix.md
@@ -82,5 +82,9 @@ in `patches/wlroots/`. Update Nixpkgs deliberately with
`nix flake update nixpkgs`, then rerun the checks.
Nix-specific runtime path substitutions live in `nix/runtime-paths.nix` and
-fail if their source text changes. The PDF sandbox grants access only to
-specific font and Poppler data directories, not the whole Nix store.
+fail if their source text changes. Privileged helpers use `platform.tool`'s
+trusted directories, with `/run/wrappers/bin` and the packaged systemd's
+`bin` directory searched first. Ordinary helpers such as `locale` and
+`paplay` come from the package wrapper's `PATH`. The PDF sandbox grants
+access only to specific font and Poppler data directories, not the whole
+Nix store.
diff --git a/nix/package.nix b/nix/package.nix
index 1d7e4bc..206ce1d 100644
--- a/nix/package.nix
+++ b/nix/package.nix
@@ -140,8 +140,6 @@ stdenv.mkDerivation {
lib
tzdata
systemd
- glibc
- pulseaudio
dejavu_fonts
fontconfig
poppler_data
@@ -184,6 +182,8 @@ stdenv.mkDerivation {
xwayland
xdg-utils
glib
+ glibc # locale, spawned by the Region settings page.
+ pulseaudio # paplay, resolved on PATH for event sounds.
]
} \
--suffix XDG_DATA_DIRS : "$out/share:${
diff --git a/nix/runtime-paths.nix b/nix/runtime-paths.nix
index 4d78a28..0c8eea8 100644
--- a/nix/runtime-paths.nix
+++ b/nix/runtime-paths.nix
@@ -2,8 +2,6 @@
lib,
tzdata,
systemd,
- glibc,
- pulseaudio,
dejavu_fonts,
fontconfig,
poppler_data,
@@ -14,17 +12,12 @@
''
substituteInPlace src/polkit/native.c \
--replace-fail 'const char *paths[] = {' 'const char *paths[] = {"/run/wrappers/bin/polkit-agent-helper-1", '
- substituteInPlace src/systemd_edit.zig \
- --replace-fail '/usr/bin/pkexec' '/run/wrappers/bin/pkexec' \
- --replace-fail 'else "/bin/pkexec"' 'else "/run/wrappers/bin/pkexec"' \
- --replace-fail '/usr/bin/systemctl' '${lib.getExe' systemd "systemctl"}' \
- --replace-fail 'else "/bin/systemctl"' 'else "${lib.getExe' systemd "systemctl"}"'
+ # Privileged helpers use trusted directories, never the session's PATH.
+ substituteInPlace src/platform/tool.zig \
+ --replace-fail 'const system_dirs = [_][]const u8{' \
+ 'const system_dirs = [_][]const u8{ "/run/wrappers/bin", "${lib.getBin systemd}/bin",'
substituteInPlace src/config_runtime/region.zig src/control_center/sections/region.zig \
--replace-fail '/usr/share/zoneinfo' '${tzdata}/share/zoneinfo'
- substituteInPlace src/control_center/sections/region.zig \
- --replace-fail '/usr/bin/locale' '${lib.getBin glibc}/bin/locale'
- substituteInPlace src/audio/sounds.zig \
- --replace-fail '/usr/bin/paplay' '${lib.getExe' pulseaudio "paplay"}'
# Permit only these font/character-map data directories after Landlock,
# never the whole Nix store. The UI's selected fonts are opened beforehand.
substituteInPlace src/pdf/sandbox.c \