Home Manager: Difference between revisions

imported>Inifaisal
mNo edit summary
imported>Oluceps
add notice about home on tmpfs with standalone-installed home-manager
Line 122: Line 122:


Consider some of the workarounds here: https://github.com/nix-community/home-manager/issues/1439.
Consider some of the workarounds here: https://github.com/nix-community/home-manager/issues/1439.
=== Workaround with <code>home on tmpfs</code> and standalone installation ===
home-on-tmpfs users who installed home-manager standalone may meet problems that cannot load configs after reboot, caused by auto cleaning symlink under the toplevel of the home directory. You need to ensure <code>/home/<user>/.nix-profile</code> exists since the standalone install will not act symlink while the system boots.
If your toplevel of home is on tmpfs, one possible workaround is manually write <code>activationScripts</code> to link the directory:
<syntaxHighlight lang="nix">
  system.activationScripts = {
    # workaround with tmpfs as home and home-manager, since it not preserve
    # ~/.nix-profile symlink after reboot.
    profile-init.text =
      ''
        ln -sfn /home/${user}/.local/state/nix/profiles/profile /home/${user}/.nix-profile
      '';
  };
</syntaxHighlight>


== Alternatives ==
== Alternatives ==