You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to run the same config multiple times and the fact that I used recursive = true; did not make the onChange script run, It only was run when text was changed.
If the file source is a directory, then this option determines whether the directory should be recursively linked to the target location. This option has no effect if the source is a file.
If false (the default) then the target will be a symbolic link to the source directory. If true then the target will be a directory structure matching the source’s but whose leafs are symbolic links to the files of the source directory.
This supposed to link all internal files separately, but it still links the whole directory, same way if I don't use recursive = true;.
Both use cases say to me that the recursive state is ignored, which is why none of its functionality is working.
This is very useful for debugging onChange code (when creating new stuff), but of course it has many other advantages, and yet I can't take advantage of any of that. :/
The quoted sentence is from paragraph about recursive linking, so it has no effect on that behavior. But from the onChange documentation it explicitly only talks about files and that it will always run off recusive is enabled without any exception.
This actually says to me that the documentation is poorly written as it can cause confusion and misunderstanding, like what you've quoted. It should be more explicit what "no effect" means exactly (it should have an effect if onChange is set) and what happens if source is a directory (instead of a file) and onChange is set. I'm guessing it's exactly the same as with file, but not explicitly mentioned.
But I think it's more important to address the main issue first and only then improve the documentation according to the revised behavior.
Are you following the right branch?
Is there an existing issue for this?
Issue description
https://nix-community.github.io/home-manager/options.xhtml#opt-xdg.configFile._name_.onChange:
I tried that last perk with NixOS 25.05 (nixpkgs unstable) and home-manager master, but it doesn't work.
I tried to run the same config multiple times and the fact that I used
recursive = true;
did not make theonChange
script run, It only was run whentext
was changed.Another example:
https://nix-community.github.io/home-manager/options.xhtml#opt-xdg.configFile._name_.recursive:
This supposed to link all internal files separately, but it still links the whole directory, same way if I don't use
recursive = true;
.Both use cases say to me that the
recursive
state is ignored, which is why none of its functionality is working.This is very useful for debugging
onChange
code (when creating new stuff), but of course it has many other advantages, and yet I can't take advantage of any of that. :/Maintainer CC
@emilazy @rycee
System information
The text was updated successfully, but these errors were encountered: