ryantm / home-manager-template

A quick-start template for using home-manager in a more reproducible way.
https://github.com/ryantm/home-manager-template
Creative Commons Zero v1.0 Universal
112 stars 5 forks source link

Is nix the only prerequisite? #1

Closed qrilka closed 4 years ago

qrilka commented 4 years ago

I have followed the instruction listed in the README and in the end I don't have any commands in my ~/.nix-profile/bin and thus switch.sh doesn't install anything. Any idea what could I be doing wrong? One note though that I don't use NixOS on this machine - I have Gentoo here.

ryantm commented 4 years ago

@qrilka Thanks for the report. I haven't tested it on non-NixOS systems. Is there any error message when you run it?

ryantm commented 4 years ago

I just tried it on Ubuntu 18.04 and it worked:

$ which fortune
/home/ryantm/.nix-profile/bin/fortune
qrilka commented 4 years ago

Actually I found a reason after I filed this issue but had no time to test it out before now - the problem is about my terminal emulator - home-manager fails because of missing terminfo. With that fixed I was able to switch now and my config is in https://github.com/qrilka/home Could I ask you a side question? Will this template still be needed when flakes will be merged into stable?

ryantm commented 4 years ago

@qrilka It will be possible to simplify it at the very least. It might be possible to make a flake repo that you invoke directly from Nix on a directory with a home.nix file in it. I should play around with that later :)

ryantm commented 4 years ago

@qrilka I figured this out!

  1. Navigate to directory with home.nix file in it.
  2. Run
    nix develop github:ryantm/home-manager-template/flakes -c home-manager switch

Caveats to this method: you have to be okay with whatever is pinned my flake.lock file. You can, of course, copy the flake.nix file into your directory, and use

nix develop -c home-manager switch

Then you are in control of the pinning.

ryantm commented 4 years ago

I have a tutorial for this at https://github.com/ryantm/home-manager-template/tree/flakes#tutorial now.

qrilka commented 2 years ago

@ryantm nix-2.4 was merged not so long ago, do you plan to merge flakes into master?

ryantm commented 2 years ago

@qrilka I think this repository may be outmoded by how home-manager works with flakes now. But flakes are not yet on a stable nix shipped with nixpkgs, so probably I'll wait to make any changes here.

qrilka commented 2 years ago

Thanks for letting me know, any particular link in HM docs that you could point me to? I was also waiting for flakes to land in stable nixpkgs BTW

ryantm commented 2 years ago

@qrilka https://nix-community.github.io/home-manager/index.html#ch-nix-flakes

I used that to flakify my config: https://github.com/ryantm/dotfiles

qrilka commented 2 years ago

Great, thanks, will take a look