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

devour: init at 12 #103227

Merged
merged 2 commits into from Nov 23, 2020
Merged

devour: init at 12 #103227

merged 2 commits into from Nov 23, 2020

Conversation

Mazurel
Copy link
Member

@Mazurel Mazurel commented Nov 9, 2020

Motivation for this change

Added devour, simple x11 tool that hides your current window before launching an external program.

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.


installPhase = ''
mkdir -p $out/local/usr/bin
mv devour $out/local/usr/bin
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
mv devour $out/local/usr/bin
install -Dm755 devour $out/usr/bin

Copy link
Member

Choose a reason for hiding this comment

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

That will give give you a devour executable named "bin" and we don't stick stuff in usr:

This is the right way:
install -Dm555 -t $out/bin devour

Copy link
Member Author

Choose a reason for hiding this comment

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

I will change output to $out/bin and permissions to555, but I don't think that install command behaves like that. By default it copies compiled sources into destination, which is directory created by the command above (tested). Although I will change it anyway, as most of the other nix packages use install with -t.

Copy link
Member

Choose a reason for hiding this comment

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

Yep, that's much better!

};

installPhase = ''
mkdir -p $out/local/usr/bin
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
mkdir -p $out/local/usr/bin
mkdir -p $out/usr/bin

Copy link
Member

Choose a reason for hiding this comment

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

Again, now usr.

Comment on lines 3 to 12
version = "12";
name = "devour-${version}";
src = fetchFromGitHub {
owner = "salman-abedin";
repo = "devour";
rev = version;
sha256 = "1qq5l6d0fn8azg7sj7a4m2jsmhlpswl5793clcxs1p34vy4wb2lp";
};
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
version = "12";
name = "devour-${version}";
src = fetchFromGitHub {
owner = "salman-abedin";
repo = "devour";
rev = version;
sha256 = "1qq5l6d0fn8azg7sj7a4m2jsmhlpswl5793clcxs1p34vy4wb2lp";
};
pname = "devour";
version = "12";
src = fetchFromGitHub {
owner = "salman-abedin";
repo = "devour";
rev = version;
sha256 = "1qq5l6d0fn8azg7sj7a4m2jsmhlpswl5793clcxs1p34vy4wb2lp";
};

meta = with stdenv.lib; {
description = "Devour hides your current window before launching an external program and unhides it after quitting.";
homepage = "https://github.com/salman-abedin/devour";
maintainers = [ maintainers.mazurel ];
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.mazurel ];
maintainers = with maintainers; [ mazurel ];

Copy link
Member

Choose a reason for hiding this comment

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

Why is this a problem? The full maintainer list doesn't need to be in scope when there's just one entry, no? Looks a lot cleaner the way it was before IMO

@peterhoeg
Copy link
Member

Please also split this into 2 commits - one with adding yourself to the maintainer list and the other being the devour package.

@SuperSandro2000
Copy link
Member

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

1 package built:
  • devour

Copy link
Member

@IvarWithoutBones IvarWithoutBones left a comment

Choose a reason for hiding this comment

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

A few suggestions :)

pkgs/tools/X11/devour/default.nix Show resolved Hide resolved
buildInputs = [ libX11 ];

meta = with stdenv.lib; {
description = "Devour hides your current window before launching an external program and unhides it after quitting.";
Copy link
Member

Choose a reason for hiding this comment

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

meta.description should not end with a period, and this seems a bit long.

Suggested change
description = "Devour hides your current window before launching an external program and unhides it after quitting.";
description = "Devour hides your current window when launching an external program";
longDescription = "Devour hides your current window before launching an external program and unhides it after quitting";

pkgs/tools/X11/devour/default.nix Show resolved Hide resolved
@SuperSandro2000
Copy link
Member

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

1 package built:
  • devour

@SuperSandro2000
Copy link
Member

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

1 package built:
  • devour

@SuperSandro2000 SuperSandro2000 merged commit 8b65b64 into NixOS:master Nov 23, 2020
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.

None yet

5 participants