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

install: allow customizing the shellHook #6195

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

Conversation

nikhil-057
Copy link

@nikhil-057 nikhil-057 commented Dec 11, 2024

Description

nix-shell "<home-manager>" -A install fails when a target path to be written by home-manager (eg ~/.profile) already exists. This causes problems when I try to bootstrap non-nixos machines with home-manager.

There's currently no way to modify the install shellHook, which runs exec home-manager init --switch --no-flake. This PR allows customizing the shellHook with an override (for example, changing it to exec home-manager init --switch --no-flake -b backup).

I've also added an integration test for illustration, happy to remove if you think it's overkill.

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.

  • Commit messages are formatted.

Maintainer CC
@rycee

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.

1 participant