-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Experimental NixOS module #97
Conversation
d7d0209
to
c155e81
Compare
1f22d1f
to
7265ef7
Compare
2ae06f3
to
5cd219e
Compare
451f9e2
to
f321512
Compare
1e0862e
to
e7eaf50
Compare
@infinisil It was quite tricky but I think I figured it out 😄 Please retry. Basically, if the user is logged in when the |
@flokli Sorry for leaving you waiting for so long. I've looked into the nixpkgs config option a bit. It is true that the
in my system configuration seems to work for me. I think it would be possible to make the |
This does not seem to work for me, I get an error when trying to rebuild with the home manager enabled, regardless of what I put inside
|
@throwup Please show your |
@infinisil here: |
@throwup Ah, i see, @rycee broke it with the latest commit in this branch :). Right here: 5af0d40#diff-40cef6e54189bc6970bd2e6427de09e6R165 This doesn't work because |
@infinisil Ok, that makes sense (I think). So do you suggest just waiting until it's fixed, or is there anything I can do? |
@throwup What you can do is just use the previous commit until it's fixed: {
imports = [
(import (builtins.fetchTarball https://github.com/rycee/home-manager/archive/804d1f4872dca47cd53ea566399ca489db678599.tar.gz) {}).nixos
];
} (Untested but 99% sure this should work) |
@throwup Sorry for the problems you've been having! I've been slowly working on a test framework that would have caught this type of silly coding errors but it's still in the pipeline :-( In any case, I've pushed a new version that should fix the error. Please give it a try. |
@rycee Hey, there's absolutely no need to apologize! With WIP-features you have to expect that some thing don't always work and it's not like I lost any considerable time/work through this bug. Moreover, you are working on this in your free time, for free so if anything I'd have to thank you for the great tools you are providing to all of us! |
@throwup Cool, thanks :-D Does it work OK for you now? Unless anybody has major concern I'll put together some news entry and merge this to master as an "experimental feature". Ideally we'll be able to get the user-pkg branch to work but there are still some issues with Qt applications installed that way. |
The example in the PR works well for me 👍 I'm currently only using it to configure Git though. I did run into some issues with an apparent local copy of Git on one system; the error output from the systemd service was a bit unclear about why a collision was occurring, so it took a little head scratching to figure out what was happening. Unfortunately I didn't think to keep any logs, or I'd leave them here, but steps to reproduce should essentially be:
To fix it I just had to do a |
At the moment most of the things work for me, however I might have found some bugs: |
@throwup Yeah, at the moment the For the session variables, are you using Home Manager to manage your Bash or Z shell configurations? If not then you unfortunately must source the |
@rummik Yeah, this collision problem is a bit unfortunate and several people have been bitten by it. The problem does not just apply to using Home Manager as a NixOS module but also when running through the |
@rycee I'd suggest adding a separate issue for the |
Ok, I've added a news entry and removed the WIP tag. It's a bit late to merge today so I will try to do it tomorrow. If there are any last major concerns then now is the time to raise them 😃 I also added a commit that should make the log entries for the activation scripts a bit prettier. Edit: Btw, I'll make sure not to immediately delete the branch after merge to allow people some time to switch over their import expressions. |
This is a NixOS module that is intended to be imported into a NixOS system configuration. It allows the system users to be set up directly from the system configuration. The actual profile switch is performed by a oneshot systemd unit per configured user that acts much like the regular `home-manager switch` command. With this implementation, the NixOS module does not work properly with the `nixos-rebuild build-vm` command. This can be solved by using the `users.users.<name?>.packages` option to install packages but this does not work flawlessly with certain Nixpkgs packages. In particular, for programs using the Qt libraries.
yay :-) |
With this it is possible to put, e.g.,
in the system
configuration.nix
and the user environment will be set up whennixos-rebuild switch
runs. No need to install Home Manager first.Hacky for now and some HM modules won't work.
Edit (2019-03-22): There are now some basic instructions on how to use the NixOS module in the Home Manager manual.