From e41925f463af8e11881e94e286422582faefc5b1 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 21 Jul 2016 21:25:01 +0200 Subject: no shellmate --- custom/notify-user.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/custom/notify-user.nix b/custom/notify-user.nix index 0b98d672..b8293e49 100644 --- a/custom/notify-user.nix +++ b/custom/notify-user.nix @@ -7,23 +7,23 @@ stdenv.mkDerivation { name = ''notify-${user}''; src = writeTextFile { name = ''notify-${user}.hs''; text = '' - import Control.Shell import System.FilePath.Glob (glob) import System.Directory (setCurrentDirectory) + import System.Environment (setEnv, getArgs) import Data.List (isPrefixOf) main = do setCurrentDirectory "/" - shell_ $ do - (envFile:_) <- liftIO $ glob "/home/${user}/.dbus/session-bus/*-0" - sessionAddr <- snd . break (== '=') . head . filter ("DBUS_SESSION_BUS_ADDRESS=" `isPrefixOf`) . lines <$> input envFile - env <- getShellEnv - withEnv "DBUS_SESSION_BUS_ADDRESS" sessionAddr $ run "${libnotify}/bin/notify-send" cmdline + (envFile:_) <- glob "/home/${user}/.dbus/session-bus/*-0" + sessionAddr <- snd . break (== '=') . head . filter ("DBUS_SESSION_BUS_ADDRESS=" `isPrefixOf`) . lines <$> readFile envFile + setEnv "DBUS_SESSION_BUS_ADDRESS" sessionAddr + proc "${libnotify}/bin/notify-send" =<< getArgs + ''; }; phases = [ "buildPhase" "installPhase" ]; buildPhase = '' - ${ghcWithPackages (p: with p; [ shellmate Glob directory ])}/bin/ghc -odir . -hidir . $src -o notify-${user} + ${ghcWithPackages (p: with p; [ Glob directory process ])}/bin/ghc -odir . -hidir . $src -o notify-${user} ''; installPhase = '' mkdir -p $out/bin -- cgit v1.2.3