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

babelfish: init at 0.1.3 #108946

Merged
merged 2 commits into from
Jan 12, 2021
Merged

Conversation

kevingriffin
Copy link
Contributor

Motivation for this change

The babelfish package allows for translation of bash to fish, useful when setting up an environment or otherwise dealing with typical shell scripts. I've added it to support the generation of native fish shell setup for nixOS.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@kevingriffin kevingriffin changed the title fish: adds babelfish plugin babelfish: init at 0.1.3 Jan 10, 2021
Copy link
Contributor

@pacien pacien left a comment

Choose a reason for hiding this comment

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

I added a few remarks.

Let's also ping the author of the program: @bouk (#107834 (comment))

@@ -2,6 +2,8 @@

lib.makeScope newScope (self: with self; {

babelfish = callPackage ./babelfish.nix { };
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this can be used as a standalone executable, this probably belongs to the top level instead of the fishPlugins scope.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed; it felt a little weird as a plugin. I'll make this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What would you recommend for the path of the package? pkgs/shells/fish/babelfish.nix or something else? pkgs/tools/misc/ or similar?

@@ -0,0 +1,22 @@
{ lib, stdenv, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
Copy link
Contributor

Choose a reason for hiding this comment

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

The source of babelfish also includes a babel.fish file which I believe should be installed to $out/share/fish/vendor_functions.d/ (to check).

Copy link
Contributor

Choose a reason for hiding this comment

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

I would not suggest we do that by default, since it overrides the source function. babel.fish is mostly a proof of concept and not something I'd suggest people actually use.

(I'm the creator of babelfish)

description = "Translate bash scripts to fish";
homepage = "https://github.com/bouk/babelfish";
license = licenses.mit;
maintainers = [ maintainers.kevingriffin ];
Copy link
Contributor

Choose a reason for hiding this comment

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

You can add maintainers.bouk here

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
maintainers = [ maintainers.kevingriffin ];
maintainers = with maintainers; [ bouk kevingriffin ];

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do. Thank you!

@bbjubjub2494
Copy link
Member

@kevingriffin Please add yourself in maintainers/maintainer-list.nix. Check the comment at the top of the file. You can do it within this PR.

Comment on lines 1 to 2
{ lib, stdenv, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
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
{ lib, stdenv, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
{ lib, stdenv, buildGoModule, fetchFromGitHub }:
buildGoModule rec {

maintainers = [ maintainers.kevingriffin ];
};
}

Copy link
Member

Choose a reason for hiding this comment

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

One extra new line to much.

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review which does not build all packages (e.g. lumo, tensorflow or pytorch)
If you find some bugs or got suggestions for further things to search or run please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 108946 run on x86_64-darwin 1

1 package built:
  • babelfish

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review which does not build all packages (e.g. lumo, tensorflow or pytorch)
If you find some bugs or got suggestions for further things to search or run please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 108946 run on x86_64-linux 1

1 package built:
  • babelfish

@SuperSandro2000 SuperSandro2000 merged commit 82fd153 into NixOS:master Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants