summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <pngwjpgh@users.noreply.github.com>2016-07-21 21:25:01 +0200
committerGregor Kleen <pngwjpgh@users.noreply.github.com>2016-07-21 21:25:01 +0200
commite41925f463af8e11881e94e286422582faefc5b1 (patch)
treedc4af5d6cb2d1a31c7ab5b482374d6e0a10b25db
parent6e867ad68daf9dd934e87edac4ad61accf4a7fe6 (diff)
downloadnixos-e41925f463af8e11881e94e286422582faefc5b1.tar
nixos-e41925f463af8e11881e94e286422582faefc5b1.tar.gz
nixos-e41925f463af8e11881e94e286422582faefc5b1.tar.bz2
nixos-e41925f463af8e11881e94e286422582faefc5b1.tar.xz
nixos-e41925f463af8e11881e94e286422582faefc5b1.zip
no shellmate
-rw-r--r--custom/notify-user.nix14
1 files 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 @@
7stdenv.mkDerivation { 7stdenv.mkDerivation {
8 name = ''notify-${user}''; 8 name = ''notify-${user}'';
9 src = writeTextFile { name = ''notify-${user}.hs''; text = '' 9 src = writeTextFile { name = ''notify-${user}.hs''; text = ''
10 import Control.Shell
11 import System.FilePath.Glob (glob) 10 import System.FilePath.Glob (glob)
12 import System.Directory (setCurrentDirectory) 11 import System.Directory (setCurrentDirectory)
12 import System.Environment (setEnv, getArgs)
13 13
14 import Data.List (isPrefixOf) 14 import Data.List (isPrefixOf)
15 15
16 main = do 16 main = do
17 setCurrentDirectory "/" 17 setCurrentDirectory "/"
18 shell_ $ do 18 (envFile:_) <- glob "/home/${user}/.dbus/session-bus/*-0"
19 (envFile:_) <- liftIO $ glob "/home/${user}/.dbus/session-bus/*-0" 19 sessionAddr <- snd . break (== '=') . head . filter ("DBUS_SESSION_BUS_ADDRESS=" `isPrefixOf`) . lines <$> readFile envFile
20 sessionAddr <- snd . break (== '=') . head . filter ("DBUS_SESSION_BUS_ADDRESS=" `isPrefixOf`) . lines <$> input envFile 20 setEnv "DBUS_SESSION_BUS_ADDRESS" sessionAddr
21 env <- getShellEnv 21 proc "${libnotify}/bin/notify-send" =<< getArgs
22 withEnv "DBUS_SESSION_BUS_ADDRESS" sessionAddr $ run "${libnotify}/bin/notify-send" cmdline 22
23 ''; }; 23 ''; };
24 phases = [ "buildPhase" "installPhase" ]; 24 phases = [ "buildPhase" "installPhase" ];
25 buildPhase = '' 25 buildPhase = ''
26 ${ghcWithPackages (p: with p; [ shellmate Glob directory ])}/bin/ghc -odir . -hidir . $src -o notify-${user} 26 ${ghcWithPackages (p: with p; [ Glob directory process ])}/bin/ghc -odir . -hidir . $src -o notify-${user}
27 ''; 27 '';
28 installPhase = '' 28 installPhase = ''
29 mkdir -p $out/bin 29 mkdir -p $out/bin