From 6b374caa40dd3c5f23022f0ff092cd828e0418a8 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 21 Jul 2016 16:51:20 +0200 Subject: more lightweight notify-user --- custom/notify-user.nix | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 custom/notify-user.nix (limited to 'custom') diff --git a/custom/notify-user.nix b/custom/notify-user.nix deleted file mode 100644 index ae8ea56c..00000000 --- a/custom/notify-user.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ stdenv, writeTextFile -, ghcWithPackages -, user ? "gkleen" -, libnotify -}: - -stdenv.mkDerivation { - name = ''notify-${user}''; - src = writeTextFile { name = ''notify-${user}.hs''; text = '' - import Control.Shell - import System.FilePath.Glob (glob) - - import Data.List (isPrefixOf) - - main = 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 - ''; }; - phases = [ "buildPhase" "installPhase" ]; - buildPhase = '' - ${ghcWithPackages (p: with p; [ shellmate Glob ])}/bin/ghc -odir . -hidir . $src -o notify-${user} - ''; - installPhase = '' - mkdir -p $out/bin - install -m 755 notify-${user} $out/bin - ''; -} -- cgit v1.2.3