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

nixos/piped: init module #317817

Closed
wants to merge 4 commits into from
Closed

nixos/piped: init module #317817

wants to merge 4 commits into from

Conversation

Defelo
Copy link
Member

@Defelo Defelo commented Jun 6, 2024

Description of changes

Piped is an alternative privacy-friendly YouTube frontend which is efficient by design.

This pull request adds packages for the Piped frontend, backend and proxy, as well as a NixOS module for setting up a Piped instance.

Homepage: https://github.com/TeamPiped/Piped/

Closes #270008

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.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: documentation This PR adds or changes documentation 8.has: changelog 8.has: module (update) This PR changes an existing module in `nixos/` labels Jun 6, 2024
@Defelo
Copy link
Member Author

Defelo commented Jun 6, 2024

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

1 package blacklisted:
  • nixos-install-tools
3 packages built:
  • piped
  • piped-backend
  • piped-proxy

@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: 1-10 10.rebuild-darwin: 1 10.rebuild-linux: 1-10 labels Jun 6, 2024
@h7x4 h7x4 added 8.has: module (new) This PR adds a module in `nixos/` 8.has: tests This PR has tests labels Jun 8, 2024
@Defelo Defelo added the needs_reviewer (old Marvin label, do not use) label Jun 12, 2024
@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/4084

@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 10, 2024
Copy link
Contributor

@nbraud nbraud left a comment

Choose a reason for hiding this comment

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

Have some feedback, though the merge conflict also needs to be addressed

root = pkgs.runCommand "piped-frontend-patched" {} ''
cp -r ${cfg.frontend.package} $out
chmod -R +w $out
${pkgs.gnused}/bin/sed -i 's|https://pipedapi.kavin.rocks|${cfg.backend.externalUrl}|g' $out/{opensearch.xml,assets/*}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
${pkgs.gnused}/bin/sed -i 's|https://pipedapi.kavin.rocks|${cfg.backend.externalUrl}|g' $out/{opensearch.xml,assets/*}
${lib.getExe pkgs.gnused} -i 's|https://pipedapi.kavin.rocks|${cfg.backend.externalUrl}|g' $out/{opensearch.xml,assets/*}

or adding gnused to nativeBuildInputs

Comment on lines +209 to +213
root = pkgs.runCommand "piped-frontend-patched" {} ''
cp -r ${cfg.frontend.package} $out
chmod -R +w $out
${pkgs.gnused}/bin/sed -i 's|https://pipedapi.kavin.rocks|${cfg.backend.externalUrl}|g' $out/{opensearch.xml,assets/*}
'';
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems odd to do the rewriting in here. externalUrl could instead be a parameter for the piped package.

Comment on lines +45 to +70
host = lib.mkOption {
type = lib.types.str;
default = "127.0.0.1";
description = ''
The database host Piped should use.
'';
};

port = lib.mkOption {
type = lib.types.port;
default = config.services.postgresql.settings.port;
defaultText = lib.literalExpression "config.services.postgresql.settings.port";
description = ''
The database port Piped should use.

Defaults to the the default postgresql port.
'';
};

database = lib.mkOption {
type = lib.types.str;
default = "piped";
description = ''
The database Piped should use.
'';
};
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be a single url option, which is what piped-backend's config uses anyhow.

Comment on lines +127 to +132
domain = lib.mkOption {
type = lib.types.str;
description = ''
The domain Piped Backend is reachable on.
'';
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't that redundant with backend.externalUrl ?

@nbraud nbraud removed the needs_reviewer (old Marvin label, do not use) label Sep 18, 2024
@Defelo
Copy link
Member Author

Defelo commented Jan 1, 2025

Closing in favor of #326238

@Defelo Defelo closed this Jan 1, 2025
@Defelo Defelo deleted the piped branch January 1, 2025 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog 8.has: documentation This PR adds or changes documentation 8.has: module (new) This PR adds a module in `nixos/` 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: package (new) This PR adds a new package 8.has: tests This PR has tests 10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 10.rebuild-linux: 1-10 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.

Package request: piped
5 participants