-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Allow multiple installation of home-manager to co-exist on the same system #1156
base: master
Are you sure you want to change the base?
Allow multiple installation of home-manager to co-exist on the same system #1156
Conversation
@rycee the tests work locally for me, do you happen to know why they are failing here? |
It was due to some change w.r.t tmux plugins in Nixpkgs. I've resolved it in master so hopefully it should build ok if you rebase. |
010c785
to
a5143c4
Compare
Thank you for your contribution! I marked this pull request as stale due to inactivity. If this remains inactive for another 7 days, I will close this PR. Please read the relevant sections below before commenting. If you are the original author of the PR
If you are not the original author of the issue
|
I guess this was ready and potentially useful? |
Yeah, I've been meaning to revisit this. |
Hi, Work seamlessly to support 2 profiles, one for x86_64 and one for aarch64 on a same shared $HOME, with: ({ ... }: {
home.sessionVariablesFileName = "hm-x86_64-session-vars.sh";
home.sessionVariablesGuardVar = "__HM_X86_64_SESS_VARS_SOURCED";
home.pathName = "home-manager-x86_64_path";
home.gcLinkName = "current-home-x86_64";
home.generationLinkNamePrefix = "home-manager-x86_64";
}) or ({ ... }: {
home.sessionVariablesFileName = "hm-aarch64-session-vars.sh";
home.sessionVariablesGuardVar = "__HM_AARCH64_SESS_VARS_SOURCED";
home.pathName = "home-manager-aarch64_path";
home.gcLinkName = "current-home-aarch64";
home.generationLinkNamePrefix = "home-manager-aarch64";
}) It solves #2542. |
@dguibert if you've resolved merge conflicts, do you mind sharing a branch with me I can merge here to update this PR? Thanks! |
sure, here it is: https://github.com/dguibert/home-manager/tree/dg/merge-1156 |
Hi @kalbasit, |
@dguibert thank you, that helped a lot. I went ahead and merged your branch, and merged the current master as well. |
@rycee, what's needed to get this considered and merged? |
Hi @rycee, I'm still using it and need to resolve conflicts (from time to time): I've also extend it with How can I help for this to be merged? |
Hi
I've updated this branch https://github.com/dguibert/home-manager/commits/allow-setting-gcroot-link-name
Hope to see this considered merged. |
Hello! From a usability point of view I think it would be much nicer to have a single variable like a home-manager profile name, that is then used in all these points that are specific to an 'instance' of home-manager. 👉 This way we don't need to know that all these variables are related and should change together. We could say that now the default profile name is And if backward compatibility is really something you want to keep, we could always default the profile name to null/false, and handle this. WDYT? |
I think it can be added on top of this by introducing a module option, like you mention, if it's |
Where are we on this, it seems like a useful addition? |
I haven't had a reason to use multiple profiles myself for a long while and so I haven't been maintaining this PR. I think a top-level profileName makes sense to me as long as it does not change current behavior or break existing installation. If anyone's willing to do that work, I'd be happy to test it and incorporate that into this PR. @rycee does that work for you? We should probably consolidate our effort and get this merged in as it's been lingering for quite some time now. |
Thx, hope we could polish this to get merged. I've rebased the branch and introduce an option @kalbasit, it can be found https://github.com/dguibert/home-manager/commits/allow-setting-gcroot-link-name-rebased |
d5f660e
to
ccb8231
Compare
When I try to merge your branch, it conflicts with mine
|
That's because my branch is a rebased of yours on top of master. |
ccb8231
to
6f9ac2d
Compare
@dguibert done. Do you mind testing? If it works, please ensure your branch is based back off of this one so any more changes on your end I can easily bring to my side. |
By changing the GC link name, one could have multiple installations of home-manager to co-exist without interfering with each other.
…-path derivation By changing the name of the derivation, one could have multiple installations of home-manager to co-exist without interfering with each other.
By changing the name of the session vars, one could have multiple installations of home-manager to co-exist without interfering with each other.
…ssVars By changing the variable name, one could have multiple installations of home-manager to co-exist without interfering with each other.
6f9ac2d
to
db8db79
Compare
@dguibert do you mind taking a look at the failing test? |
sure, |
Description
I currently have home-manager installed as a user to manage my own system, and I'm working to include home-manager as a submodule of our repository at work so we could install systemd units. This pull request changes some hardcoded settings to options so we can customize the activation script to not disrupt the other installation. All options are marked as internal to avoid documenting them because I have not updated any of the shell scripts (besides the activation) to refer to the options instead of the hardcoded values as I do not see the point of having multiple installations both managed by the user via home-manager command.
Checklist
Code formatted with
./format
.Code tested through
nix-shell --pure tests -A run.all
.Test cases updated/added. See example.
Commit messages are formatted like
See CONTRIBUTING for more information and recent commit messages for examples.
If this PR adds a new module
Added myself as module maintainer. See example.
Added myself and the module files to
.github/CODEOWNERS
.