diff options
author | Gregor Kleen <pngwjpgh@users.noreply.github.com> | 2016-07-21 21:13:46 +0200 |
---|---|---|
committer | Gregor Kleen <pngwjpgh@users.noreply.github.com> | 2016-07-21 21:13:46 +0200 |
commit | 9f173f3e4449b5ddd94fbfbbfbf76678289c849c (patch) | |
tree | fc9e48c2943de0c25d492c635a01cd7a048e7553 /custom | |
parent | 4f580038cc13372e482e76ac181406c6354cd992 (diff) | |
download | nixos-9f173f3e4449b5ddd94fbfbbfbf76678289c849c.tar nixos-9f173f3e4449b5ddd94fbfbbfbf76678289c849c.tar.gz nixos-9f173f3e4449b5ddd94fbfbbfbf76678289c849c.tar.bz2 nixos-9f173f3e4449b5ddd94fbfbbfbf76678289c849c.tar.xz nixos-9f173f3e4449b5ddd94fbfbbfbf76678289c849c.zip |
fix working directory problems
Diffstat (limited to 'custom')
-rw-r--r-- | custom/notify-user.nix | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/custom/notify-user.nix b/custom/notify-user.nix index f433f4a7..f95bc43d 100644 --- a/custom/notify-user.nix +++ b/custom/notify-user.nix | |||
@@ -12,11 +12,15 @@ stdenv.mkDerivation { | |||
12 | 12 | ||
13 | import Data.List (isPrefixOf) | 13 | import Data.List (isPrefixOf) |
14 | 14 | ||
15 | main = shell_ $ do | 15 | import Data.Either (either) |
16 | (envFile:_) <- liftIO $ glob "/home/${user}/.dbus/session-bus/*-0" | 16 | |
17 | sessionAddr <- snd . break (== '=') . head . filter ("DBUS_SESSION_BUS_ADDRESS=" `isPrefixOf`) . lines <$> input envFile | 17 | main = do |
18 | env <- getShellEnv | 18 | env <- shellEnv |
19 | withEnv "DBUS_SESSION_BUS_ADDRESS" sessionAddr $ run "${libnotify}/bin/notify-send" cmdline | 19 | either print return =<< runSh (env { envWorkDir = "/" } ) $ do |
20 | (envFile:_) <- liftIO $ glob "/home/${user}/.dbus/session-bus/*-0" | ||
21 | sessionAddr <- snd . break (== '=') . head . filter ("DBUS_SESSION_BUS_ADDRESS=" `isPrefixOf`) . lines <$> input envFile | ||
22 | env <- getShellEnv | ||
23 | withEnv "DBUS_SESSION_BUS_ADDRESS" sessionAddr $ run "${libnotify}/bin/notify-send" cmdline | ||
20 | ''; }; | 24 | ''; }; |
21 | phases = [ "buildPhase" "installPhase" ]; | 25 | phases = [ "buildPhase" "installPhase" ]; |
22 | buildPhase = '' | 26 | buildPhase = '' |