Skip to content

Commit b038a2b

Browse files
authored
windsurf: init at 1.2.6 (#380288)
2 parents 3322d8b + ff705b9 commit b038a2b

File tree

8 files changed

+188
-1
lines changed

8 files changed

+188
-1
lines changed

pkgs/applications/editors/vscode/generic.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
# Attributes inherit from specific versions
3535
version,
36+
vscodeVersion ? version,
3637
src,
3738
meta,
3839
sourceRoot,
@@ -303,7 +304,7 @@ stdenv.mkDerivation (
303304
let
304305
vscodeRipgrep =
305306
if stdenv.hostPlatform.isDarwin then
306-
if lib.versionAtLeast version "1.94.0" then
307+
if lib.versionAtLeast vscodeVersion "1.94.0" then
307308
"Contents/Resources/app/node_modules/@vscode/ripgrep/bin/rg"
308309
else
309310
"Contents/Resources/app/node_modules.asar.unpacked/@vscode/ripgrep/bin/rg"

pkgs/by-name/wi/windsurf/info.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"aarch64-darwin": {
3+
"version": "1.2.6",
4+
"vscodeVersion": "1.94.0",
5+
"url": "https://windsurf-stable.codeiumdata.com/darwin-arm64/stable/d08b8ea13d580d24be204c76e5dd1651d7234cd2/Windsurf-darwin-arm64-1.2.6.zip",
6+
"sha256": "b9a63785454003f7ccb3b6adebe232e24618247244b556ef61e9e974a4b77f65"
7+
},
8+
"x86_64-darwin": {
9+
"version": "1.2.6",
10+
"vscodeVersion": "1.94.0",
11+
"url": "https://windsurf-stable.codeiumdata.com/darwin-x64/stable/d08b8ea13d580d24be204c76e5dd1651d7234cd2/Windsurf-darwin-x64-1.2.6.zip",
12+
"sha256": "4a4beae35117162b484521a64fc67cac044ced17a971553ab75ba8823b3cbb75"
13+
},
14+
"x86_64-linux": {
15+
"version": "1.2.6",
16+
"vscodeVersion": "1.94.0",
17+
"url": "https://windsurf-stable.codeiumdata.com/linux-x64/stable/d08b8ea13d580d24be204c76e5dd1651d7234cd2/Windsurf-linux-x64-1.2.6.tar.gz",
18+
"sha256": "ad71eb02b9302d4cf1413c0a83763f45fe455e5be74ee9e1477bea2e85a02caa"
19+
}
20+
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
lib,
3+
stdenv,
4+
callPackage,
5+
vscode-generic,
6+
fetchurl,
7+
nixosTests,
8+
commandLineArgs ? "",
9+
useVSCodeRipgrep ? stdenv.hostPlatform.isDarwin,
10+
}:
11+
let
12+
info =
13+
(lib.importJSON ./info.json)."${stdenv.hostPlatform.system}"
14+
or (throw "windsurf: unsupported system ${stdenv.hostPlatform.system}");
15+
in
16+
callPackage vscode-generic rec {
17+
inherit commandLineArgs useVSCodeRipgrep;
18+
19+
inherit (info) version vscodeVersion;
20+
pname = "windsurf";
21+
22+
executableName = "windsurf";
23+
longName = "Windsurf";
24+
shortName = "windsurf";
25+
26+
sourceRoot = if stdenv.hostPlatform.isDarwin then "Windsurf.app" else "Windsurf";
27+
28+
src = fetchurl { inherit (info) url sha256; };
29+
30+
tests = nixosTests.vscodium;
31+
32+
updateScript = ./update/update.mts;
33+
34+
# Editing the `codium` binary (and shell scripts) within the app bundle causes the bundle's signature
35+
# to be invalidated, which prevents launching starting with macOS Ventura, because VSCodium is notarized.
36+
# See https://eclecticlight.co/2022/06/17/app-security-changes-coming-in-ventura/ for more information.
37+
dontFixup = stdenv.hostPlatform.isDarwin;
38+
39+
meta = {
40+
description = "Agentic IDE powered by AI Flow paradigm";
41+
longDescription = ''
42+
The first agentic IDE, and then some.
43+
The Windsurf Editor is where the work of developers and AI truly flow together, allowing for a coding experience that feels like literal magic.
44+
'';
45+
homepage = "https://codeium.com/windsurf";
46+
license = lib.licenses.unfree;
47+
maintainers = with lib.maintainers; [
48+
xiaoxiangmoe
49+
];
50+
platforms = [
51+
"aarch64-darwin"
52+
"x86_64-darwin"
53+
"x86_64-linux"
54+
];
55+
sourceProvenance = [ lib.sourceTypes.binaryBytecode ];
56+
};
57+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
package-lock.json
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "windsurf-scripts",
3+
"version": "1.0.0",
4+
"scripts": {
5+
"update": "node update.mts"
6+
},
7+
"dependencies": {
8+
"@types/node": "^22.13.1",
9+
"prettier": "^3.4.2",
10+
"typescript": "^5.7.3"
11+
}
12+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"compilerOptions": {
3+
"allowJs": true,
4+
"checkJs": true,
5+
"module": "NodeNext",
6+
"noEmit": true,
7+
"strict": true
8+
}
9+
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#!/usr/bin/env nix-shell
2+
/*
3+
#!nix-shell -i node --pure --packages cacert nodejs_23
4+
*/
5+
import * as assert from "node:assert/strict";
6+
import * as fsPromises from "node:fs/promises";
7+
import * as path from "node:path";
8+
import * as process from "node:process";
9+
10+
const __dirname = import.meta.dirname;
11+
const __filename = import.meta.filename;
12+
13+
interface LatestInfo {
14+
readonly url: string;
15+
readonly sha256hash: string;
16+
readonly windsurfVersion: string;
17+
readonly productVersion: string;
18+
}
19+
20+
const platforms = ["aarch64-darwin", "x86_64-darwin", "x86_64-linux"] as const;
21+
type Platform = (typeof platforms)[number];
22+
type InfoMap = Record<
23+
Platform,
24+
{
25+
readonly version: string;
26+
readonly vscodeVersion: string;
27+
readonly url: string;
28+
readonly sha256: string;
29+
}
30+
>;
31+
32+
async function getInfo(targetSystem: "darwin-arm64" | "darwin-x64" | "linux-x64") {
33+
const url =
34+
`https://windsurf-stable.codeium.com/api/update/${targetSystem}/stable/latest` as const;
35+
36+
const response = await fetch(url);
37+
assert.ok(response.ok, `Failed to fetch ${url}`);
38+
39+
const latestInfo: LatestInfo = JSON.parse(await response.text());
40+
assert.ok(latestInfo.sha256hash, "sha256hash is required");
41+
assert.ok(latestInfo.url, "url is required");
42+
assert.ok(latestInfo.windsurfVersion, "windsurfVersion is required");
43+
assert.ok(latestInfo.productVersion, "productVersion is required");
44+
return {
45+
version: latestInfo.windsurfVersion,
46+
vscodeVersion: latestInfo.productVersion,
47+
url: latestInfo.url,
48+
sha256: latestInfo.sha256hash,
49+
};
50+
}
51+
52+
async function main() {
53+
const filePath = path.join(__dirname, "../info.json");
54+
const oldInfo = JSON.parse(
55+
await fsPromises.readFile(filePath, { encoding: "utf-8" }),
56+
);
57+
58+
const info: InfoMap = {
59+
"aarch64-darwin": await getInfo("darwin-arm64"),
60+
"x86_64-darwin": await getInfo("darwin-x64"),
61+
"x86_64-linux": await getInfo("linux-x64"),
62+
};
63+
if (JSON.stringify(oldInfo) === JSON.stringify(info)) {
64+
console.log("[update] No updates found");
65+
return;
66+
}
67+
for (const platform of platforms) {
68+
console.log(
69+
`[update] Updating Windsurf ${platform} ${oldInfo[platform].version} -> ${info[platform].version}`,
70+
);
71+
}
72+
await fsPromises.writeFile(
73+
filePath,
74+
JSON.stringify(info, null, 2) + "\n",
75+
"utf-8",
76+
);
77+
console.log("[update] Updating Windsurf complete");
78+
}
79+
80+
if (process.argv[1] === __filename) {
81+
main();
82+
}

pkgs/top-level/all-packages.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15594,6 +15594,10 @@ with pkgs;
1559415594
vscodium-fhs = vscodium.fhs;
1559515595
vscodium-fhsWithPackages = vscodium.fhsWithPackages;
1559615596

15597+
windsurf = callPackage ../by-name/wi/windsurf/package.nix {
15598+
vscode-generic = ../applications/editors/vscode/generic.nix;
15599+
};
15600+
1559715601
openvscode-server = callPackage ../servers/openvscode-server {
1559815602
nodejs = nodejs_18;
1559915603
inherit (darwin.apple_sdk.frameworks) AppKit Cocoa Security;

0 commit comments

Comments
 (0)