Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 13 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,20 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";

# Claude parameters file - JSON with hash, version, and url
# Override with: inputs.claude-desktop.inputs.claude-params.url = "file+file:///path/to/params.json";
claude-params = {
url = "file+file:///dev/null";
flake = false;
};
};

outputs = {
self,
nixpkgs,
flake-utils,
claude-params,
}:
flake-utils.lib.eachSystem ["x86_64-linux" "aarch64-linux"] (system: let
pkgs = import nixpkgs {
Expand All @@ -19,9 +27,12 @@
in {
packages = rec {
patchy-cnb = pkgs.callPackage ./pkgs/patchy-cnb.nix {};
claude-desktop = pkgs.callPackage ./pkgs/claude-desktop.nix {
claude-desktop = let
paramsContent = builtins.readFile claude-params;
params = if paramsContent == "" then {} else builtins.fromJSON paramsContent;
in pkgs.callPackage ./pkgs/claude-desktop.nix ({
inherit patchy-cnb;
};
} // params);
claude-desktop-with-fhs = pkgs.buildFHSEnv {
name = "claude-desktop";
targetPkgs = pkgs:
Expand Down
13 changes: 9 additions & 4 deletions pkgs/claude-desktop.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,19 @@
makeDesktopItem,
makeWrapper,
patchy-cnb,
perl
perl,
# Allow overriding Claude executable parameters
claudeHash ? "sha256-U7jpTk8pU7SUHKxTomQ3BLjspUsNU2r8fEWktaviYj4=",
claudeVersion ? "0.13.37",
claudeUrl ? "https://storage.googleapis.com/osprey-downloads-c02f6a0d-347c-492b-a752-3e0651722e97/nest-win-x64/Claude-Setup-x64.exe"
}: let
pname = "claude-desktop";
version = "0.13.37";
srcExe = fetchurl {
# NOTE: `?v=0.10.0` doesn't actually request a specific version. It's only being used here as a cache buster.
url = "https://storage.googleapis.com/osprey-downloads-c02f6a0d-347c-492b-a752-3e0651722e97/nest-win-x64/Claude-Setup-x64.exe?v=${version}";
hash = "sha256-U7jpTk8pU7SUHKxTomQ3BLjspUsNU2r8fEWktaviYj4=";
# Use the provided URL and version, or defaults
url = "${claudeUrl}?v=${version}";
# Hash can be overridden via flake input
hash = claudeHash;
};
in
stdenvNoCC.mkDerivation rec {
Expand Down