Support for aarch64
This commit is contained in:
@@ -5,12 +5,20 @@
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs }:
|
||||
outputs = { self, nixpkgs }:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
|
||||
buildCursor = { version, url, sha256 }:
|
||||
lib = nixpkgs.lib;
|
||||
systems = [ "x86_64-linux" "aarch64-linux" ];
|
||||
cursorRelease = import ./cursor-release.nix;
|
||||
|
||||
channelForSystem = {
|
||||
x86_64-linux = "linux-x64";
|
||||
aarch64-linux = "linux-arm64";
|
||||
};
|
||||
|
||||
pkgsFor = system: import nixpkgs { inherit system; };
|
||||
|
||||
buildCursor = pkgs: { version, url, sha256 }:
|
||||
let
|
||||
src = pkgs.fetchurl { inherit url sha256; };
|
||||
|
||||
@@ -103,18 +111,22 @@
|
||||
};
|
||||
in
|
||||
{
|
||||
packages.${system} = {
|
||||
default = self.packages.${system}.cursor;
|
||||
cursor = buildCursor {
|
||||
version = "2.2.43";
|
||||
url = "https://downloads.cursor.com/production/32cfbe848b35d9eb320980195985450f244b303d/linux/x64/Cursor-2.2.43-x86_64.AppImage";
|
||||
sha256 = "1bgifjyscqymbz0srw8np9pc88gwcccic3z4cnydyfskxhnyj0sr"; # Will be updated by GitHub Actions
|
||||
};
|
||||
};
|
||||
packages = lib.genAttrs systems (system:
|
||||
let
|
||||
pkgs = pkgsFor system;
|
||||
version = cursorRelease.version;
|
||||
channel = channelForSystem.${system} or (throw "Unsupported system: ${system}");
|
||||
url = "https://api2.cursor.sh/updates/download/golden/${channel}/cursor/${version}";
|
||||
sha256 = cursorRelease.sha256.${system} or "0000000000000000000000000000000000000000000000000000";
|
||||
in
|
||||
{
|
||||
default = self.packages.${system}.cursor;
|
||||
cursor = buildCursor pkgs { inherit version url sha256; };
|
||||
});
|
||||
|
||||
# Overlay for easy integration into other flakes
|
||||
overlays.default = final: prev: {
|
||||
cursor = self.packages.${system}.cursor;
|
||||
cursor = self.packages.${final.system}.cursor;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user