I am new to NixOS and trying to call emacs from a Haskell program using the following function:
ediff :: String -> String -> String -> IO () ediff testName ab = do a' <- writeSystemTempFile (testName ++ ".expected") a b' <- writeSystemTempFile (testName ++ ".received") b let quote s = "\"" ++ s ++ "\"" callCommand $ "emacs --eval \'(ediff-files " ++ quote a' ++ quote b' ++ ")\'"
When I run a program that calls this command using the stack test , I get the following result (briefly with the unit test results):
/bin/sh: emacs: command not found Exception: callCommand: emacs --eval '(ediff-files "/run/user/1000/ast1780695788709393584.expected" "/run/user/1000/ast4917054031918502651.received")'
When I run a command that did not run from my shell, it works flawlessly. How can I start processes from Haskell to NixOS, as if I were invoking them directly so that they could access the same commands and configurations as my user?
source share