Skip to content

pds: init at 0.4.74, nixos/pds: init#350645

Merged
infinisil merged 4 commits intoNixOS:masterfrom
t4ccer:t4/pbs/init-0-4-59
Jan 27, 2025
Merged

pds: init at 0.4.74, nixos/pds: init#350645
infinisil merged 4 commits intoNixOS:masterfrom
t4ccer:t4/pbs/init-0-4-59

Conversation

@t4ccer
Copy link
Member

@t4ccer t4ccer commented Oct 23, 2024

Things done

Self hosted server for https://bsky.social/

Closes #357466

  • 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: module (update) This PR changes an existing module in `nixos/` labels Oct 23, 2024
@t4ccer t4ccer force-pushed the t4/pbs/init-0-4-59 branch from f315d95 to 6afa70f Compare October 23, 2024 06:02
@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Oct 23, 2024
@h7x4 h7x4 added the 8.has: module (new) This PR adds a module in `nixos/` label Oct 24, 2024
@pyrox0
Copy link
Member

pyrox0 commented Oct 27, 2024

Upstream uses PNPM, why not use the existing PNPM tooling to generate the package? That means then there's no need to store an additional lockfile in-tree.

See https://nixos.org/manual/nixpkgs/stable/#javascript-pnpm for how to use nixpkgs' pnpm tooling.

Edit: I see your comment. Let me see if I can improve that for the pnpm tooling.

@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/4786

@soopyc
Copy link
Member

soopyc commented Nov 1, 2024

Upstream has updated to 0.4.67, you might want to consider updating.

@t4ccer t4ccer force-pushed the t4/pbs/init-0-4-59 branch from 6afa70f to 0b35498 Compare November 1, 2024 15:49
@t4ccer t4ccer changed the title pds: init at 0.4.59, nixos/pds: init pds: init at 0.4.67, nixos/pds: init Nov 1, 2024
Copy link
Contributor

@BatteredBunny BatteredBunny left a comment

Choose a reason for hiding this comment

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

Small changes

@BatteredBunny
Copy link
Contributor

Managed to successfully deploy it to my server :)
Had to modify the pdsadmin scripts though https://github.com/BatteredBunny/pds

@t4ccer t4ccer force-pushed the t4/pbs/init-0-4-59 branch from 0b35498 to 4065add Compare November 1, 2024 18:28
@t4ccer
Copy link
Member Author

t4ccer commented Nov 1, 2024

Yeah, I didn't bother packaging the admin scripts because the main one just fetches scripts for subcommands and they all have wrong shebang. Probably upstream should be fixed to use /usr/bin/env bash

Edit: opened a PR upstream bluesky-social/pds#121

@pyrox0
Copy link
Member

pyrox0 commented Nov 7, 2024

Yeah, I didn't bother packaging the admin scripts because the main one just fetches scripts for subcommands and they all have wrong shebang. Probably upstream should be fixed to use /usr/bin/env bash

Edit: opened a PR upstream bluesky-social/pds#121

You should also be able to run the patchShebangs script on the scripts. Does that work?

Copy link
Member

@pyrox0 pyrox0 left a comment

Choose a reason for hiding this comment

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

Nice work on the service, found a few nits though

@pyrox0
Copy link
Member

pyrox0 commented Nov 7, 2024

Also, having looked into the sharp issue, I believe it's an issue with sharp being version 0.32.x, not 0.33.x, where there are now prebuilt binaries available. I'm looking into submitting a patch upstream to update this dependency

Edit: bluesky-social/atproto#2958

@t4ccer
Copy link
Member Author

t4ccer commented Nov 7, 2024

You should also be able to run the patchShebangs script on the scripts. Does that work?

Not really. It'll fix the main script but all it's doing is download subsequent ones that will still fail because they're not patched https://github.com/bluesky-social/pds/blob/main/pdsadmin.sh#L22-L30

Other way would be to patch the main script to use store path instead of downloading it but I wasn't sure if that's not too much change. But maybe that's a good idea to keep them locked to pds version

@pyrox0
Copy link
Member

pyrox0 commented Nov 7, 2024

You should also be able to run the patchShebangs script on the scripts. Does that work?

Not really. It'll fix the main script but all it's doing is download subsequent ones that will still fail because they're not patched bluesky-social/pds@main/pdsadmin.sh#L22-L30

Other way would be to patch the main script to use store path instead of downloading it but I wasn't sure if that's not too much change. But maybe that's a good idea to keep them locked to pds version

