-
Notifications
You must be signed in to change notification settings - Fork 15
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
Same username, different homeConfigurations #11
Comments
You don't need to have the same |
I'm using |
Is there a resolution to this? I am also interested in the same problem. |
I've created a PR that should be able fix this issue, but when finishing it, I noticed a simpler solution. Or rather a solution that would not require extra maintenance on my part. The value of users.users.my-minimal-config.name = "my-username"; and inside { pkgs, osConfig, ... }:
let users = osConfig.users.users;
in
{
home = rec {
username =
if (users ? my-minimal-config) then
users.my-minimal-config.name else
"my-username";
homeDirectory =
if (users ? my-minimal-config) then
users.my-minimal-config.home else
(
if pkgs.stdenv.isDarwin then
"/Users/${username}" else
"/home/${username}"
);
};
} Would that solve your issue, or is the PR I made still necessary? I've always had my |
The PR solves this for me! |
I use the same username on my home and work computers, but need to apply different home-manager config based on environment.
Got any tips for how to do this?
The text was updated successfully, but these errors were encountered: