Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "installing with home-manager" to README #4

Closed
vroad opened this issue Mar 28, 2021 · 6 comments
Closed

Add "installing with home-manager" to README #4

vroad opened this issue Mar 28, 2021 · 6 comments

Comments

@vroad
Copy link

vroad commented Mar 28, 2021

I'm managing my home-manager package versions with niv, using the method described here:

https://github.com/ryantm/home-manager-template

It's worth noting that direnv-nix-lorelei can also be installed with home-manager.
I prefer this method over manual method mentioned in README, because niv allows pinning package versions in a simple manner.

niv add shajra/direnv-nix-lorelei -b master -n direnv-nix-lorelei
{ ... }:
let
  sources = import ./nix/sources.nix;
  direnv-nix-lorelei = import sources.direnv-nix-lorelei;
in
{
  home.username = "yourUserName";
  home.homeDirectory = "/home/yourUserName";

  home.stateVersion = "21.05";

  programs.bash = {
    enable = true;
  };
  programs.direnv = {
    enable = true;
    stdlib = ''
      source ${direnv-nix-lorelei.direnv-nix-lorelei}/share/direnv-nix-lorelei/nix-lorelei.sh
    '';
  };
}
@shajra-simspace
Copy link

I'm really apprehensive to suggesting to a user that they need to concern themself with yet another complex tool to install and configure, just to use Lorelei. If someone knows about Home-manager and is using it, is it possible that they would be advanced enough to figure out how to do what you're suggesting? Maybe the sourcing you're doing as part of Direnv configuration is kind of clever, and not something people would figure out.

Give me a moment to think about this. Maybe I'll start using home-manager and have some clarity. But if I modify this documentation to include anything about Home-manager, I'd likely update all of the READMEs for all my Nix projects. I just want these READMEs to be easy to read, and not confusing, because Nix is complex enough as it is.

@vroad
Copy link
Author

vroad commented Mar 30, 2021

Maybe the sourcing you're doing as part of Direnv configuration is kind of clever, and not something people would figure out.

At least for me it was not very obvious, since I never worked with direnv's stdlib configuration. It took me a while to figure out that I could configure direnv in this way.

I could put above configuration to somewhere else such as unofficial nixos wiki, if you think that adding this to README.md is not a good idea.

@vroad
Copy link
Author

vroad commented Mar 30, 2021

Or, we could provide an out-of-tree home-manager module that can be used simply by importing and enabling it.

Give me a moment to think about this. Maybe I'll start using home-manager and have some clarity. But if I modify this documentation to include anything about Home-manager, I'd likely update all of the READMEs for all my Nix projects. I just want these READMEs to be easy to read, and not confusing, because Nix is complex enough as it is.

Have you created other tools that needs installation to user's ~/.config directory, like direnv-nix-lorelei? If you have, could show me some examples?

@vroad
Copy link
Author

vroad commented Apr 7, 2021

To simplify install and upgrade for existing home-manager use that don't currently use niv, I created a pull request that adds home-manager module to lorelei.
I leave it draft because I haven't add description of the module to README.

#5

@shajra
Copy link
Owner

shajra commented Jul 3, 2021

Hey @vroad thanks for hanging in there. I get really busy with personal stuff and work. But I'm actually slowly migrating one of my configurations to use home-manager. So the good part is that I'll finally be able to test anything I document. So not sure if I'll use your PR or not, but I'm trying to make some forward progress resolving this issue now.

@shajra
Copy link
Owner

shajra commented Sep 5, 2021

@vroad it took forever, but I did finally get a Home Manager module into the latest version of this code. I wanted to actually consume it myself, so that I could verify typos and the instructions for using it. I feel somewhat justified in that decision because I did indeed have typos and steps that didn't work as authored originally.

Anyway, it's all in the main branch now. See the top-level README.md, and the module itself under nix/home.nix. The module is unsurprisingly close to what you submitted. It's not like there's a lot of room for innovation when it comes to laying down a single symlink. Differences were just naming/wording to meet my own preferences.

Closing this ticket now. Feel free to reopen or open another if there's a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants