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

Closed
wants to merge 3 commits into from
Closed

Conversation

davidtwco
Copy link
Member

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.

@grahamc
Copy link
Member

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;
Copy link
Contributor

Choose a reason for hiding this comment

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

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.

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've added a composerAttrs argument that can be used to pass arbitrary attributes to the fetchComposer derivation.

@davidtwco
Copy link
Member Author

@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
Copy link
Member Author

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

https://github.com/NixOS/nixpkgs/blob/b01b8adfa529f9f1a06df76cfd25af3bc40b5dfe/pkgs/build-support/composer/fetchcomposer.nix#L23-L24

@davidtwco
Copy link
Member Author

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

@Ma27 Ma27 requested a review from aanderse February 25, 2020 22:02
@Ma27
Copy link
Member

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
Member

@aanderse aanderse left a comment

Choose a reason for hiding this comment

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

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.

nixos/modules/services/web-apps/snipe-it.nix Show resolved Hide resolved
@jtojnar
Copy link
Contributor

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

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.

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>
@stale
Copy link

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 https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Sep 17, 2020
@rpgwaiter
Copy link

I can vouch for the composer support. I've shoehorned it into a flake-managed Laravel project and built a working package and module with it. It's the only solution I've found to do this successfully. To see it in action: nix build --no-write-lock-file "git+https://git.based.zone/rpgwaiter/basedfilehost?ref=main"

Composer build support is sorely missing in the nix ecosystem, I was surprised to find this old PR working fantastically. I can't vouch for the Snipe-it package or module specifically, but the composer support gets my seal of approval for what that's worth.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 23, 2021
@yayayayaka yayayayaka mentioned this pull request Feb 8, 2022
13 tasks
@stale
Copy link

stale bot commented Apr 19, 2022

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Apr 19, 2022
@davidtwco davidtwco deleted the snipe-it-init branch May 11, 2022 07:58
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

6 participants