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

NixOS module optional support for user packages #580

Closed
wants to merge 2 commits into from

Conversation

rycee
Copy link
Member

@rycee rycee commented Feb 11, 2019

No description provided.

@rycee rycee changed the title NixOS module optional support for user packages [WIP] NixOS module optional support for user packages Feb 11, 2019
kalbasit added a commit to kalbasit/shabka that referenced this pull request Feb 12, 2019
…me?>.packages (#159)

Switch home manager to nix-community/home-manager#580 in order to install user packages through NixOS's user packages. This allows me to build VM that are able to have user packages.
@rycee rycee changed the title [WIP] NixOS module optional support for user packages NixOS module optional support for user packages Feb 12, 2019
@infinisil
Copy link
Collaborator

infinisil commented Feb 14, 2019

Lots of places such as https://github.com/rycee/home-manager/blob/2093cf425ff6af786a2effc776d3ac89b6787c0a/modules/programs/zsh.nix#L347 still end up being ~/.nix-profile/..., which doesn't work with this. Edit: Nevermind, I didn't look at the code in this PR, just realized it's opt-in :)

Also it would be neat if the home-manager nix-env package could be uninstalled automatically, but that might be a bit ugly. You're doing that already too, now I feel stupid!

@rycee
Copy link
Member Author

rycee commented Feb 14, 2019

@infinisil I enjoyed that review 😀

I tried to be fairly careful about this change although I still don't entirely trust the /etc/profiles way of installing because I suspect it is not widely used. But I think it was a good idea of @kalbasit and @marsam to finally merge it to master with a feature flag.

I'll see about merging this on the weekend.

When using the NixOS module we cannot guarantee that the Nix store
will be writable during startup. Installing the user packages through
`nix-env -i` will fail in these cases.

This commit adds a NixOS option `home-manager.useUserPackages` that,
when enabled, installs user packages through the NixOS

    users.users.<name?>.packages

option.

Note, when submodule support and external package install is enabled
then the installed packages are not available in `~/.nix-profile`. We
therefore set `home.profileDirectory` directly to the HM profile
packages.
@rycee
Copy link
Member Author

rycee commented Feb 16, 2019

Rebased to master in 799a90e with a brief news entry added. Thanks everybody for the input and patience in getting this merged 🙂

@rycee rycee closed this Feb 16, 2019
@rycee rycee deleted the nixos-module-user-pkgs-v2 branch February 16, 2019 20:56
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

Successfully merging this pull request may close these issues.

None yet

2 participants