nix/lib/qs-open-dir.nix
Markus Zoppelt bbf5b713c9 fix: harden Quickshell launches, folder opens, and untrusted UI
Stop systemd-run option injection, open Syncthing folders only via a
store-pinned real-directory helper, treat labels as PlainText, and
allowlist image URLs.
2026-08-26 17:11:21 +02:00

15 lines
358 B
Nix

{ pkgs }:
pkgs.writeShellApplication {
name = "qs-open-dir";
runtimeInputs = with pkgs; [
coreutils
xdg-utils
];
text = ''
path=''${1-}
[[ $path == /* && $path != *://* && $path != *$'\n'* ]] || exit 1
real=$(realpath -e -- "$path")
[[ $real == "$path" && -d $path && ! -L $path ]] || exit 1
exec xdg-open "$path"
'';
}