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

snipe-it: init at 4.8.0 + module #80037

Open
wants to merge 3 commits into
base: master
from
Open

Conversation

@davidtwco
Copy link
Member

@davidtwco davidtwco commented Feb 13, 2020

Motivation for this change

Adds a package for Snipe IT.

cc @aanderse (after discussion on Discord)

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.
@davidtwco davidtwco requested a review from Infinisil as a code owner Feb 13, 2020
@grahamc
Copy link
Member

@grahamc grahamc commented Feb 13, 2020

Can you make sure to file some bug reports upstream for the patching you've done? They might have some better tips, or be able to make some improvements to make our task here easier.


let
composerDeps = fetchComposer {
inherit name src srcs;

This comment has been minimized.

@jtojnar

jtojnar Feb 13, 2020
Contributor

I do not like inheriting just a subset of args. Just today I had issues with buildGoModule not responding to postPatch for the deps derivation.

This comment has been minimized.

@davidtwco

davidtwco Feb 18, 2020
Author Member

I've added a composerAttrs argument that can be used to pass arbitrary attributes to the fetchComposer derivation.

@davidtwco davidtwco force-pushed the davidtwco:snipe-it-init branch from 27e1495 to 78a6a86 Feb 18, 2020
@davidtwco
Copy link
Member Author

@davidtwco davidtwco commented Feb 18, 2020

@jtojnar @Ma27 I've responded to your comments above. Unfortunately, as I've now learned that composer isn't deterministic, unless Snipe IT were to ship a release tarball with the vendor directory, I'm not sure how to go about packaging this.

Can you make sure to file some bug reports upstream for the patching you've done? They might have some better tips, or be able to make some improvements to make our task here easier.

@grahamc I'll do this once this PR is landed and I know if there are any more changes that would be helpful.

@davidtwco davidtwco force-pushed the davidtwco:snipe-it-init branch from 78a6a86 to 7a34fe6 Feb 18, 2020
@davidtwco
Copy link
Member Author

@davidtwco davidtwco commented Feb 18, 2020

Nevermind, by adding the lines shown below, I've been able to get composer to be deterministic:

jq '.config."autoloader-suffix" = "nixfetchcomposer"' composer.json > composer.json.tmp
mv composer.json.tmp composer.json

@davidtwco davidtwco requested review from Ma27 and jtojnar Feb 18, 2020
@davidtwco davidtwco force-pushed the davidtwco:snipe-it-init branch from 7a34fe6 to bee75d8 Feb 20, 2020
@davidtwco
Copy link
Member Author

@davidtwco davidtwco commented Feb 24, 2020

@Ma27 @jtojnar are there any other requested changes for this or can the PR be merged?

@Ma27 Ma27 requested a review from aanderse Feb 25, 2020
@Ma27
Copy link
Member

@Ma27 Ma27 commented Feb 25, 2020

So admittedly I just submitted my review after a short look at the changes. Unless someone already did some testing and a closer review this should wait until I managed to take a closer review.

Also adding @aanderse to the reviewer's list as he's quite seasoned with php-related stuff here in my experience.

Copy link
Contributor

@aanderse aanderse left a comment

Is there anyone who feels nix has mature enough infrastructure to ship this application in a robust way? @etu @jtojnar @Ma27

I know we ship other php applications, but that doesn't actually mean we're doing those applications well. @davidtwco I think you did a great job here and personally I'm hoping to leverage some of what you've done here, but I wonder if this application might be better off in NUR until nix develops some maturity here?

Please keep in mind mine is just one opinion of many, and in no way should be seen as authoritative.

@jtojnar
Copy link
Contributor

@jtojnar jtojnar commented Feb 26, 2020

Is there anyone who feels nix has mature enough infrastructure to ship this application in a robust way?

I do not this Nix modules are suitable for this. Without #22067, the module is pretty much useless for anything but the most trivial use case. That is also a reason I am not maintaining selfoss module even though I am upstream developer.

@davidtwco
Copy link
Member Author

@davidtwco davidtwco commented Feb 27, 2020

Is there anyone who feels nix has mature enough infrastructure to ship this application in a robust way?

I think there's a lot of value in having services like this (and the other PHP applications) in nixpkgs. Services like these often aren't trivial as-is to run on NixOS, so any service that can be packaged like this in nixpkgs is one less service that is stopping someone from moving to NixOS and potentially contributing themselves.

The primary reason why PHP applications are hard to run on NixOS is that they expect to be able to write to the directory containing the application - I don't think #22067 would be able to fix that - only patches and working with upstream can.

I do not this Nix modules are suitable for this.

I don't think there's anything about web services like this that are inherently unsuitable for being a NixOS module.

Without #22067, the module is pretty much useless for anything but the most trivial use case. That is also a reason I am not maintaining selfoss module even though I am upstream developer.

I'd push back on this module being "useless for anything but the most trivial use case". The only limitation that this module imposes over a regular install of Snipe-IT on a traditional distribution is that the application source itself is read-only. I expect that the vast majority of users do not patch or modify Snipe-IT and thus are not at a disadvantage from this - and you can still override the package and add more patches. Every configuration option exposed by Snipe-IT in .env can be modified through this module and Snipe-IT is fully functional (including the command-line administration tool!) - that's enough to cover the vast majority of use-cases.

As far as I can gather, the primary goal of #22067 is to enable modules like this to be written in a web-server agnostic way. While that would be great, and I'd hope that this module could be implemented atop that when/if a solution to #22067 is implemented - I think it's far from true that the module is useless without #22067.

davidtwco added 3 commits Feb 13, 2020
Signed-off-by: David Wood <david.wood@codeplay.com>
Signed-off-by: David Wood <david.wood@codeplay.com>
Signed-off-by: David Wood <david.wood@codeplay.com>
@davidtwco davidtwco force-pushed the davidtwco:snipe-it-init branch from bee75d8 to de458a0 Mar 20, 2020
@stale
Copy link

@stale stale bot commented Sep 17, 2020

Hello, I'm a bot and I thank you in the name of the community for your contributions.

Nixpkgs is a busy repository, and unfortunately sometimes PRs get left behind for too long. Nevertheless, we'd like to help committers reach the PRs that are still important. This PR has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human.

If this is still important to you and you'd like to remove the stale label, we ask that you leave a comment. Your comment can be as simple as "still important to me". But there's a bit more you can do:

If you received an approval by an unprivileged maintainer and you are just waiting for a merge, you can @ mention someone with merge permissions and ask them to help. You might be able to find someone relevant by using Git blame on the relevant files, or via GitHub's web interface. You can see if someone's a member of the nixpkgs-committers team, by hovering with the mouse over their username on the web interface, or by searching them directly on the list.

If your PR wasn't reviewed at all, it might help to find someone who's perhaps a user of the package or module you are changing, or alternatively, ask once more for a review by the maintainer of the package/module this is about. If you don't know any, you can use Git blame on the relevant files, or GitHub's web interface to find someone who touched the relevant files in the past.

If your PR has had reviews and nevertheless got stale, make sure you've responded to all of the reviewer's requests / questions. Usually when PR authors show responsibility and dedication, reviewers (privileged or not) show dedication as well. If you've pushed a change, it's possible the reviewer wasn't notified about your push via email, so you can always officially request them for a review, or just @ mention them and say you've addressed their comments.

Lastly, you can always ask for help at our Discourse Forum, or more specifically, at this thread or at #nixos' IRC channel.

@stale stale bot added the 2.status: stale label Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.