From e355ae93a3cdaff64a3152c78b944ef36a85e8ce Mon Sep 17 00:00:00 2001 From: Rafael Ledo Date: Tue, 1 Apr 2025 21:06:02 -0300 Subject: [PATCH] docs: add docs for mkOutOfStoreSymlink (#6660) --- modules/files.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/files.nix b/modules/files.nix index d359979db..c8791a46f 100644 --- a/modules/files.nix +++ b/modules/files.nix @@ -59,6 +59,14 @@ in }) ]; + # Using this function it is possible to make `home.file` create a + # symlink to a path outside the Nix store. For example, a Home Manager + # configuration containing + # + # `home.file."foo".source = config.lib.file.mkOutOfStoreSymlink ./bar;` + # + # would upon activation create a symlink `~/foo` that points to the + # absolute path of the `bar` file relative the configuration file. lib.file.mkOutOfStoreSymlink = path: let pathStr = toString path;