From 07044d1c4c82715bb9b9b1f25c44dfeafd9c8d73 Mon Sep 17 00:00:00 2001 From: Troy Neubauer Date: Sat, 28 Feb 2026 12:11:59 -0800 Subject: [PATCH 1/4] add nix shell --- README.md | 7 ++-- flake.lock | 100 +++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 38 ++++++++++++++++++++ 3 files changed, 140 insertions(+), 5 deletions(-) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/README.md b/README.md index 6972330..5b24398 100644 --- a/README.md +++ b/README.md @@ -108,12 +108,9 @@ sudo apt install qemu-system-aarch64 wget jq e2fsprogs just brew install qemu wget jq e2fsprogs just ``` -#### NixOS - -Run the following command: - +#### Nix/NixOS ```bash -nix shell nixpkgs#pkgsCross.aarch64-embedded.stdenv.cc nixpkgs#pkgsCross.aarch64-embedded.stdenv.cc.bintools +nix develop ``` ### Running via QEMU diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..1ec087d --- /dev/null +++ b/flake.lock @@ -0,0 +1,100 @@ +{ + "nodes": { + "fenix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1772261909, + "narHash": "sha256-8XbJXrhMFhLgoBrjFIJx5XJi+SD+7/gbvaIXCuqy9Z0=", + "owner": "nix-community", + "repo": "fenix", + "rev": "e4c413b9546d6c9e6426b33b4d6de1a49a375024", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1771848320, + "narHash": "sha256-0MAd+0mun3K/Ns8JATeHT1sX28faLII5hVLq0L3BdZU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2fc6539b481e1d2569f25f8799236694180c0993", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "fenix": "fenix", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1772178959, + "narHash": "sha256-DkjUvrEnnhHjOcjMx6aXfYGIZ0PWmcYzvVayhRj1r4M=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "8494a8b3b769c17e8594d811012cc1b0fab090c7", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..40bdf34 --- /dev/null +++ b/flake.nix @@ -0,0 +1,38 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + fenix.url = "github:nix-community/fenix"; + fenix.inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = { self, nixpkgs, fenix, flake-utils }: + flake-utils.lib.eachDefaultSystem(system: + let + pkgs = import nixpkgs { inherit system; }; + toolchain = fenix.packages.${system}.fromToolchainFile { + file = ./rust-toolchain.toml; + sha256 = "sha256-SQkt9B1Au5pPWoXg/b190355TVdhBq7xpuWvPaxwM/o="; + }; + shell = pkgs.mkShell { + buildInputs = with pkgs; [ + cargo-binutils + dosfstools + e2fsprogs + just + pkg-config + python3 + pkgsCross.aarch64-embedded.stdenv.cc + pkgsCross.aarch64-embedded.stdenv.cc.bintools + qemu + toolchain + minicom + mtools + wget + ]; + }; + in + { + devShells.default = shell; + }); +} From 6a0fb71cb61b4d42b9a422d5bc52524b48f61a43 Mon Sep 17 00:00:00 2001 From: Troy Neubauer Date: Sat, 28 Feb 2026 13:16:25 -0800 Subject: [PATCH 2/4] Update flake.nix Co-authored-by: Ashwin Naren --- flake.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/flake.nix b/flake.nix index 40bdf34..d952d1c 100644 --- a/flake.nix +++ b/flake.nix @@ -17,7 +17,6 @@ shell = pkgs.mkShell { buildInputs = with pkgs; [ cargo-binutils - dosfstools e2fsprogs just pkg-config From 17769108dd01849940c797bbfb505a9c7ae8d02b Mon Sep 17 00:00:00 2001 From: Troy Neubauer Date: Sat, 28 Feb 2026 13:16:41 -0800 Subject: [PATCH 3/4] Update flake.nix Co-authored-by: Ashwin Naren --- flake.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/flake.nix b/flake.nix index d952d1c..44c819c 100644 --- a/flake.nix +++ b/flake.nix @@ -26,7 +26,6 @@ qemu toolchain minicom - mtools wget ]; }; From d28959937fa7dce4d14c67eaa2af07ad97430056 Mon Sep 17 00:00:00 2001 From: Troy Neubauer Date: Sat, 28 Feb 2026 16:32:10 -0800 Subject: [PATCH 4/4] update to 2-24 toolchain to avoid rust-analyzer #21715 --- flake.lock | 6 +++--- flake.nix | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index 1ec087d..2480699 100644 --- a/flake.lock +++ b/flake.lock @@ -41,11 +41,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1771848320, - "narHash": "sha256-0MAd+0mun3K/Ns8JATeHT1sX28faLII5hVLq0L3BdZU=", + "lastModified": 1772198003, + "narHash": "sha256-I45esRSssFtJ8p/gLHUZ1OUaaTaVLluNkABkk6arQwE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2fc6539b481e1d2569f25f8799236694180c0993", + "rev": "dd9b079222d43e1943b6ebd802f04fd959dc8e61", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 40bdf34..b114b06 100644 --- a/flake.nix +++ b/flake.nix @@ -12,14 +12,14 @@ pkgs = import nixpkgs { inherit system; }; toolchain = fenix.packages.${system}.fromToolchainFile { file = ./rust-toolchain.toml; - sha256 = "sha256-SQkt9B1Au5pPWoXg/b190355TVdhBq7xpuWvPaxwM/o="; + sha256 = "sha256-ggvRZZFjlAlrZVjqul/f/UpU5CEhDbdKZU0OCR8Uzbc="; }; shell = pkgs.mkShell { buildInputs = with pkgs; [ - cargo-binutils dosfstools e2fsprogs just + jq pkg-config python3 pkgsCross.aarch64-embedded.stdenv.cc