Is there a list?
For example:
-
“Nix path to string” scenarios1:
-
builtins.toString
./a_file
returns absolute path toa_file
as a string (or an error if it doesn’t exist
not copied to the Nix store -
string interpolation (e.g.,
"${./a_file}"
)
coptied to the Nix store and returns the absolute path to it as a string
-
-
“bare” Nix paths in
mkShell
when assigning to environment variables:{ pkgs ? import <nixpkgs> {} }: pkgs.mkShell { buildInputs = [ # ... ]; # environment variable GIT_CONFIG_GLOBAL = ./assets/git.conf; # equivalent to: shellHook = let gitConf = pkgs.writeText "git.conf" (builtins.readFile ./assets/git.conf) ; in '' # VV.......V export GIT_CONFIG_GLOBAL="${gitConf}" # ^^.......^ # # That's Nix's string interpolation! # Use ''\{..} for Bash's string interpolation. '' ; }
-
Haven’t packaged anything yet with Nix, but what I remember from the manuals is that any path that appears in builder shell scripts will get put into the Nix store as well. (Right?)
[1]: Relevant threads: