From 3e23a79863ff92c6a4b23b3bf457afcd529e790f Mon Sep 17 00:00:00 2001 From: rafaeloledo Date: Tue, 18 Mar 2025 23:07:51 -0300 Subject: [PATCH] docs: add docs for mkOutOfStoreSymlink --- 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;