Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions pkgs/by-name/se/selfci/Cargo.toml.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/Cargo.toml b/Cargo.toml
index 8f7a1e2..e2062c4 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -10,7 +10,7 @@ readme = "README.md"
keywords = ["ci"]
categories = ["development-tools"]
authors = ["dpc <dpc@dpc.pw>"]
-rust-version = "1.92"
+rust-version = "1.91"

[[bin]]
name = "selfci"
48 changes: 48 additions & 0 deletions pkgs/by-name/se/selfci/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
lib,
fetchgit,
nix-update-script,
rustPlatform,
git,
makeWrapper,
}:

rustPlatform.buildRustPackage (finalAttrs: {
pname = "selfci";
version = "0-unstable-2026-01-17";

src = fetchgit {
url = "https://radicle.dpc.pw/z2tDzYbAXxTQEKTGFVwiJPajkbeDU.git";
Copy link
Contributor

Choose a reason for hiding this comment

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

How important realistically this host becomes? It's a $5 Hetzner VPS, but if it ever has issues, I will not be breaking NixOS, right? :D

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Heh, if it goes down then it will simply break the package build. I don't really understand how radicle works, but is it possible to pull it from another "node" if your VPS were to go down?

Copy link
Contributor

Choose a reason for hiding this comment

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

Are there any plans to add to Nixpkgs a fetchRadicle function that will actually use this protocol directly to download sources?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

@dpc dpc Jan 19, 2026

Choose a reason for hiding this comment

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

Heh, if it goes down then it will simply break the package build. I don't really understand how radicle works, but is it possible to pull it from another "node" if your VPS were to go down?

While the radicle is p2p and the source code is redundantly stored in the network, the git link here is just a wrapper exposing git interface running on my $5 VPS. So when my VPS is down the link won't work. One would need to use radicle itself rad clone rad:z2tDzYbAXxTQEKTGFVwiJPajkbeDU to benefit from the redundancy directly. NixOS/nix#10567 would allow Nix to use rad directly, which would be sweet.

BTW. I thought NixOS / hydra / something was actually caching all the building sources so once this builds all NixOS users would be covered effectively forever, right? Just curious. I think that VPS easily has 99.9% uptime anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

While the radicle is p2p and the source code is redundantly stored in the network, the git link here is just a wrapper exposing git interface running on my $5 VPS.

Why aren't there more of these "wrappers" among the nodes seeding the repo though? Is that just not how it works?

NixOS/nix#10567 would allow Nix to use rad directly, which would be sweet.

That would be nice to see merged.

BTW. I thought NixOS / hydra / something was actually caching all the building sources so once this builds all NixOS users would be covered effectively forever, right? Just curious. I think that VPS easily has 99.9% uptime anyway.

I'm not sure what the details are regarding caching, but regardless the VPS will need to be up on successive version bumps, of course.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why aren't there more of these "wrappers" among the nodes seeding the repo though? Is that just not how it works?

Well, git uses centralized URL, but what your comment made me realize, that any public node can serve the same URL, the same way my does. So e.g.

So my instance is:

But here is a public node hosted by Radicle team:

will show in "Clone -> Git":

git clone https://iris.radicle.xyz/z2tDzYbAXxTQEKTGFVwiJPajkbeDU.git selfci

I suspect their node might be a bit more capable and taken care of.

And it seems fetchGit can do urls, so actually we could have redundancy.

Copy link
Contributor

Choose a reason for hiding this comment

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

The solution would be to have a fetchFromRadicle function that uses the node configured in your Nix config. This would be analog to a fetchFromIpfs function.

I also believe we need an issue to track the subject of content addressing vs location addressing with Nix fetchers

rev = "83e693dada851ce0da32713869d3da02c52ed257";
hash = "sha256-f0BfHvIQnhhiPie3a+9MeEGzZ+/KcgrbKBneu8Jo+xs=";
};

cargoHash = "sha256-Z3f35HIZiNeKeDNFPUVkFvL2OpMWzqRvxOL5/hUEzJw=";

nativeBuildInputs = [
makeWrapper
];

patches = [
./Cargo.toml.patch
];

doCheck = false;

postInstall = ''
wrapProgram "$out"/bin/selfci \
--prefix PATH : ${lib.makeBinPath [ git ]}
'';

passthru.updateScript = nix-update-script { };

meta = {
description = "Minimalistic local-first Unix-philosophy-abiding CI";
homepage = "https://app.radicle.xyz/nodes/radicle.dpc.pw/rad%3Az2tDzYbAXxTQEKTGFVwiJPajkbeDU";
license = lib.licenses.mpl20;
maintainers = with lib.maintainers; [
dvn0
];
mainProgram = "selfci";
};
})
Loading