lix/doc/manual/rl-next/relative-and-tilde-paths-in-config.md

1.2 KiB

synopsis issues cls category credits
Relative and tilde paths in configuration
fj#482
1851
1863
1864
Features
9999years

Configuration settings can now refer to files with paths relative to the file they're written in or relative to your home directory (with ~/).

This makes settings like repl-overlays and secret-key-files much easier to set, especially if you'd like to refer to files in an existing dotfiles repo cloned into your home directory.

If you put repl-overlays = repl.nix in your ~/.config/nix/nix.conf, it'll load ~/.config/nix/repl.nix. Similarly, you can set repl-overlays = ~/.dotfiles/repl.nix to load a file relative to your home directory.

Configuration files can also include paths relative to your home directory.

Only user configuration files (like $XDG_CONFIG_HOME/nix/nix.conf or the files listed in $NIX_USER_CONF_FILES) can use tilde paths relative to your home directory. Configuration listed in the $NIX_CONFIG environment variable may not use relative paths.