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

slskd: init at 0.17.5 #227059

Merged
merged 1 commit into from
May 12, 2023
Merged

slskd: init at 0.17.5 #227059

merged 1 commit into from
May 12, 2023

Conversation

ppom0
Copy link
Contributor

@ppom0 ppom0 commented Apr 19, 2023

Description of changes

slskd is a web-app for the Soulseek file sharing network.

addresses #220774

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • 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/)
  • 23.05 Release Notes (or backporting 22.11 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.

@ppom0
Copy link
Contributor Author

ppom0 commented Apr 19, 2023

The linked issue provides more insights about the PR, and the following PR.

I borrowed the checkPhase from @turlando 's draft, thanks!

@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1 labels Apr 19, 2023
@turlando
Copy link

It would be nice to also have a nixos module setting up a service user, configuring a systemd unit, etc. I can help if you want.

@ppom0
Copy link
Contributor Author

ppom0 commented Apr 21, 2023

@turlando I think we usually do this in 2 separate PRs. I have a ready module here, and I'm open to suggestions :)

@turlando
Copy link

I think I managed to build the frontend.

As I mentioned in the issue, the problem is that buildNpmPackage gets confused when in the package-lock.json file the same package occurs multiple times with different hash algorithms. Specifically the offender was the path-exists npm package.

Moreover I had to pass --legacy-peer-deps to npm for reasons I don't (want to) understand.

  • web.nix

    { lib, pkgs, buildNpmPackage, fetchFromGitHub }:
    
    let
      buildNpmPackage' = buildNpmPackage.override { nodejs = pkgs.nodejs-18_x; };
      version = "0.17.5";
    
      src = fetchFromGitHub {
        owner = "slskd";
        repo = "slskd";
        rev = version;
        sha256 = "sha256-iIM29ZI3M9etbw4yzin+4f4cGHIt5qjIl7uzsTUCBc4=";
      };
    in
    buildNpmPackage' {
      pname = "slskd-web";
      version = version;
      src = "${src}/src/web";
      patches = [ ./package-lock.patch ];
      npmFlags = [ "--legacy-peer-deps" ];
      npmDepsHash = "sha256-vURi36ebdJQofhBlElIH5m6T1b8tsVGAzXCiDYUcSww=";
      installPhase = ''
        cp -r build $out
      '';
      meta = {
        license = lib.licenses.agpl3;
      };
    }
  • package-lock.patch

    diff --git a/package-lock.json b/package-lock.json
    index 5a84fbe7..562051c7 100644
    --- a/package-lock.json
    +++ b/package-lock.json
    @@ -12425,7 +12425,7 @@
         "node_modules/pkg-up/node_modules/path-exists": {
           "version": "3.0.0",
           "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
    -      "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
    +      "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==",
           "dev": true,
           "engines": {
             "node": ">=4"
    

@ppom0 ppom0 force-pushed the slskd-init branch 2 times, most recently from 97e58d3 to 8acb744 Compare April 27, 2023 14:35
@ppom0
Copy link
Contributor Author

ppom0 commented Apr 27, 2023

I just integrated this code, and I can confirm it builds exactly the same thing as in the release: the checksums of the relevant files (main.js & main.css) are the same. Well done!

@ppom0
Copy link
Contributor Author

ppom0 commented Apr 27, 2023

@turlando, do you want to be maintainer of this package as well? I would appreciate it, if you feel like it!
You must first add yourself to the maintainer list. If you give me the relevant information, I can add it in the PR.

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/2194

pkgs/servers/web-apps/slskd/default.nix Outdated Show resolved Hide resolved
pkgs/servers/web-apps/slskd/default.nix Outdated Show resolved Hide resolved
pkgs/servers/web-apps/slskd/default.nix Outdated Show resolved Hide resolved
pkgs/servers/web-apps/slskd/default.nix Outdated Show resolved Hide resolved
@ppom0
Copy link
Contributor Author

ppom0 commented May 11, 2023

Thanks for the review @SuperSandro2000, all suggestions were really appropriate :)

pkgs/servers/web-apps/slskd/default.nix Outdated Show resolved Hide resolved
pkgs/servers/web-apps/slskd/default.nix Outdated Show resolved Hide resolved
@SuperSandro2000 SuperSandro2000 merged commit b22c35f into NixOS:master May 12, 2023
@NickCao NickCao mentioned this pull request May 13, 2023
12 tasks
@ppom0 ppom0 mentioned this pull request May 23, 2023
12 tasks
@ppom0 ppom0 deleted the slskd-init branch May 23, 2023 16:47
@Atemu Atemu mentioned this pull request Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants