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

home-manager: verify username and home directory #4022

Merged
merged 1 commit into from
May 27, 2023

Conversation

rycee
Copy link
Member

@rycee rycee commented May 26, 2023

Description

The generation activation script should be run by the user specified in home.username and home.homeDirectory. If some other user runs the activation script, then files may end up in the wrong place or with the wrong owner.

This commits adds a check early in the activation script that verifies that the running user match the user in the configuration.

Fixes #4019

Checklist

  • Change is backwards compatible.

  • Code formatted with ./format.

  • Code tested through nix-shell --pure tests -A run.all or nix develop --ignore-environment .#all using Flakes.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

@rycee rycee self-assigned this May 26, 2023
The generation activation script should be run by the user specified
in `home.username` and `home.homeDirectory`. If some other user runs
the activation script, then files may end up in the wrong place or
with the wrong owner.

This commits adds a check early in the activation script that verifies
that the running user match the user in the configuration.

Fixes #4019
@rycee rycee merged commit 6a19225 into master May 27, 2023
3 checks passed
@rycee rycee deleted the check-username-homedir branch May 28, 2023 05:25
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.

bug: Running switch with sudo puts symbolic links into /root eventhough homeDirectory is defined
2 participants