From d945c392bc8a2647c310c6d19cfe05753be03b9e Mon Sep 17 00:00:00 2001 From: Skyler Grey Date: Fri, 26 Dec 2025 11:25:11 +0000 Subject: [PATCH] fix(pm/josh): update to master to fix redirect bug Change-Id: xztnqyslvsmswlwumqyxpwvrmtwslpxx In https://github.com/josh-project/josh/pull/1704 I fixed the way Josh works with redirects. Since as that's not yet in a release, we'll need to pull in Josh's master for it to be effective. The bug prevented Josh working entirely with Tangled, since as Tangled redirects .git -> bare in repo URLs rather than the other way around. As we use Josh with Tangled, there was a period of time where we couldn't clone or pull through it at all. This had a multitude of knock-on effects including making it difficult for me to upstream patches (so I often didn't bother) and entirely breaking our auto-sync mechanism (which relies on Josh to pull out packetmix from patisserie) --- packetmix/npins/sources.json | 13 +++++++++++++ packetmix/packages/default.nix | 1 + packetmix/packages/josh/default.nix | 22 ++++++++++++++++++++++ packetmix/systems/teal/josh.nix | 20 +++++++++++++++----- 4 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 packetmix/packages/josh/default.nix diff --git a/packetmix/npins/sources.json b/packetmix/npins/sources.json index b05d1eda..1f85895d 100644 --- a/packetmix/npins/sources.json +++ b/packetmix/npins/sources.json @@ -221,6 +221,19 @@ "url": "https://github.com/nix-community/impermanence/archive/4b3e914cdf97a5b536a889e939fb2fd2b043a170.tar.gz", "hash": "sha256-LJggUHbpyeDvNagTUrdhe/pRVp4pnS6wVKALS782gRI=" }, + "josh": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "josh-project", + "repo": "josh" + }, + "branch": "master", + "submodules": false, + "revision": "fc2bb5f79a4fc96f0adb1e015b9ac155beac7b3a", + "url": "https://github.com/josh-project/josh/archive/fc2bb5f79a4fc96f0adb1e015b9ac155beac7b3a.tar.gz", + "hash": "sha256-/lwBR2FD5nC9Qn+0pgd5APw97auMDg/NeZl5I9VrgZk=" + }, "lanzaboote": { "type": "GitRelease", "repository": { diff --git a/packetmix/packages/default.nix b/packetmix/packages/default.nix index 53260cad..d987b3ee 100644 --- a/packetmix/packages/default.nix +++ b/packetmix/packages/default.nix @@ -11,6 +11,7 @@ ./bluesky-pds ./collabora-gtimelog ./headscale + ./josh ./kavita ./lua-multipart ./OpenLinkHub diff --git a/packetmix/packages/josh/default.nix b/packetmix/packages/josh/default.nix new file mode 100644 index 00000000..71e876ee --- /dev/null +++ b/packetmix/packages/josh/default.nix @@ -0,0 +1,22 @@ +# SPDX-FileCopyrightText: 2025 FreshlyBakedCake +# +# SPDX-License-Identifier: MIT +{ config, ... }: +{ + config.packages.josh = { + systems = [ "x86_64-linux" ]; + package = + { system, rustPlatform, ... }: + config.inputs.nixos-unstable.result.${system}.josh.overrideAttrs (prev: { + src = config.inputs.josh.result; + + cargoDeps = rustPlatform.fetchCargoVendor { + name = "josh"; + + src = config.inputs.josh.result; + + hash = "sha256-zY2dCDHhPTggZPhFoONHA4NIpv6k+hzKOUQDzheA/28="; + }; + }); + }; +} diff --git a/packetmix/systems/teal/josh.nix b/packetmix/systems/teal/josh.nix index d11f03b8..15a42e22 100644 --- a/packetmix/systems/teal/josh.nix +++ b/packetmix/systems/teal/josh.nix @@ -3,12 +3,20 @@ # # SPDX-License-Identifier: MIT -{ pkgs, lib, ... }: +{ + project, + pkgs, + lib, + ... +}: +let + josh = project.packages.josh.result.${pkgs.system}; +in { users.users.git = { isSystemUser = true; group = "git"; - shell = "${pkgs.josh}/bin/josh-ssh-shell"; + shell = "${josh}/bin/josh-ssh-shell"; }; users.groups.git = { }; @@ -20,7 +28,8 @@ environment = let url_config = repo: '' - [url "https://tangled.org/@freshlybakedca.ke/${repo}"] + [url "https://tangled.org/freshlybakedca.ke/${repo}.git"] + insteadOf = "https://tangled.org/freshlybakedca.ke/${repo}.git" insteadOf = "https://tangled.org/@freshlybakedca.ke/${repo}.git" insteadOf = "ssh://git@tangled.org/freshlybakedca.ke/${repo}.git" @@ -28,7 +37,8 @@ pushInsteadOf = "ssh://git@tangled.org/freshlybakedca.ke/${repo}.git" ''; other_url_config = repo: '' - [url "https://tangled.org/@${repo}"] + [url "https://tangled.org/${repo}.git"] + insteadOf = "https://tangled.org/freshlybakedca.ke/${repo}.git" insteadOf = "https://tangled.org/@freshlybakedca.ke/${repo}.git" insteadOf = "ssh://git@tangled.org/freshlybakedca.ke/${repo}.git" @@ -56,7 +66,7 @@ }; script = - "${pkgs.josh}/bin/josh-proxy" + "${josh}/bin/josh-proxy" + " --local /var/lib/josh/local" + " --remote https://tangled.org/@freshlybakedca.ke" + " --remote ssh://git@tangled.org/freshlybakedca.ke" -- 2.43.0