Skip to content

Conversation

Vuks69
Copy link
Contributor

@Vuks69 Vuks69 commented Jul 15, 2025

Functioning package. Login works, editor and LLM integration works.
resolves kirodotdev/Kiro/issues/169
duplicates #425565 - @deftdawg, feel free to use this PR as you see fit as I don't really have the intention of maintaining this at the time (created this for personal use and saw it wasn't yet on nixpkgs, before you posted your PR) this PR is used instead of the mentioned one.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • Nixpkgs 25.11 Release Notes (or backporting 25.05 Nixpkgs Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
  • NixOS 25.11 Release Notes (or backporting 25.05 NixOS Release notes)
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other contributing documentation in corresponding paths.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci bot added the 12.first-time contribution This PR is the author's first one; please be gentle! label Jul 15, 2025
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. labels Jul 15, 2025
@Vuks69 Vuks69 force-pushed the init-kiro branch 3 times, most recently from 1ea9c3b to a160512 Compare July 16, 2025 01:04
@Vuks69 Vuks69 changed the title kiro: init at 202507140012 kiro: init at 0.1.0 Jul 16, 2025
@deftdawg deftdawg mentioned this pull request Jul 16, 2025
13 tasks
@deftdawg
Copy link
Contributor

Was able to login with one of the previous commits on this PR about an hour ago, will try to find to play with the latest later. Good stuff @Vuks69 🚀

Copy link
Member

@amadaluzia amadaluzia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to nixpkgs!

It is a malpractice to commit a package but not maintain it. If you can, please add yourself as a maintainer and mark yourself as a maintainer for the package.

It also seems as if you can install Kiro on macOS, and Linux ARM I am guessing since I can't check myself. It would be nice if you could add platform support for that.

Copy link
Member

@midischwarz12 midischwarz12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make a commit to add yourself to the nixpkgs maintainer list as described in the CONTRIBUTING.md.

@normalcea
Copy link
Contributor

normalcea commented Jul 17, 2025

I don't think this package can be merged into nixpkgs considering it seemingly abuses an oversight by the copyright holders and bypasses the waitlist. If this gets patched, then we have a source invalidation.

In my opinion, you're better off closing this PR and submitting this to somewhere like https://github.com/nix-community/NUR or asking the copyright holders to create a flake or equivalent for their users.

@deftdawg
Copy link
Contributor

I don't think this package can be merged into nixpkgs considering it seemingly abuses an oversight by the copyright holders and bypasses the waitlist. If this gets patched, then we have a source invalidation.

Given the issue on their GitHub issues was triaged as a feature and there was no waitlist when this PR was opened yesterday, I'm inclined to believe the authors do want their software distributed.

