Yes, it takes a few minutes
$ nix-store --add-fixed --recursive sha256 Xcode.app/
/nix/store/qdj5n50a3p0nh590gjb6xxyk9dmraf61-Xcode.app$ nix-store --query --hash /nix/store/qdj5n50a3p0nh590gjb6xxyk9dmraf61-Xcode.app
sha256:1ch3wv34zs825y9vhains1f4a77a06d6addc2a5r7y5nvdi3ha6hYes, it takes a few minutes
$ nix-hash --type sha256 Xcode.app/
d0283862dbb6f8938b12ac35659a01ea1c455cd0362ab8932f02e94fc6e603b2$ nix-hash --to-sri sha256:1ch3wv34zs825y9vhains1f4a77a06d6addc2a5r7y5nvdi3ha6h
sha256-0Cg4Ytu2+JOLEqw1ZZoB6hxFXNA2KriTLwLpT8bmA7I=
$ nix-hash --to-sri --type sha256 d0283862dbb6f8938b12ac35659a01ea1c455cd0362ab8932f02e94fc6e603b2
sha256-0Cg4Ytu2+JOLEqw1ZZoB6hxFXNA2KriTLwLpT8bmA7I=Take the SRI and add it to pkgs/os-specific/darwin/xcode/default.nix:
xcode_26_4 = requireXcode "26.4" "sha256-0Cg4Ytu2+JOLEqw1ZZoB6hxFXNA2KriTLwLpT8bmA7I=";Make sure to reference the new package in pkgs/top-level/darwin-packages.nix:
inherit (pkgs.callPackages ../os-specific/darwin/xcode { })
xcode_8_1
xcode_8_2
# ...
+ xcode_26_4
xcode
requireXcode
;- https://github.com/NixOS/nixpkgs/pull/495808/files
- https://github.com/NixOS/nixpkgs/pull/447107/files
- https://github.com/NixOS/nixpkgs/pull/423732/files
- https://github.com/NixOS/nixpkgs/pull/395740/files
- https://github.com/NixOS/nixpkgs/pull/364482/files
$ nix build .#xcode_26_4
$ readlink -f result/
/nix/store/qdj5n50a3p0nh590gjb6xxyk9dmraf61-Xcode.app$ NIXPKGS_ALLOW_UNFREE=1 nix-build -A xcode_26_4
/nix/store/qdj5n50a3p0nh590gjb6xxyk9dmraf61-Xcode.app
$ readlink -f result/
/nix/store/qdj5n50a3p0nh590gjb6xxyk9dmraf61-Xcode.app