summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2018-06-02 18:06:31 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2018-06-02 18:06:31 +0200
commit0a6b4afd95b381b44e59717839250e2bcbe248a1 (patch)
tree494f75ad029f4544c733ebbf9798cb3c29704232
parent54a7458a16580cae7d17d6c0ca2050504e3b476f (diff)
downloadnixos-0a6b4afd95b381b44e59717839250e2bcbe248a1.tar
nixos-0a6b4afd95b381b44e59717839250e2bcbe248a1.tar.gz
nixos-0a6b4afd95b381b44e59717839250e2bcbe248a1.tar.bz2
nixos-0a6b4afd95b381b44e59717839250e2bcbe248a1.tar.xz
nixos-0a6b4afd95b381b44e59717839250e2bcbe248a1.zip
...
-rw-r--r--custom/notify-user.hs4
-rw-r--r--custom/notify-users.nix4
2 files changed, 4 insertions, 4 deletions
diff --git a/custom/notify-user.hs b/custom/notify-user.hs
index f9cc2369..264d6f86 100644
--- a/custom/notify-user.hs
+++ b/custom/notify-user.hs
@@ -24,7 +24,7 @@ deriving instance Read Notify.Urgency
24 24
25main :: IO () 25main :: IO ()
26main = do 26main = do
27 envFiles <- glob "@userHome@/.dbus/session-bus/*" 27 envFiles <- glob "@home@/.dbus/session-bus/*"
28 forM_ envFiles $ \envFile -> do 28 forM_ envFiles $ \envFile -> do
29 sessionAddr <- unQuote . tail . snd . break (== '=') . head . filter ("DBUS_SESSION_BUS_ADDRESS=" `isPrefixOf`) . lines <$> readFile envFile 29 sessionAddr <- unQuote . tail . snd . break (== '=') . head . filter ("DBUS_SESSION_BUS_ADDRESS=" `isPrefixOf`) . lines <$> readFile envFile
30 setEnv "DBUS_SESSION_BUS_ADDRESS" sessionAddr 30 setEnv "DBUS_SESSION_BUS_ADDRESS" sessionAddr
@@ -37,7 +37,7 @@ main = do
37 ] 37 ]
38 let 38 let
39 urgency = fromMaybe Notify.Normal $ readMaybe . caseForRead =<< Map.lookup "urgency" opts 39 urgency = fromMaybe Notify.Normal $ readMaybe . caseForRead =<< Map.lookup "urgency" opts
40 appName = fromMaybe "notify-@userName@" $ Map.lookup "app-name" opts 40 appName = fromMaybe "notify-@user@" $ Map.lookup "app-name" opts
41 category = fromMaybe "" $ Map.lookup "category" opts 41 category = fromMaybe "" $ Map.lookup "category" opts
42 Notify.display_ $ Notify.summary summary <> Notify.body contents <> Notify.appName appName <> Notify.urgency urgency <> Notify.category category 42 Notify.display_ $ Notify.summary summary <> Notify.body contents <> Notify.appName appName <> Notify.urgency urgency <> Notify.category category
43 _ -> exitWith $ ExitFailure 2 43 _ -> exitWith $ ExitFailure 2
diff --git a/custom/notify-users.nix b/custom/notify-users.nix
index 82cbcc6c..296195f6 100644
--- a/custom/notify-users.nix
+++ b/custom/notify-users.nix
@@ -15,8 +15,8 @@ let
15 cp $src notify-user.hs 15 cp $src notify-user.hs
16 ''; 16 '';
17 17
18 inherit userName; 18 inherit user;
19 userHome = config.users.users."${userName}".home; 19 home = config.users.users."${userName}".home;
20 20
21 buildPhase = '' 21 buildPhase = ''
22 substituteAllInPlace notify-user.hs 22 substituteAllInPlace notify-user.hs