Compare commits
9
Commits
d73d377b93
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
69fce234a8 | ||
|
|
09d9c1503b | ||
|
|
1cbde05767 | ||
|
|
e3ebb76b1c | ||
|
|
f5cfed340b | ||
|
|
8d9b0cf742 | ||
|
|
ab7f14dac6 | ||
|
|
11fa9b862b | ||
|
|
8d46992bd1 |
@@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- `opencode-desktop` re-added as a pure pass-through from the `anomalyco/opencode` flake input (Electron app, tracked on `dev`); the input intentionally does not follow nixpkgs so upstream's `node_modules` FOD hashes stay valid
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- `openwork` 0.17.30: upstream renamed desktop/icon assets from `@openworkdesktop.{desktop,png}` to `openwork.{desktop,png}` and dropped the `Icon=`/`--no-sandbox` substitutions that are no longer needed
|
- `openwork` 0.17.30: upstream renamed desktop/icon assets from `@openworkdesktop.{desktop,png}` to `openwork.{desktop,png}` and dropped the `Icon=`/`--no-sandbox` substitutions that are no longer needed
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ These packages are imported directly from flake inputs with minor modifications:
|
|||||||
|
|
||||||
| Package | Source | Modification | Location |
|
| Package | Source | Modification | Location |
|
||||||
|---------|--------|-------------|----------|
|
|---------|--------|-------------|----------|
|
||||||
| `opencode-desktop` | `inputs.opencode` | Tauri desktop wrapper + Wayland fix | `pkgs/opencode-desktop/` |
|
| `opencode-desktop` | `inputs.opencode` | Electron desktop app (pure pass-through) | `pkgs/default.nix` |
|
||||||
|
|
||||||
## Adding Package Documentation
|
## Adding Package Documentation
|
||||||
|
|
||||||
|
|||||||
+41
-22
@@ -1,37 +1,56 @@
|
|||||||
# opencode (Deprecated)
|
# opencode & opencode-desktop
|
||||||
|
|
||||||
> **Note**: The `opencode` package has been removed from this repository.
|
## opencode (CLI)
|
||||||
|
|
||||||
## Why was it removed?
|
The standalone `opencode` CLI is **not** packaged here. Use the well-maintained
|
||||||
|
upstream flake instead:
|
||||||
OpenCode (CLI version) has been removed because there is now a well-maintained upstream repository for AI coding tools:
|
|
||||||
|
|
||||||
**[numtide/llm-agents.nix](https://github.com/numtide/llm-agents.nix)**
|
**[numtide/llm-agents.nix](https://github.com/numtide/llm-agents.nix)**
|
||||||
|
|
||||||
This repository provides Nix packages for various AI coding agents, including OpenCode and others, with active maintenance and updates.
|
|
||||||
|
|
||||||
## What should I use instead?
|
|
||||||
|
|
||||||
Use the [llm-agents.nix](https://github.com/numtide/llm-agents.nix) flake directly:
|
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
inputs = {
|
inputs.llm-agents.url = "github:numtide/llm-agents.nix";
|
||||||
llm-agents.url = "github:numtide/llm-agents.nix";
|
|
||||||
};
|
|
||||||
|
|
||||||
outputs = { inputs, ... }: {
|
|
||||||
# Access packages via inputs.llm-agents.packages.${system}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Or run directly:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
nix run github:numtide/llm-agents.nix#opencode
|
nix run github:numtide/llm-agents.nix#opencode
|
||||||
```
|
```
|
||||||
|
|
||||||
## What about opencode-desktop?
|
## opencode-desktop
|
||||||
|
|
||||||
The `opencode-desktop` package remains available in this repository as it includes a Wayland support workaround for [upstream issue #11755](https://github.com/opencode-ai/opencode/issues/11755). Once this issue is resolved upstream, `opencode-desktop` may also be removed in favor of the llm-agents.nix repository.
|
`opencode-desktop` is provided as a **pure pass-through** from the upstream
|
||||||
|
flake input [`anomalyco/opencode`](https://github.com/anomalyco/opencode)
|
||||||
|
(tracked on the `dev` branch). It is the official Electron desktop app built
|
||||||
|
upstream via `nix/desktop.nix`.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nix build git+https://code.m3ta.dev/m3tam3re/nixpkgs#opencode-desktop
|
||||||
|
nix run git+https://code.m3ta.dev/m3tam3re/nixpkgs#opencode-desktop
|
||||||
|
```
|
||||||
|
|
||||||
|
### How it is wired
|
||||||
|
|
||||||
|
- **Flake input** (`flake.nix`):
|
||||||
|
|
||||||
|
```nix
|
||||||
|
opencode.url = "github:anomalyco/opencode/dev";
|
||||||
|
```
|
||||||
|
|
||||||
|
It intentionally does **not** follow this repo's `nixpkgs`: upstream pins a
|
||||||
|
`node_modules` fixed-output derivation hash in `nix/hashes.json` against its
|
||||||
|
own nixpkgs snapshot, so following would risk FOD hash mismatches.
|
||||||
|
|
||||||
|
- **Registry** (`pkgs/default.nix`):
|
||||||
|
|
||||||
|
```nix
|
||||||
|
opencode-desktop = inputs.opencode.packages.${system}.opencode-desktop;
|
||||||
|
```
|
||||||
|
|
||||||
|
No local derivation exists — the package is imported as-is.
|
||||||
|
|
||||||
|
### Wayland
|
||||||
|
|
||||||
|
The upstream wrapper already passes `--ozone-platform-hint=auto` (plus Wayland
|
||||||
|
window decorations and IME flags) when `NIXOS_OZONE_WL` is set, so no local
|
||||||
|
Wayland wrapper is required.
|
||||||
|
|||||||
Generated
+53
-17
@@ -3,11 +3,11 @@
|
|||||||
"agents": {
|
"agents": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1780133320,
|
"lastModified": 1783016143,
|
||||||
"narHash": "sha256-8AiN9tV9PBb5xblJiPlhumBbKj61qLjzqXXFtkj3vvY=",
|
"narHash": "sha256-3qejDAo4g2XfzTyWCaX8RVKH17JXnw/fujsbXQA+Mzc=",
|
||||||
"ref": "refs/heads/master",
|
"ref": "refs/heads/master",
|
||||||
"rev": "920c00313ae242bd93275c30131b9ab1e52ee2fb",
|
"rev": "83284d752d2ac325d4bf3ab7b38acad1c2fffe3a",
|
||||||
"revCount": 88,
|
"revCount": 98,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://code.m3ta.dev/m3tam3re/AGENTS"
|
"url": "https://code.m3ta.dev/m3tam3re/AGENTS"
|
||||||
},
|
},
|
||||||
@@ -23,27 +23,27 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1774505501,
|
"lastModified": 1785348116,
|
||||||
"narHash": "sha256-7UiRrDptj7yuEFwToOfdunUMz/i3jRLR7CmMoYQjq6k=",
|
"narHash": "sha256-AVycTcomtfvQJ/AHvMg5xu7lVoOzDXxjN+pV7mqUIQ4=",
|
||||||
"owner": "basecamp",
|
"owner": "basecamp",
|
||||||
"repo": "basecamp-cli",
|
"repo": "basecamp-cli",
|
||||||
"rev": "f087e6ef84002503d0dbc75ea1c8c928a8928d9e",
|
"rev": "e1059fb123a03295ce6176272e4bbaf43d7971c6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "basecamp",
|
"owner": "basecamp",
|
||||||
"ref": "v0.7.2",
|
"ref": "v0.8.0-rc.1",
|
||||||
"repo": "basecamp-cli",
|
"repo": "basecamp-cli",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1782467914,
|
"lastModified": 1785318670,
|
||||||
"narHash": "sha256-pGvFkM8N0xEkIIXDe5YYfbEAvHrk4IxBrjB/x8OomhE=",
|
"narHash": "sha256-dN6Ou5x/+23FZLEpYP3IffO+NyJFzUlGumt1uu3MMaY=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "e73de5be04e0eff4190a1432b946d469c794e7b4",
|
"rev": "0954f7ee2f6bb3dc7d4e3d0d8bcb8fd4bde4cfc5",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -55,11 +55,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs-master": {
|
"nixpkgs-master": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1782540244,
|
"lastModified": 1785386845,
|
||||||
"narHash": "sha256-3skOZJEfAUG7LSB/Ok2AQUiqeagYLSq+8wKjtS1hOyc=",
|
"narHash": "sha256-CvXXTgWxbwTn6Diev4nLTP5+8tsFtth/SQAtaR9iVY0=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "a65184fc373636356fcaf460dc09655a919c66ea",
|
"rev": "3c5a718ce27c9283364d4c664fac4e4a23acdfb4",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -69,6 +69,41 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixpkgs_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1776683584,
|
||||||
|
"narHash": "sha256-NuTLMrr10Tng72hurYG8jYQ4XKK8wnpJmOGcPiis96g=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "9dd5558b06dbdacbf635a3dd36dce1b1a7ee3a89",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"opencode": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs_2"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1785386452,
|
||||||
|
"narHash": "sha256-iYfkMmn1ZKbi0cv8XIAXVgPH4idzsVSK4cWyi/KGMJQ=",
|
||||||
|
"owner": "anomalyco",
|
||||||
|
"repo": "opencode",
|
||||||
|
"rev": "f7204902192624481e526b1852cdedaadb914e24",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "anomalyco",
|
||||||
|
"ref": "dev",
|
||||||
|
"repo": "opencode",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"openspec": {
|
"openspec": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -76,11 +111,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1782291243,
|
"lastModified": 1785371113,
|
||||||
"narHash": "sha256-0pVn5pDqlKpqSgzf4eG9TFCjkjzOtnmGTpbILso7GwI=",
|
"narHash": "sha256-r3fwnb5gMTV9UXBj7bqkKpTZIWwF4AgghULOIv2Fr4c=",
|
||||||
"owner": "Fission-AI",
|
"owner": "Fission-AI",
|
||||||
"repo": "OpenSpec",
|
"repo": "OpenSpec",
|
||||||
"rev": "737518b36fe4b6fdb09c83eeaf8d873a428c92e6",
|
"rev": "2b3d368539132be6311e55db58899abbf5306b81",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -95,6 +130,7 @@
|
|||||||
"basecamp": "basecamp",
|
"basecamp": "basecamp",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"nixpkgs-master": "nixpkgs-master",
|
"nixpkgs-master": "nixpkgs-master",
|
||||||
|
"opencode": "opencode",
|
||||||
"openspec": "openspec"
|
"openspec": "openspec"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
nixpkgs-master.url = "github:NixOS/nixpkgs/master";
|
nixpkgs-master.url = "github:NixOS/nixpkgs/master";
|
||||||
|
|
||||||
basecamp = {
|
basecamp = {
|
||||||
url = "github:basecamp/basecamp-cli/v0.7.2";
|
url = "github:basecamp/basecamp-cli/v0.8.0-rc.1";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -16,6 +16,13 @@
|
|||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# opencode - open-source coding agent; provides the opencode-desktop
|
||||||
|
# Electron app. NOTE: intentionally does NOT follow nixpkgs. Upstream
|
||||||
|
# pins a node_modules fixed-output derivation hash in nix/hashes.json
|
||||||
|
# against its own nixpkgs snapshot; following would risk FOD hash
|
||||||
|
# mismatches. Tracking the `dev` default branch (flake.lock pins the rev).
|
||||||
|
opencode.url = "github:anomalyco/opencode/dev";
|
||||||
|
|
||||||
# Agent definitions and coding rules
|
# Agent definitions and coding rules
|
||||||
agents = {
|
agents = {
|
||||||
url = "git+https://code.m3ta.dev/m3tam3re/AGENTS";
|
url = "git+https://code.m3ta.dev/m3tam3re/AGENTS";
|
||||||
|
|||||||
+8
-14
@@ -1,33 +1,27 @@
|
|||||||
{prev}: let
|
{prev}: let
|
||||||
xlsxTarball = "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz";
|
# n8n >= 2.32 replaced the sheetjs-CDN `xlsx@0.20.2` tarball (which lacked an
|
||||||
xlsxIntegrity = "sha512-+nKZ39+nvK7Qq6i0PvWWRA4j/EkfWOtkP/YhMtupm+lJIiHxUrgTr1CcKv1nBk1rHtkRRQ3O2+Ih/q/sA+FXZA==";
|
# integrity checksum and had to be patched into pnpm-lock.yaml) with the
|
||||||
patchXlsxLockfile = ''
|
# regular npm package `@e965/xlsx@0.20.3`, which already carries an integrity
|
||||||
substituteInPlace pnpm-lock.yaml \
|
# field. The old lockfile-integrity workaround is therefore obsolete and has
|
||||||
--replace-fail \
|
# been removed.
|
||||||
"resolution: {tarball: ${xlsxTarball}}" \
|
|
||||||
"resolution: {integrity: ${xlsxIntegrity}, tarball: ${xlsxTarball}}"
|
|
||||||
'';
|
|
||||||
in
|
in
|
||||||
prev.n8n.overrideAttrs (finalAttrs: previousAttrs: {
|
prev.n8n.overrideAttrs (finalAttrs: previousAttrs: {
|
||||||
version = "2.31.6";
|
version = "2.32.7";
|
||||||
|
|
||||||
src = prev.fetchFromGitHub {
|
src = prev.fetchFromGitHub {
|
||||||
owner = "n8n-io";
|
owner = "n8n-io";
|
||||||
repo = "n8n";
|
repo = "n8n";
|
||||||
tag = "n8n@${finalAttrs.version}";
|
tag = "n8n@${finalAttrs.version}";
|
||||||
hash = "sha256-OTVfIHnGTaBogEd93Ak2Pu3Jh7VweQNYbUeahq1Z/64=";
|
hash = "sha256-Lyz0k5LD+lVPt5yeNUm08p9x2xqRIqW4AsMp3IGZGdc=";
|
||||||
};
|
};
|
||||||
|
|
||||||
pnpmDeps = prev.fetchPnpmDeps {
|
pnpmDeps = prev.fetchPnpmDeps {
|
||||||
inherit (finalAttrs) pname version src;
|
inherit (finalAttrs) pname version src;
|
||||||
pnpm = prev.pnpm_10;
|
pnpm = prev.pnpm_10;
|
||||||
fetcherVersion = 3;
|
fetcherVersion = 3;
|
||||||
prePnpmInstall = patchXlsxLockfile;
|
hash = "sha256-QzUJCF+VIku9/HrmiUR9FNCU3MlYtyKOILZjFNXvN8U=";
|
||||||
hash = "sha256-Q3HCJg1KjdRJnPZJEUKcaCrh8tBhT9B3gqMz8xbBZVg=";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
prePnpmInstall = (previousAttrs.prePnpmInstall or "") + patchXlsxLockfile;
|
|
||||||
|
|
||||||
preBuild =
|
preBuild =
|
||||||
(previousAttrs.preBuild or "")
|
(previousAttrs.preBuild or "")
|
||||||
+ ''
|
+ ''
|
||||||
|
|||||||
+52
-33
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env nix-shell
|
#!/usr/bin/env nix-shell
|
||||||
#!nix-shell --pure -i bash -p bash curl jq nix nix-prefetch cacert git
|
#!nix-shell --pure -i bash -p bash curl jq nix nix-prefetch cacert git
|
||||||
|
# shellcheck shell=bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
# Update the n8n overlay (overlays/mods/n8n.nix) to the latest stable GitHub
|
# Update the n8n overlay (overlays/mods/n8n.nix) to the latest stable GitHub
|
||||||
@@ -15,26 +16,43 @@ set -euo pipefail
|
|||||||
# 2. Strip the `n8n@` prefix → version
|
# 2. Strip the `n8n@` prefix → version
|
||||||
# 3. Compare to the version pinned in overlays/mods/n8n.nix
|
# 3. Compare to the version pinned in overlays/mods/n8n.nix
|
||||||
# 4. Compute new src hash (fetchFromGitHub tarball) via nix-prefetch-url
|
# 4. Compute new src hash (fetchFromGitHub tarball) via nix-prefetch-url
|
||||||
# 5. Compute new pnpmDeps hash via the lib.fakeHash trick
|
# 5. Compute new pnpmDeps hash via the fake-hash trick
|
||||||
# 6. Commit
|
# 6. Commit
|
||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
NIX_FILE="$SCRIPT_DIR/n8n.nix"
|
NIX_FILE="$SCRIPT_DIR/n8n.nix"
|
||||||
|
NIXPKGS_ROOT=$(git -C "$SCRIPT_DIR" rev-parse --show-toplevel 2>/dev/null || true)
|
||||||
|
|
||||||
|
# Snapshot the current n8n.nix so we can restore it if anything goes wrong
|
||||||
|
# (error, SIGINT, SIGTERM, or a killed build) — otherwise a failed/aborted run
|
||||||
|
# leaves a stale version bump and/or the fake-hash sentinel behind. Restoring
|
||||||
|
# from the snapshot (rather than `git checkout`) also preserves any
|
||||||
|
# pre-existing working-tree edits the user may have made. The trap is disarmed
|
||||||
|
# once we reach a successful commit.
|
||||||
|
RESTORE_FILE="$(mktemp)"
|
||||||
|
cp "$NIX_FILE" "$RESTORE_FILE"
|
||||||
|
restore_on_failure() {
|
||||||
|
if [[ -z "${UPDATE_SUCCEEDED:-}" ]]; then
|
||||||
|
cp -f "$RESTORE_FILE" "$NIX_FILE" 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
rm -f "$RESTORE_FILE"
|
||||||
|
}
|
||||||
|
trap restore_on_failure EXIT
|
||||||
|
|
||||||
REPO="n8n-io/n8n"
|
REPO="n8n-io/n8n"
|
||||||
TAG_PREFIX="n8n@"
|
TAG_PREFIX="n8n@"
|
||||||
|
|
||||||
# ── 1. Latest stable release ───────────────────────────────────────────────
|
# ── 1. Latest stable release ───────────────────────────────────────────────
|
||||||
echo "Fetching latest stable release of $REPO ..."
|
echo "Fetching latest stable release of $REPO ..."
|
||||||
LATEST_TAG=$(curl -fsSL "https://api.github.com/repos/$REPO/releases/latest" \
|
LATEST_TAG=$(curl -fsSL "https://api.github.com/repos/$REPO/releases/latest" |
|
||||||
| jq -r 'select(.prerelease == false) | .tag_name')
|
jq -r 'select(.prerelease == false) | .tag_name')
|
||||||
|
|
||||||
if [[ -z "$LATEST_TAG" ]]; then
|
if [[ -z "$LATEST_TAG" ]]; then
|
||||||
echo "ERROR: No stable release found for $REPO" >&2
|
echo "ERROR: No stable release found for $REPO" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
VERSION="${LATEST_TAG#${TAG_PREFIX}}"
|
VERSION="${LATEST_TAG#"${TAG_PREFIX}"}"
|
||||||
echo "Latest version: $VERSION"
|
echo "Latest version: $VERSION"
|
||||||
|
|
||||||
# ── 2. Current version from the nix file ───────────────────────────────────
|
# ── 2. Current version from the nix file ───────────────────────────────────
|
||||||
@@ -76,14 +94,20 @@ awk -v sri="$SRC_SRI" '
|
|||||||
{ print }
|
{ print }
|
||||||
' "$NIX_FILE" >"$NIX_FILE.tmp" && mv "$NIX_FILE.tmp" "$NIX_FILE"
|
' "$NIX_FILE" >"$NIX_FILE.tmp" && mv "$NIX_FILE.tmp" "$NIX_FILE"
|
||||||
|
|
||||||
# ── 5. Compute pnpmDeps hash via lib.fakeHash ──────────────────────────────
|
# ── 5. Compute pnpmDeps hash via the fake-hash trick ───────────────────────
|
||||||
echo "==> Computing pnpmDeps hash (this may take a while) ..."
|
echo "==> Computing pnpmDeps hash (this may take a while) ..."
|
||||||
|
|
||||||
# 5a. Temporarily set the pnpmDeps hash to lib.fakeHash
|
# A literal SRI sentinel (equal to lib.fakeHash). We write the literal rather
|
||||||
awk '
|
# than `lib.fakeHash` so we don't depend on `lib` being in scope inside
|
||||||
|
# n8n.nix — the overlay is imported with just `{ prev = pkgs; }`, so `lib`
|
||||||
|
# is not bound there.
|
||||||
|
FAKE_HASH='sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA='
|
||||||
|
|
||||||
|
# 5a. Temporarily set the pnpmDeps hash to the fake sentinel.
|
||||||
|
awk -v fake="\"$FAKE_HASH\"" '
|
||||||
!pnpm_started && /^[[:space:]]*pnpmDeps = / { pnpm_started = 1 }
|
!pnpm_started && /^[[:space:]]*pnpmDeps = / { pnpm_started = 1 }
|
||||||
pnpm_started && !pnpm_done && /^[[:space:]]*hash = "sha256-/ {
|
pnpm_started && !pnpm_done && /^[[:space:]]*hash = "sha256-/ {
|
||||||
sub(/"sha256-[A-Za-z0-9+/=]+"/, "lib.fakeHash")
|
sub(/"sha256-[A-Za-z0-9+/=]+"/, fake)
|
||||||
pnpm_done = 1
|
pnpm_done = 1
|
||||||
}
|
}
|
||||||
{ print }
|
{ print }
|
||||||
@@ -91,7 +115,6 @@ awk '
|
|||||||
|
|
||||||
# 5b. Evaluate n8nModified.pnpmDeps — fixed-output derivation with a wrong hash
|
# 5b. Evaluate n8nModified.pnpmDeps — fixed-output derivation with a wrong hash
|
||||||
# will fail and print the correct hash in the "got:" line.
|
# will fail and print the correct hash in the "got:" line.
|
||||||
SYSTEM=$(nix eval --impure --raw --expr 'builtins.currentSystem' 2>/dev/null || echo "x86_64-linux")
|
|
||||||
NIX_EXPR="(let
|
NIX_EXPR="(let
|
||||||
flake = builtins.getFlake (toString ./.);
|
flake = builtins.getFlake (toString ./.);
|
||||||
pkgs = flake.inputs.nixpkgs.legacyPackages.\${builtins.currentSystem};
|
pkgs = flake.inputs.nixpkgs.legacyPackages.\${builtins.currentSystem};
|
||||||
@@ -100,34 +123,31 @@ NIX_EXPR="(let
|
|||||||
|
|
||||||
BUILD_OUTPUT=$(nix build --impure --no-link --expr "$NIX_EXPR" 2>&1 || true)
|
BUILD_OUTPUT=$(nix build --impure --no-link --expr "$NIX_EXPR" 2>&1 || true)
|
||||||
|
|
||||||
# Hash mismatch errors list two sha256 values: the wrong "Expected"/"specified"
|
# Hash mismatch errors list two sha256 values: the fake sentinel (all A's) as
|
||||||
# one (our lib.fakeHash = all A's) and the correct "Got"/"got" one. Different
|
# "specified"/"Expected" and the correct one as "got:"/"Got:". Different nix
|
||||||
# nix versions capitalise the label differently, so we filter out the fakeHash
|
# versions label/capitalise differently, so filter out the sentinel and take
|
||||||
# sentinel and take whatever real sha256 remains.
|
# whatever real sha256 remains.
|
||||||
PNPM_HASH=$(echo "$BUILD_OUTPUT" \
|
PNPM_HASH=$(echo "$BUILD_OUTPUT" |
|
||||||
| grep -oE 'sha256-[A-Za-z0-9+/=]+' \
|
grep -oE 'sha256-[A-Za-z0-9+/=]+' |
|
||||||
| grep -v 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' \
|
grep -v 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' |
|
||||||
| tail -1)
|
tail -1)
|
||||||
|
|
||||||
if [[ -z "$PNPM_HASH" ]]; then
|
if [[ -z "$PNPM_HASH" ]]; then
|
||||||
echo "ERROR: Failed to compute pnpmDeps hash. nix build output:" >&2
|
echo "ERROR: could not extract a pnpmDeps hash from the build output." >&2
|
||||||
|
echo " This usually means fetchPnpmDeps failed for a reason OTHER than" >&2
|
||||||
|
echo " a hash mismatch (e.g. a pnpm-lock patch in n8n.nix no longer applies," >&2
|
||||||
|
echo " a tarball vanished, or the build was interrupted). Full output:" >&2
|
||||||
echo "$BUILD_OUTPUT" >&2
|
echo "$BUILD_OUTPUT" >&2
|
||||||
echo "Restoring original file..." >&2
|
echo "Restoring n8n.nix via the EXIT trap." >&2
|
||||||
git checkout -- "$NIX_FILE" 2>/dev/null || true
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo " pnpmDeps hash: $PNPM_HASH"
|
echo " pnpmDeps hash: $PNPM_HASH"
|
||||||
|
|
||||||
# 5d. Replace lib.fakeHash with the real hash
|
# 5c. Replace the fake sentinel with the real hash. The sentinel only appears
|
||||||
awk -v sri="$PNPM_HASH" '
|
# in the pnpmDeps block (the src hash was already updated in step 4), so a
|
||||||
!pnpm_started && /^[[:space:]]*pnpmDeps = / { pnpm_started = 1 }
|
# plain literal substitution is sufficient.
|
||||||
pnpm_started && !pnpm_done && /^[[:space:]]*hash = / {
|
sed -i "s|$FAKE_HASH|$PNPM_HASH|" "$NIX_FILE"
|
||||||
sub(/lib\.fakeHash/, "\"" sri "\"")
|
|
||||||
pnpm_done = 1
|
|
||||||
}
|
|
||||||
{ print }
|
|
||||||
' "$NIX_FILE" > "$NIX_FILE.tmp" && mv "$NIX_FILE.tmp" "$NIX_FILE"
|
|
||||||
|
|
||||||
# ── 6. Verify the file parses and commit ───────────────────────────────────
|
# ── 6. Verify the file parses and commit ───────────────────────────────────
|
||||||
echo "==> Verifying nix evaluation ..."
|
echo "==> Verifying nix evaluation ..."
|
||||||
@@ -137,17 +157,16 @@ if ! nix eval --impure --expr "
|
|||||||
pkgs = flake.inputs.nixpkgs.legacyPackages.\${builtins.currentSystem};
|
pkgs = flake.inputs.nixpkgs.legacyPackages.\${builtins.currentSystem};
|
||||||
in (import ./overlays/mods/n8n.nix { prev = pkgs; }).version
|
in (import ./overlays/mods/n8n.nix { prev = pkgs; }).version
|
||||||
" >/dev/null 2>&1; then
|
" >/dev/null 2>&1; then
|
||||||
echo "ERROR: nix evaluation failed after update; restoring original." >&2
|
echo "ERROR: nix evaluation failed after update; restoring n8n.nix via the EXIT trap." >&2
|
||||||
git checkout -- "$NIX_FILE" 2>/dev/null || true
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
NIXPKGS_ROOT=$(git -C "$SCRIPT_DIR" rev-parse --show-toplevel 2>/dev/null || true)
|
if [[ -n "$NIXPKGS_ROOT" ]] &&
|
||||||
if [[ -n "$NIXPKGS_ROOT" ]] && \
|
|
||||||
[[ -n "$(git -C "$NIXPKGS_ROOT" status --porcelain "$NIX_FILE")" ]]; then
|
[[ -n "$(git -C "$NIXPKGS_ROOT" status --porcelain "$NIX_FILE")" ]]; then
|
||||||
git -C "$NIXPKGS_ROOT" add "$NIX_FILE"
|
git -C "$NIXPKGS_ROOT" add "$NIX_FILE"
|
||||||
git -C "$NIXPKGS_ROOT" commit -m "n8n: $CURRENT -> $VERSION"
|
git -C "$NIXPKGS_ROOT" commit -m "n8n: $CURRENT -> $VERSION"
|
||||||
echo "==> Committed"
|
echo "==> Committed"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
UPDATE_SUCCEEDED=1
|
||||||
echo "==> Done"
|
echo "==> Done"
|
||||||
|
|||||||
+16
-2
@@ -3,7 +3,7 @@
|
|||||||
# Flake inputs used:
|
# Flake inputs used:
|
||||||
# inputs.basecamp → basecamp (pass-through)
|
# inputs.basecamp → basecamp (pass-through)
|
||||||
# inputs.openspec → openspec (pass-through)
|
# inputs.openspec → openspec (pass-through)
|
||||||
# inputs.opencode → opencode-desktop (build inputs + patches)
|
# inputs.opencode → opencode-desktop (Electron desktop app, pure pass-through)
|
||||||
# inputs.agents → not used directly here (used by lib/)
|
# inputs.agents → not used directly here (used by lib/)
|
||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
@@ -37,6 +37,20 @@ in {
|
|||||||
# ── Pass-through packages ──────────────────────────────────────────
|
# ── Pass-through packages ──────────────────────────────────────────
|
||||||
# Imported directly from flake inputs. No local modifications.
|
# Imported directly from flake inputs. No local modifications.
|
||||||
|
|
||||||
basecamp = inputs.basecamp.packages.${system}.default;
|
# basecamp: tracked at github:basecamp/basecamp-cli/v0.8.0-rc.1.
|
||||||
|
# The rc.1 tag ships a stale nix/package.nix:
|
||||||
|
# - vendorHash does not match the tagged go.sum (buildGoModule FOD fails)
|
||||||
|
# - `version` was not bumped and still reads "0.7.2"
|
||||||
|
# We override both here so the input builds and reports the rc.1 version.
|
||||||
|
# When upstream fixes package.nix (expected for the 0.8.0 final), drop this
|
||||||
|
# override back to the plain pass-through.
|
||||||
|
basecamp = inputs.basecamp.packages.${system}.default.overrideAttrs (_: {
|
||||||
|
version = "0.8.0-rc.1";
|
||||||
|
vendorHash = "sha256-m1UF/Ga9C9GJF0JtZMXFOX88chb+f279/aoAaiwfxvg=";
|
||||||
|
# src stays the flake input (lib.cleanSource ./.. pinned by flake.lock to
|
||||||
|
# rc.1) — only the version label that upstream forgot to bump is corrected.
|
||||||
|
__intentionallyOverridingVersion = true;
|
||||||
|
});
|
||||||
openspec = inputs.openspec.packages.${system}.default;
|
openspec = inputs.openspec.packages.${system}.default;
|
||||||
|
opencode-desktop = inputs.opencode.packages.${system}.opencode-desktop;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
stdenvNoCC,
|
stdenvNoCC,
|
||||||
}: let
|
}: let
|
||||||
pname = "openwork";
|
pname = "openwork";
|
||||||
version = "0.17.30";
|
version = "0.18.11";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url =
|
url =
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
hash =
|
hash =
|
||||||
if stdenvNoCC.hostPlatform.system == "aarch64-linux"
|
if stdenvNoCC.hostPlatform.system == "aarch64-linux"
|
||||||
then "sha256-ZSoAcOH0/gQynSCY8qCvysaNBnUl/G8Zz66a11y60Qs="
|
then "sha256-ZSoAcOH0/gQynSCY8qCvysaNBnUl/G8Zz66a11y60Qs="
|
||||||
else "sha256-JyDmPXXTx+XwjY3d41cGbLxA2+Uxj8BYPa6eUekvWgU=";
|
else "sha256-wh2I5Il4f/VruMA2mRskaB7ldcbSan0upon6Y+Vm1Rw=";
|
||||||
};
|
};
|
||||||
|
|
||||||
appimageContents = appimageTools.extractType2 {inherit pname version src;};
|
appimageContents = appimageTools.extractType2 {inherit pname version src;};
|
||||||
@@ -25,7 +25,7 @@ in
|
|||||||
inherit pname version src;
|
inherit pname version src;
|
||||||
|
|
||||||
extraInstallCommands = ''
|
extraInstallCommands = ''
|
||||||
install -m 444 -D ${appimageContents}/openwork.desktop \
|
install -m 444 -D ${appimageContents}/com.differentai.openwork.desktop \
|
||||||
$out/share/applications/openwork.desktop
|
$out/share/applications/openwork.desktop
|
||||||
substituteInPlace $out/share/applications/openwork.desktop \
|
substituteInPlace $out/share/applications/openwork.desktop \
|
||||||
--replace-fail 'Exec=AppRun %U' 'Exec=${pname} %U'
|
--replace-fail 'Exec=AppRun %U' 'Exec=${pname} %U'
|
||||||
|
|||||||
@@ -6,12 +6,12 @@
|
|||||||
makeWrapper,
|
makeWrapper,
|
||||||
}: let
|
}: let
|
||||||
pname = "vibetyper";
|
pname = "vibetyper";
|
||||||
version = "1.4.0";
|
version = "1.4.1";
|
||||||
# Upstream publishes to an unversioned URL — ./update.sh watches Last-Modified
|
# Upstream publishes to an unversioned URL — ./update.sh watches Last-Modified
|
||||||
# and refreshes the sha256 when the binary changes. Bump `version` manually.
|
# and refreshes the sha256 when the binary changes. Bump `version` manually.
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://cdn.vibetyper.com/releases/linux/VibeTyper.AppImage";
|
url = "https://cdn.vibetyper.com/releases/linux/VibeTyper.AppImage";
|
||||||
sha256 = "sha256-p4MOTKbEMIUhwhyGSE/l6ucwpPjeTELJ0lX4TXrKf2Y=";
|
sha256 = "sha256-mhXWEKvDgzxJrqIjzUWpfPM8qwKf6YYLsbjqqjtEk5s=";
|
||||||
};
|
};
|
||||||
appimageContents = appimageTools.extractType2 {inherit pname version src;};
|
appimageContents = appimageTools.extractType2 {inherit pname version src;};
|
||||||
in
|
in
|
||||||
|
|||||||
@@ -15,12 +15,10 @@
|
|||||||
modifiedPkgs = mkPkgs [self.overlays.modifications];
|
modifiedPkgs = mkPkgs [self.overlays.modifications];
|
||||||
defaultPkgs = mkPkgs [self.overlays.default];
|
defaultPkgs = mkPkgs [self.overlays.default];
|
||||||
|
|
||||||
expectedVersion = "2.31.6";
|
expectedVersion = "2.32.6";
|
||||||
expectedSrcHash = "sha256-OTVfIHnGTaBogEd93Ak2Pu3Jh7VweQNYbUeahq1Z/64=";
|
expectedSrcHash = "sha256-wWm6vGyJ2I2SBU38gRGaZG2FR5FBxH6V/sWQwn5B4Ac=";
|
||||||
expectedPnpmHash = "sha256-Q3HCJg1KjdRJnPZJEUKcaCrh8tBhT9B3gqMz8xbBZVg=";
|
expectedPnpmHash = "sha256-QzUJCF+VIku9/HrmiUR9FNCU3MlYtyKOILZjFNXvN8U=";
|
||||||
expectedChangelog = "https://github.com/n8n-io/n8n/releases/tag/n8n@${expectedVersion}";
|
expectedChangelog = "https://github.com/n8n-io/n8n/releases/tag/n8n@${expectedVersion}";
|
||||||
expectedXlsxTarball = "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz";
|
|
||||||
expectedXlsxIntegrity = "sha512-+nKZ39+nvK7Qq6i0PvWWRA4j/EkfWOtkP/YhMtupm+lJIiHxUrgTr1CcKv1nBk1rHtkRRQ3O2+Ih/q/sA+FXZA==";
|
|
||||||
expectedRootNodeModuleSymlinks = [
|
expectedRootNodeModuleSymlinks = [
|
||||||
"ln -s .pnpm/node_modules/sass-embedded node_modules/sass-embedded"
|
"ln -s .pnpm/node_modules/sass-embedded node_modules/sass-embedded"
|
||||||
"ln -s .pnpm/node_modules/sqlite3 node_modules/sqlite3"
|
"ln -s .pnpm/node_modules/sqlite3 node_modules/sqlite3"
|
||||||
@@ -46,17 +44,6 @@
|
|||||||
if !(pkgs.lib.all (symlink: pkgs.lib.hasInfix symlink (package.preBuild or "")) expectedRootNodeModuleSymlinks)
|
if !(pkgs.lib.all (symlink: pkgs.lib.hasInfix symlink (package.preBuild or "")) expectedRootNodeModuleSymlinks)
|
||||||
then throw "${overlayName} n8n preBuild should create root node_modules symlinks required by the upstream buildPhase"
|
then throw "${overlayName} n8n preBuild should create root node_modules symlinks required by the upstream buildPhase"
|
||||||
else "ok";
|
else "ok";
|
||||||
|
|
||||||
checkXlsxIntegrityPatch = overlayName: package:
|
|
||||||
pkgs.runCommand "${overlayName}-n8n-xlsx-integrity-patch-test" {
|
|
||||||
inherit expectedXlsxTarball expectedXlsxIntegrity;
|
|
||||||
} ''
|
|
||||||
cp ${package.src}/pnpm-lock.yaml pnpm-lock.yaml
|
|
||||||
${package.prePnpmInstall or ""}
|
|
||||||
grep -F "xlsx@$expectedXlsxTarball:" pnpm-lock.yaml
|
|
||||||
grep -F "resolution: {integrity: $expectedXlsxIntegrity, tarball: $expectedXlsxTarball}" pnpm-lock.yaml
|
|
||||||
touch $out
|
|
||||||
'';
|
|
||||||
in
|
in
|
||||||
pkgs.runCommand "n8n-overlay-test" {
|
pkgs.runCommand "n8n-overlay-test" {
|
||||||
n8nOverlayFile =
|
n8nOverlayFile =
|
||||||
@@ -73,8 +60,6 @@ in
|
|||||||
defaultOverlayBuildPhase = checkBuildPhaseInherited "overlays.default" defaultPkgs.n8n;
|
defaultOverlayBuildPhase = checkBuildPhaseInherited "overlays.default" defaultPkgs.n8n;
|
||||||
modificationsOverlayRootNodeModuleSymlinks = checkRootNodeModuleSymlinks "overlays.modifications" modifiedPkgs.n8n;
|
modificationsOverlayRootNodeModuleSymlinks = checkRootNodeModuleSymlinks "overlays.modifications" modifiedPkgs.n8n;
|
||||||
defaultOverlayRootNodeModuleSymlinks = checkRootNodeModuleSymlinks "overlays.default" defaultPkgs.n8n;
|
defaultOverlayRootNodeModuleSymlinks = checkRootNodeModuleSymlinks "overlays.default" defaultPkgs.n8n;
|
||||||
modificationsOverlayXlsxIntegrityPatch = checkXlsxIntegrityPatch "overlays.modifications" modifiedPkgs.n8n;
|
|
||||||
defaultOverlayXlsxIntegrityPatch = checkXlsxIntegrityPatch "overlays.default" defaultPkgs.n8n;
|
|
||||||
} ''
|
} ''
|
||||||
touch $out
|
touch $out
|
||||||
''
|
''
|
||||||
|
|||||||
Reference in New Issue
Block a user