nixos下使用windsurf 编辑器

windsurf 是一个和cursor齐名的 ai代码编辑器 or IDE ,基于 vscode开源版.

最近cursor白嫖困难, 付费合租或者加商业版也都不太稳定.所以尝试使用windsurf 替代cursor

但是截至2025年2月6日,nixpkgs尚未收录windsurf 所以自己打包一个,基于 homemanager

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{ pkgs, ... }:
let
  # https://windsurf-stable.codeiumdata.com/linux-x64/stable/d08b8ea13d580d24be204c76e5dd1651d7234cd2/Windsurf-linux-x64-1.2.6.tar.gz
  version = "1.2.6"; # "windsurfVersion"
  urlHash = "d08b8ea13d580d24be204c76e5dd1651d7234cd2"; # "version"
  hash = "sha256-rXHrArkwLUzxQTwKg3Y/Rf5FXlvnTunhR3vqLoWgLKo=";

  windsurf = pkgs.callPackage (pkgs.path + "/pkgs/applications/editors/vscode/generic.nix") {
    pname = "windsurf";
    executableName = "windsurf";
    longName = "Windsurf";
    shortName = "windsurf";
    version = version;
    src = pkgs.fetchurl {
      inherit hash;
      url = "https://windsurf-stable.codeiumdata.com/linux-x64/stable/${urlHash}/Windsurf-linux-x64-${version}.tar.gz";
    };
    sourceRoot = "Windsurf";
    commandLineArgs = "";
    meta = {
      description = "The first agentic IDE, and then some";
    };
    updateScript = "";
  };
in
{
  home.packages = with pkgs; [
    windsurf
  ];
}

参考: https://github.com/KenMacD/etc-nixos/blob/main/pkgs/windsurf.nix

Licensed under CC BY-NC-SA 4.0
comments powered by Disqus
使用 Hugo 构建
主题 StackJimmy 设计