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: enable nix run for activationPackage #1828

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions modules/home-environment.nix
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,9 @@ in

cp ${activationScript} $out/activate

mkdir $out/bin
ln -s $out/activate $out/bin/home-manager-generation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ln -s $out/activate $out/bin/home-manager-generation
ln -s $out/activate $out/bin/activate

To have a similar API to NixOS.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I tested it, nix run only tries to run $out/bin/<package-name> (that's why nix run nixpkgs#neovim doesn't work). So if the symlink is moved to a different location you can't run it automatically anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I forgot about this peculiarity of nix run. It's good to know meta.mainProgram exists now.
I usually always do nix shell nixpkgs#something -c some-program


substituteInPlace $out/activate \
--subst-var-by GENERATION_DIR $out

Expand Down