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: set FLAKE_ARG with HOME_MANAGER_PATH #5603

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

usertam
Copy link

@usertam usertam commented Jul 4, 2024

Description

I use a flake setup with home-manager. Currently setting programs.home-manager.path will still result in:

No configuration file found. Please create one at ~/.config/home-manager/home.nix

And so I have to either ln -s <dotfiles> ~/.config/home-manager or each time do home-manager switch --flake <dotfiles> which kinda defeats the purpose of having programs.home-manager.path.

I think it makes sense for home-manager to set FLAKE_ARG automatically when both programs.home-manager.path and $path/flake.nix exist.

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}
    

    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.

Maintainer CC

home-manager/home-manager Outdated Show resolved Hide resolved
Co-authored-by: Bruno BELANYI <[email protected]>
@usertam
Copy link
Author

usertam commented Jul 4, 2024

I just picked the edit here, let me know if a squash is needed.

@usertam usertam requested a review from ambroisie July 4, 2024 15:02
@usertam usertam marked this pull request as draft July 4, 2024 15:21
@usertam
Copy link
Author

usertam commented Jul 4, 2024

I think I might have misunderstood programs.home-manager.path. Originally I thought it was like environment.darwinConfig but then it was actually used for the home-manager package itself, and not the config. Both my usage and this PR are wrong.

In this case I think an extra option like programs.home-manager.config would be more proper.

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