Skip to content

nushellPlugins.bash_env: init at 0.13.0#343036

Closed
Misterio77 wants to merge 1 commit intoNixOS:masterfrom
Misterio77:init-nushell-bash-env
Closed

nushellPlugins.bash_env: init at 0.13.0#343036
Misterio77 wants to merge 1 commit intoNixOS:masterfrom
Misterio77:init-nushell-bash-env

Conversation

@Misterio77
Copy link
Copy Markdown
Member

Description of changes

Add nu_plugin_bash_env, a plugin that helps with sourcing bash environment files.

This should help with nix-community/home-manager#4313.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

Comment on lines +42 to +52
${resholve.phraseSolution "bash_env" {
scripts = [ "libexec/bash_env" ];
interpreter = "${bash}/bin/bash";
inputs = [
jq
coreutils
];
keep = {
"source" = [ "$_path" ];
};
}}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Wrapping this with PATH would pollute its output, so using resholve instead.

Comment on lines +30 to +33
buildInputs = lib.optionals stdenv.isDarwin [
IOKit
Foundation
];
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'm not sure if this is needed as I don't own a Mac, just copied this from the other plugins.

@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Sep 19, 2024
@fehnomenal
Copy link
Copy Markdown
Contributor

Thank you for your work. It would be nice to get this PR merged. Btw, there is already version 0.14.1 released.

@Misterio77
Copy link
Copy Markdown
Member Author

Nice! I'll update this in a couple of hours with the newer version

@jaredmontoya
Copy link
Copy Markdown
Contributor

jaredmontoya commented Nov 17, 2024

@Misterio77 judging from the README.md at https://github.com/tesujimath/bash-env-nushell the plugin is deprecated in favor of the nu "module" that is for now provided in the same repo as the plugin.

So technically it took long enough for a PR for a package to get merged into nixpkgs that the program that the package was made for got deprecated before the PR was merged which is funny in my opinion.

Using the module is as simple as use /path/to/bash-env.nu and it is only 38 lines of nu code which makes it work with any nu version.
But it requires bash-env-json to be in the path. So I will create a package for it.

@jaredmontoya
Copy link
Copy Markdown
Contributor

jaredmontoya commented Nov 22, 2024

I submitted a PR for the bash-env-json package #358140

Once merged it can be used with the bash-env-nushell (module) to implement a programs.nushell NixOS module.

0.9.1 can't process files that set PATH to something that has no required binaries. But it will work on files like /etc/profiles/per-user/nix/etc/profile.d/hm-session-vars.sh so home-manager can start implementing nushell support with 0.9.1

0.9.2 is coming soon with a fix: #358950

After that a nushell NixOS module will also be possible.

@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Apr 2, 2025
@nixpkgs-ci nixpkgs-ci bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 25, 2025
@different-name
Copy link
Copy Markdown
Contributor

Closing since as of tesujimath/bash-env-nushell@23d30cb the plugin has been removed and is no longer available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.status: merge conflict This PR has merge conflicts with the target branch 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants