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

ani-skip: init at 1.0.1 #339027

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

ani-skip: init at 1.0.1 #339027

wants to merge 1 commit into from

Conversation

diniamo
Copy link
Contributor

@diniamo diniamo commented Sep 2, 2024

Description of changes

Add https://github.com/synacktraa/ani-skip.

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.

@diniamo
Copy link
Contributor Author

diniamo commented Sep 2, 2024

Suggestions instead of the sed line are especially welcome, I find it ugly (it's for adding to a specific part of the script, hence the backreference referencing the entire lhs).

Copy link
Member

@NotAShelf NotAShelf left a comment

Choose a reason for hiding this comment

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

Needs a few finishing touches.

pkgs/by-name/an/ani-skip/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/an/ani-skip/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/an/ani-skip/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/an/ani-skip/package.nix Outdated Show resolved Hide resolved
Comment on lines +23 to +29
runtimeInputs = [
gnugrep
gnused
curl
fzf
];

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
runtimeInputs = [
gnugrep
gnused
curl
fzf
];

--replace-fail '--script-opts=%s' "--script=$out/share/mpv/scripts/skip.lua --script-opts=%s"

wrapProgram $out/bin/ani-skip \
--suffix PATH : ${lib.makeBinPath finalAttrs.runtimeInputs}
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
--suffix PATH : ${lib.makeBinPath finalAttrs.runtimeInputs}
--suffix PATH : ${lib.makeBinPath [ gnugrep gnused curl fzf ]}

grep and sed are defaults so we don't necessarily need them

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's the point of this change? Why not just have them as an attribute for flexibility with overrides?

Copy link
Member

Choose a reason for hiding this comment

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

Very nit but this is what id do:

{
  ...
  extraRuntimeInputs ? [],
}:
stdenv.mkDerivation {
  ...

  wrapProgram --suffix PATH ${lib.makeBinPath ([ curl fzf ] ++ extraRuntimeInputs)}
  ...
}

Very nit and opinionated, the way youve done it is in my opinion perfectly acceptable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd rather keep the current implementation. Introducing an argument is overkill.

Copy link
Member

Choose a reason for hiding this comment

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

Actually this is better than what you suggests, because it allows overriding the list easily. Also we can't guarantee our programs don't run on other systems and external grep or sed is a source of impurity.

@diniamo
Copy link
Contributor Author

diniamo commented Sep 5, 2024

@SuperSandro2000 any chance we could make progress on this (the remaining CI action seems to be stuck, and there are no tests anyway)?

If you're not convinced by my message above, imagine the following scenario (which has happened to me multiple times with other packages): a user wants a new commit from upstream, but they haven't done a release with it, and the nixpkgs package follows its release cycle, so they have to override the src themself. If there were dependencies introduced since the last release, they would have to add those too, and if the dependencies are hardcoded, instead of being an attribute, the user would have to override the postPatch phase (copying and modifying the original), which, in my opinion, is bad.

Copy link
Member

@NotAShelf NotAShelf left a comment

Choose a reason for hiding this comment

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

I see no issues with the runtimeInputs approach.

Copy link
Member

@Frontear Frontear left a comment

Choose a reason for hiding this comment

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

LGTM!

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