-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Knowledge of Nix's installation directories.
--   
--   This module provides full paths to various Nix utilities, like
--   <tt>nix-store</tt>, <tt>nix-instantiate</tt>, and <tt>nix-env</tt>.
@package nix-paths
@version 1.0.1

module Nix.Paths

-- | Complete path to the <tt>nix-instantiate</tt> executable.
nixInstantiate :: FilePath

-- | Complete path to the <tt>nix-build</tt> executable.
nixBuild :: FilePath

-- | Complete path to the <tt>nix-env</tt> executable.
nixEnv :: FilePath

-- | Complete path to the <tt>nix-store</tt> executable.
nixStore :: FilePath

-- | Complete path to the <tt>nix-hash</tt> executable.
nixHash :: FilePath

module Nix.FindFile

-- | Use <tt>nix-instantiate --find-file</tt> to resolve an abbreviated
--   path into a full absolute path using <tt>$NIX_PATH</tt>.
--   
--   <pre>
--   &gt;&gt;&gt; findFile "nixpkgs/pkgs/development/haskell-modules/configuration-hackage2nix.yaml"
--   Just "/home/foobar/.nix-defexpr/pkgs/development/haskell-modules/configuration-hackage2nix.yaml"
--   </pre>
--   
--   <pre>
--   &gt;&gt;&gt; findFile "nixpkgs/crazy/non-existent-path"
--   Nothing
--   </pre>
findFile :: FilePath -> IO (Maybe FilePath)

-- | A convenience wrapper around <a>findFile</a> that returns the given
--   default value in case the function returns nothing.
--   
--   <pre>
--   findFileWithDefault def = <a>fmap</a> (<a>fromMaybe</a> def) . <a>findFile</a>
--   </pre>
findFileWithDefault :: FilePath -> FilePath -> IO FilePath
