From 679731d3e2c973e0a1ff99b5cbd01bbd4457e348 Mon Sep 17 00:00:00 2001 From: Jeffrey Hales Date: Tue, 28 Jul 2026 20:17:04 -0700 Subject: [PATCH] chore: modernize Astro Nix development shell --- flake.lock | 18 ++++++++++-------- flake.nix | 36 +++++++++++++++++++++--------------- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/flake.lock b/flake.lock index 91a254e..c06115a 100644 --- a/flake.lock +++ b/flake.lock @@ -2,16 +2,18 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1728018373, - "narHash": "sha256-NOiTvBbRLIOe5F6RbHaAh6++BNjsb149fGZd1T4+KBg=", - "rev": "bc947f541ae55e999ffdb4013441347d83b00feb", - "revCount": 688563, - "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.688563%2Brev-bc947f541ae55e999ffdb4013441347d83b00feb/01925b66-3b70-71bd-b277-924a6c208ba7/source.tar.gz" + "lastModified": 1785090369, + "narHash": "sha256-m0pDuRJG7EDo9ri+4Ksu83VsI+PlxNC9lNBfydejce4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "624af665418d3c65d544145b4d34ad696439570e", + "type": "github" }, "original": { - "type": "tarball", - "url": "https://flakehub.com/f/NixOS/nixpkgs/0.1.%2A.tar.gz" + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" } }, "root": { diff --git a/flake.nix b/flake.nix index 4fa66d1..474a351 100644 --- a/flake.nix +++ b/flake.nix @@ -1,29 +1,35 @@ { - description = "A Nix-flake-based Node.js development environment"; + description = "Arizona Institute for Autism Astro development environment"; - inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz"; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - outputs = { self, nixpkgs }: + outputs = + { nixpkgs, ... }: let - supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; - forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f { - pkgs = import nixpkgs { inherit system; overlays = [ self.overlays.default ]; }; - }); + supportedSystems = [ + "x86_64-linux" + "aarch64-linux" + "aarch64-darwin" + ]; + + forAllSystems = + function: nixpkgs.lib.genAttrs supportedSystems (system: function nixpkgs.legacyPackages.${system}); in { - overlays.default = final: prev: rec { - nodejs = prev.nodejs_22; - yarn = (prev.yarn.override { inherit nodejs; }); - }; - - devShells = forEachSupportedSystem ({ pkgs }: { + devShells = forAllSystems (pkgs: { default = pkgs.mkShell { packages = with pkgs; [ - node2nix nodejs nodePackages.pnpm yarn - python3 + nodejs_24 + git + curl + jq + ripgrep fd + python3 ]; }; }); + + formatter = forAllSystems (pkgs: pkgs.nixfmt); }; }