yeah I'd say vendor the scripts, you could even make a new pdsadmin script in-tree and replace the one in the repo with it if you want. Removing what's essentially curl | bash is a great idea in my book. Them being in the nix store is fine, since if you look at the history for the scripts folder, they're not really touched much.

@t4ccer t4ccer force-pushed the t4/pbs/init-0-4-59 branch 3 times, most recently from ac7f4dc to 2d67d86 Compare November 8, 2024 04:40
@t4ccer t4ccer marked this pull request as draft November 8, 2024 04:46
@t4ccer
Copy link
Member Author

t4ccer commented Nov 8, 2024

Hm ExecStart = getExe cfg.package; doesn't seem to work? I get

(pds)[1989597]: pds.service: Failed to execute /nix/store/w25c005jjb98frrvhd7bkwjqmnlrjg96-pds-0.4.67/bin/pds: Exec format error
(pds)[1989597]: pds.service: Failed at step EXEC spawning /nix/store/w25c005jjb98frrvhd7bkwjqmnlrjg96-pds-0.4.67/bin/pds: Exec format error

on my server

@t4ccer t4ccer force-pushed the t4/pbs/init-0-4-59 branch 2 times, most recently from 913a3a8 to 8cabcfb Compare November 8, 2024 04:53
Comment on lines 27 to 28
Copy link
Member

Choose a reason for hiding this comment

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

Why do we need a temporary file?

Copy link
Member Author

Choose a reason for hiding this comment

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

Cause the script tries to source it and it almost always does not exist (the default is /pds/pds.env which looks docker-ish) but even if it does we still want to use our variables instead
https://github.com/bluesky-social/pds/blob/main/pdsadmin/account.sh#L6-L7

@t4ccer t4ccer force-pushed the t4/pbs/init-0-4-59 branch 3 times, most recently from 1387952 to 3ff967c Compare December 30, 2024 19:54
@lucasew
Copy link
Contributor

lucasew commented Dec 30, 2024

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 350645


x86_64-linux

✅ 1 test built:
  • nixosTests.pds
✅ 2 packages built:
  • pds
  • pdsadmin

@t4ccer
Copy link
Member Author

t4ccer commented Dec 30, 2024

The branch this PR will merge in to does not cleanly evaluate, and so this PR cannot be checked.

I don't even have the Details button, how do I debug that?

@t4ccer
Copy link
Member Author

t4ccer commented Dec 30, 2024

@ofborg eval

@t4ccer t4ccer force-pushed the t4/pbs/init-0-4-59 branch from 3ff967c to 9e2f53f Compare December 30, 2024 20:56
@lucasew
Copy link
Contributor

lucasew commented Dec 30, 2024

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 350645


x86_64-linux

✅ 1 test built:
  • nixosTests.pds
✅ 2 packages built:
  • pds
  • pdsadmin

@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 4, 2025
@w4
Copy link
Contributor

w4 commented Jan 15, 2025

What are the blockers here? Would be nice not to have to drop into virtualisation.containers but it’s not the end of the world

@t4ccer
Copy link
Member Author

t4ccer commented Jan 15, 2025

Ugh I didn't notice the merge conflict label, would be great if it would also ping the PR author

@t4ccer t4ccer force-pushed the t4/pbs/init-0-4-59 branch from 9e2f53f to 7546db0 Compare January 15, 2025 20:36
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jan 15, 2025
@t4ccer t4ccer force-pushed the t4/pbs/init-0-4-59 branch from 7546db0 to 2c09cb8 Compare January 15, 2025 20:38
@t4ccer t4ccer force-pushed the t4/pbs/init-0-4-59 branch from 2c09cb8 to 6d0241e Compare January 23, 2025 17:26
@t4ccer
Copy link
Member Author

t4ccer commented Jan 23, 2025

Are we good to merge now @SuperSandro2000? Merge conflicts in release notes are getting quite annoying.

@infinisil infinisil dismissed stale reviews from SuperSandro2000 and pyrox0 January 27, 2025 12:49

Was addressed

@infinisil
Copy link
Member

This PR looks very fine, great work! To not stretch this out any further, I'm jumping in with the merge. If anybody still has nits to complain about, I encourage creating a follow-up PR. In general I'd like to see more optimistic merging in Nixpkgs to avoid situations like these, which are often discouraging for contributors.

@infinisil infinisil merged commit 7cceab5 into NixOS:master Jan 27, 2025
25 of 27 checks passed
@t4ccer t4ccer deleted the t4/pbs/init-0-4-59 branch January 27, 2025 21:10
@isabelroses isabelroses mentioned this pull request Mar 17, 2025
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog This PR adds or changes release notes 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 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Package request: pds (Bluesky Personal Data Server)