<drozdziak1>
How do I get current user's `HOME` in a home.nix?
<drozdziak1>
I'm trying to port the borgbackup module from nixos
rajivr has joined #home-manager
<nicolas[m]>
drozdziak1 You can use `home.homeDirectory` in a Nix expression or `$HOME` in a script
cole-h has quit [Quit: Goodbye]
cole-h has joined #home-manager
<drozdziak1>
nicolas[m]: Can I use any of that from a module?
<nicolas[m]>
drakonis I don't know anything preventing that, so I think it should work
<drozdziak1>
nicolas[m]: How can I access it from a module closure? (config.home didn't work afaict)
ryantrinkle has quit [Ping timeout: 260 seconds]
ryantrinkle has joined #home-manager
stephank has quit [Quit: stephank]
stephank has joined #home-manager
kini has quit [Quit: bye]
kini has joined #home-manager
kini has quit [Quit: bye]
kini has joined #home-manager
<nicolas[m]>
drozdziak1 If the module is loaded by Home-Manager, then `config.home.homeDirectory` should be available as long as your module has `{ config, pkgs, ...}` or an equivalent to access the config
<nicolas[m]>
Another solution, that I do not recommend, is using `builtins.getEnv "HOME"`
<nicolas[m]>
getEnv is impure and will not work with flake configurations (aka a "pure" evaluation)