Are we sure this bypasses the waitlist? Did you try it? I can't test it because I registered yesterday before there was a wait list, when opening the app it required me to complete an oauth registration prior to using it, that's actually where my PR broke (wouldn't call browser). If the authors aren't blocking new registrations at the OAuth registration step, the waitlist will be bypassed by anyone determined in very short order.

@normalcea
Copy link
Contributor

normalcea commented Jul 18, 2025

required me to complete an oauth registration prior to using it

Oh I understand this better now, I'm guessing the license agreement/copy protection mechanism happens on startup. I don't have any objections then on that front.

I still think this is better served by the Kiro upstream having their own flake (possibly here https://github.com/kirodotdev/Kiro)

@deftdawg
Copy link
Contributor

better served by the Kiro upstream having their own flake (possibly here https://github.com/kirodotdev/Kiro)

NixOS maybe represents 0.1% of Linux's 4% of global installations, if the authors don't already use Nix/NixOS asking them to familiarize themselves with Nix to support it is going to fall below the bottom of everything else they're working on by priority...

One of the things that drew me to NixOS initially was its ability to magically package new stuff (BambuStudio in that case) seamlessly while my old distro (Ubuntu) was stuck waiting for backports, resolving dependency conflicts and using Docker images as a workaround. Having the bleeding edge available on day 1 (Nix being first to market because of dep isolation) is a huge strength that'll helps us grow to 0.2%+ and the eventual "Year of Nix"!❄️🤣

@Vuks69
Copy link
Contributor Author

Vuks69 commented Jul 18, 2025

I added most of the changes suggested, but honestly this'll have to be put on the backburner until Kiro devs give us a simple/reasonable way to get the tarballs/dmg files with matching versions. Until then, right now I have a 0.1.0 version for x64 linux, and 0.1.9 for x64/arm darwin. I don't see a way to manually figure out the download links as they include the build timestamp, I'm not going to abuse the endpoint by bruteforcing that.

I whipped up a small script that utilizes dmg2img and apfs-fuse to read the .dmg's, resulting in this:

❯ /home/vuks/src/nixpkgs/pkgs/by-name/ki/kiro/update.sh

File: 202507140012-distro-linux-x64.tar.gz
Version: 0.1.0
Hash: sha256-6bbc/HndiN/HUoZyYo9r6Olih2n4/NMyRpxD59z9SH0=

File: 202507162010-Kiro-dmg-darwin-x64.dmg
Version: 0.1.9
Hash: sha256-qpLIZC93AeyBVnEZM8Jf4EOioS/deCJjPS2cCk2q5jo=

File: 202507161958-Kiro-dmg-darwin-arm64.dmg
Version: 0.1.9
Hash: sha256-+QfvhZ+VRnylR0Pj9Vjc43cqcR8lzh0oqAEW9FNTdCk=

@Vuks69
Copy link
Contributor Author

Vuks69 commented Jul 18, 2025

Actually I think I managed to find the link they're using for their internal update process, in the package.json file. This might allow me to grab the latest artifacts, including the ARM one for linux. Stay tuned.

Edit: Works for linux, but not for darwin. The darwin artifact has a completely different filesystem tree and update system, it seems to involve some awfully weird .js/.mjs files, and I'm not finding anything useful with find/grep related to updating.

@Vuks69
Copy link
Contributor Author

Vuks69 commented Jul 18, 2025

Unless I can find download links for anything else than x86_64-linux that are on version 0.1.0, I'm giving up on including anything other than that for now. (or just all 4 links that point to the same version)
While I can find the update links for linux, they seem to still be marked as 0.1.0 (despite latest as of now is 0.1.15), the links would point to a version that I'm unable to determine the version of, and whether they're the full tarball or some sort of diff/incremental tarball. pkgdiff is unhelpful because the structures of direct and update downloads are different.
I'm entirely unable to figure out the update links for darwin as mentioned earlier. At this point I'd rather just have a working MVP out there and wait until Kiro devs give packagers a way to properly determine the download sources.

@Vuks69 Vuks69 force-pushed the init-kiro branch 2 times, most recently from c56e8f2 to f16fc29 Compare July 18, 2025 19:31
@nixpkgs-ci nixpkgs-ci bot added the 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` label Jul 18, 2025
@deftdawg
Copy link
Contributor

There is a site that has a list of links to the releases...

https://kirohistory.dev/

It includes this which is supposed to be 0.1.15:
https://prod.download.desktop.kiro.dev/releases/202507180237--distro-linux-x64-tar-gz/202507180237-distro-linux-x64.tar.gz

(I'm on my phone so can't test it)

@deftdawg
Copy link
Contributor

Confirmed it's the newer build:
Version: 0.1.15
VSCode Version: 1.94.0
Commit: 3bc33dd4c5eafbd5052855ecbf5c622c75d33ab8
Date: 2025-07-18T01:48:26.344Z
Electron: 30.5.1
ElectronBuildId: undefined
Chromium: 124.0.6367.243
Node.js: 20.16.0
V8: 12.4.254.20-electron.0
OS: Linux x64 6.12.35

Here's the patch to your branch @Vuks69

diff --git a/pkgs/by-name/ki/kiro/package.nix b/pkgs/by-name/ki/kiro/package.nix
index 50adaaa71..c9f20a6ce 100644
--- a/pkgs/by-name/ki/kiro/package.nix
+++ b/pkgs/by-name/ki/kiro/package.nix
@@ -10,11 +10,11 @@

 let
   inherit (stdenv) hostPlatform;
-  version = "0.1.0";
+  version = "0.1.15";
   sources = {
     x86_64-linux = fetchurl {
-      url = "https://prod.download.desktop.kiro.dev/releases/202507140012--distro-linux-x64-tar-gz/202507140012-distro-linux-x64.tar.gz";
-      hash = "sha256-6bbc/HndiN/HUoZyYo9r6Olih2n4/NMyRpxD59z9SH0=";
+      url = "https://prod.download.desktop.kiro.dev/releases/202507180237--distro-linux-x64-tar-gz/202507180237-distro-linux-x64.tar.gz";
+      hash = "sha256-cXDG0WBKEZR3e7hrTqVKRy3diTvwicy5RPi+qTkPbwc=";
     };
   };
   src = sources.${hostPlatform.system} or (throw "Unsupported platform for Kiro");

@Vuks69
Copy link
Contributor Author

Vuks69 commented Jul 21, 2025

oh that is super useful and clean, in browser when hovering over the download buttons I can see they just link straight to the official download links. that lets me put the other archs and darwin in the package too <3

Copy link
Member

@amadaluzia amadaluzia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, make sure to change the name of the pull request to match the name of your commit for it to get verified by GitHub.

@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jul 21, 2025
@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Jul 29, 2025
Copy link
Contributor

@normalcea normalcea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am unable to run on my Macbook M1 ("aarch64-linux" via Asahi). VSCodium executes correctly so this isn't an asahi quirk on my end.

/nix/store/f914arnv5z40glfrn0v5xrd7g8zd9597-kiro-0.1.25/bin/.kiro-wrapped: line 63: /nix/store/f914arnv5z40glfrn0v5xrd7g8zd9597-kiro-0.1.25/lib/kiro/kiro: cannot execute binary file: Exec format error
aarch64-linux = sources.x86_64-linux; # "universal" package

I also don't understand what this means. If aarch64-linux isn't supported or we aren't confident that it is, then it shouldn't be listed. Same goes for darwin as well.

@Vuks69
Copy link
Contributor Author

Vuks69 commented Jul 29, 2025

That's unfortunate - Kiro distributes the linux tarball as a "universal" package, which I assumed meant it's for all architectures. Turns out they most likely meant it's for all distributions (given the other linux package is a .deb file). The darwin packages should work correctly, as they're explicitly for x64 and Apple ARM.
I'll remove the linux arm package and ask on their discord about linux arm support.

@Vuks69
Copy link
Contributor Author

Vuks69 commented Jul 30, 2025

An issue asking for linux ARM builds is on Kiro's repository: kirodotdev/Kiro#263

@deftdawg
Copy link
Contributor

deftdawg commented Aug 5, 2025

0.1.42 is out, I also had kiro make itself an updater script, not sure the best way to share though.

--- pkgs/by-name/ki/kiro/package.nix.backup     2025-08-05 12:23:59.475847100 -0400
+++ pkgs/by-name/ki/kiro/package.nix    2025-08-05 12:28:15.840931943 -0400
@@ -10,20 +10,20 @@
 
 let
   inherit (stdenv) hostPlatform;
-  version = "0.1.25";
+  version = "0.1.42";
   sources = {
     x86_64-linux = fetchurl {
-      url = "https://prod.download.desktop.kiro.dev/releases/202507232027--distro-linux-x64-tar-gz/202507232027-distro-linux-x64.tar.gz";
-      hash = "sha256-XxtJS7hLUKHJG0HhiA2Fyt7wNh5YebOOYadvNvXCKzc=";
+      url = "https://prod.download.desktop.kiro.dev/releases/202508020245--distro-linux-x64-tar-gz/202508020245-distro-linux-x64.tar.gz";
+      hash = "sha256-2kUx4PEqVcLF2/gk1+bxjeVrfX6wOxfRpLeMevNNsR8=";
     };
     aarch64-linux = sources.x86_64-linux; # "universal" package
     x86_64-darwin = fetchurl {
-      url = "https://prod.download.desktop.kiro.dev/releases/202507232041-Kiro-dmg-darwin-x64.dmg";
-      hash = "sha256-dH+aQ8IKqGC0TLMlOQFk7UYhL5/dWSOwLXD417bBpWk=";
+      url = "https://prod.download.desktop.kiro.dev/releases/202508020251-Kiro-dmg-darwin-x64.dmg";
+      hash = "sha256-8P562N6b4PyNYgNICyrlVxphkQjXdv80VEXtk71iabE=";
     };
     aarch64-darwin = fetchurl {
-      url = "https://prod.download.desktop.kiro.dev/releases/202507232015-Kiro-dmg-darwin-arm64.dmg";
-      hash = "sha256-GQ40ZirD+MEHcS6B7i7xl0wYCPspvokRrMuD3eqZQM4=";
+      url = "https://prod.download.desktop.kiro.dev/releases/202508020230-Kiro-dmg-darwin-arm64.dmg";
+      hash = "sha256-YBHnFmoVfrl4chEkj9YBP2aUZ4g9UY9AixgCFKV5FVU=";
     };
   };
   src = sources.${hostPlatform.system} or (throw "Unsupported platform for Kiro");

@deftdawg
Copy link
Contributor

deftdawg commented Aug 5, 2025

It works standalone, but I wasn't able to test it with nixpkgs-update (I think because kiro doesn't exist in master, but not certain).

update.sh.txt

--- a/pkgs/by-name/ki/kiro/package.nix
+++ b/pkgs/by-name/ki/kiro/package.nix
@@ -49,7 +49,7 @@ in
   patchVSCodePath = true;

   tests = { };
-  updateScript = null;
+  updateScript = ./update.sh;

   meta = {
     description = "IDE for Agentic AI workflows based on VS Code";

@deftdawg deftdawg requested a review from normalcea August 7, 2025 00:24
@normalcea
Copy link
Contributor

issue: trivial use of inherit (line 12)

Remove inherit usage here since we should avoid refactoring derivation code for consistency.

    inherit (stdenv) hostPlatform;

issue: Unneeded logic in sources attrset

  src = sources.${hostPlatform.system} or (throw "Unsupported platform for Kiro");

This throw is not needed as Nix will error out automatically and this is already guarded by meta.platforms I see this is used in pkgs/applications/editors/vscode/vscode.nix but I argue it's not really needed.

Reference error:

     error: attribute 'aarch64-linux' missing
       at /home/user/Projects/Forge/nixpkgs/pkgs/by-name/ki/kiro/package.nix:28:9:
           27|   };
           28|   src = sources.${hostPlatform.system};
             |         ^
           29| in

suggestion: updateScript and sources

One strategy I would suggest is to separate out the sources from the derivation package.nix and use a sources.json instead, and use the lib.importJSON to import it within the derivation.

@Vuks69 Vuks69 changed the title kiro: init at 0.1.25 kiro: init at 0.1.42 Aug 8, 2025
@Vuks69
Copy link
Contributor Author

Vuks69 commented Aug 8, 2025

@deftdawg - thanks for the heads up and the update script - I let myself beautify it a little.
@normalcea - I think I've addressed all of your concerns now, let me know if anything's still off.

Tested the update script and building/running Kiro on x64 linux.

aaand of course I forgor to format it.

@normalcea
Copy link
Contributor

normalcea commented Aug 8, 2025

Review 2

issue (blocking): updateScript fails due to non-portable shebang.

Using nix-shell maintainers/scripts/update.nix --argstr skip-prompt true --argstr package kiro throws an error as dependencies are not handled in a nix portable way. We need to use a nix-shell instead.

Note: The command above is how your update scripts should be tested as it's what is used for both maintainers and CI.

Diff for resolving (you can look at other update.sh scripts in-tree for more examples)

diff --git a/pkgs/by-name/ki/kiro/update.sh b/pkgs/by-name/ki/kiro/update.sh
index b99a0bb284ee..3d35aefdb071 100755
--- a/pkgs/by-name/ki/kiro/update.sh
+++ b/pkgs/by-name/ki/kiro/update.sh
@@ -1,4 +1,5 @@
-#!/usr/bin/env bash
+#!/usr/bin/env nix-shell
+#!nix-shell -i bash -p curl gnugrep gnused jq

 set -euo pipefail

@@ -25,16 +26,6 @@ error_exit() {
     exit 1
 }

-# Check dependencies
-check_dependencies() {
-    local deps=("curl" "jq" "nix")
-    for dep in "${deps[@]}"; do
-        if ! command -v "$dep" >/dev/null 2>&1; then
-            error_exit "Required dependency '$dep' not found"
-        fi
-    done
-}
-
 # Fetch metadata for a platform
 fetch_platform_info() {
     local url="$1"
@@ -121,9 +112,6 @@ generate_sources_json() {
 main() {
     echo "Starting Kiro update process..."

-    # Check dependencies
-    check_dependencies
-
     # Fetch metadata for all platforms
     echo "Fetching platform information..."
     for platform in "${!PLATFORM_URLS[@]}"; do

Copy link
Contributor

@normalcea normalcea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See review 2

@Vuks69
Copy link
Contributor Author

Vuks69 commented Aug 10, 2025

Damn, thanks for pointing that out. Cursor's update script does it the correct way but I didn't look there. My bad.

@JohnRTitor
Copy link
Member

Let me know when this is ready, I'll take a final look and merge.

@Vuks69 Vuks69 changed the title kiro: init at 0.1.42 kiro: init at 0.2.13 Aug 18, 2025
@Vuks69
Copy link
Contributor Author

Vuks69 commented Aug 18, 2025

I updated the version using the update script, rebased on top of master and checked that kiro still builds and works on x64 linux.

Right now I'm fairly certain this is ready to go.

Copy link
Member

@JohnRTitor JohnRTitor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the update script and the package

(I don't have access code, so I couldn't test the IDE)

But LGTM, runs without a hitch


# You can find the current VSCode version in the About dialog:
# workbench.action.showAboutDialog (Help: About)
vscodeVersion = "1.94.0";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this still needs to be handled manually, but that's fine.

@JohnRTitor JohnRTitor merged commit cee55b8 into NixOS:master Aug 18, 2025
26 of 29 checks passed
@Vuks69 Vuks69 deleted the init-kiro branch August 19, 2025 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 2 This PR was reviewed and approved by two persons. 12.first-time contribution This PR is the author's first one; please be gentle!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add NixOS package
7 participants