From d61f49772f4b7ad39dc2fcbd463ad8671e819a3a Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 21 Jul 2016 21:55:37 +0200 Subject: escape summary --- custom/notify-user.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/custom/notify-user.nix b/custom/notify-user.nix index 7eda86c9..d3e69bcd 100644 --- a/custom/notify-user.nix +++ b/custom/notify-user.nix @@ -10,6 +10,7 @@ stdenv.mkDerivation { import System.FilePath.Glob (glob) import System.Environment (setEnv, getArgs) import System.Process (callProcess) + import System.Posix.Escape (escape) import Data.List (isPrefixOf, dropWhileEnd) import Data.Char (isSpace) @@ -21,12 +22,12 @@ stdenv.mkDerivation { forM_ envFiles $ \envFile -> do sessionAddr <- tail . snd . break (== '=') . head . filter ("DBUS_SESSION_BUS_ADDRESS=" `isPrefixOf`) . lines <$> readFile envFile setEnv "DBUS_SESSION_BUS_ADDRESS" sessionAddr - callProcess "${libnotify}/bin/notify-send" =<< (++) <$> getArgs <*> (pure . dropWhileEnd isSpace <$> getContents) + callProcess "${libnotify}/bin/notify-send" =<< (++) <$> getArgs <*> (pure . escape . dropWhileEnd isSpace <$> getContents) ''; }; phases = [ "buildPhase" "installPhase" ]; buildPhase = '' - ${ghcWithPackages (p: with p; [ Glob process ])}/bin/ghc -odir . -hidir . $src -o notify-${user} + ${ghcWithPackages (p: with p; [ Glob process posix-escape ])}/bin/ghc -odir . -hidir . $src -o notify-${user} ''; installPhase = '' mkdir -p $out/bin -- cgit v1.2.3