From a2c5c016a4e0997de31b0b5df492c0999d66710c Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 14 May 2016 19:05:05 +0200 Subject: thinklight setUserID --- custom/thinklight.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'custom/thinklight.nix') diff --git a/custom/thinklight.nix b/custom/thinklight.nix index 87a5264e..bd0fd6d9 100644 --- a/custom/thinklight.nix +++ b/custom/thinklight.nix @@ -2,7 +2,7 @@ stdenv.mkDerivation { name = "thinklight-0.1"; - ghc = haskellPackages.ghcWithPackages (self: [self.strict]); + ghc = haskellPackages.ghcWithPackages (self: [self.strict self.unix]); outputs = [ "out" ]; buildInputs = [ makeWrapper ]; builder = builtins.toFile "builder.sh" '' @@ -21,6 +21,7 @@ stdenv.mkDerivation { import Prelude hiding (readFile) import Data.List (intersperse) import Data.Maybe (fromMaybe) + import System.Unix.User (setUserID) data Mode = On | Off | Toggle | Blink deriving (Read, Show, Eq) @@ -28,6 +29,7 @@ stdenv.mkDerivation { main = do args <- getArgs let mode = if length args >= 1 then read $ head args else Toggle + setUserID 0 sequence $ map (\g -> catchIOError g (\e -> if isDoesNotExistError e then return () else ioError e)) [thinklight mode] return () -- cgit v1.2.3