# SPDX-FileCopyrightText: 2026 Jeffrey C. Ollie # # SPDX-License-Identifier: MIT { inputs = { nixpkgs = { url = "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz"; }; # Turns build.zig.zon into a Nix expression, so that the dependencies are # fetched by Nix and the build itself needs no network of its own. zon2nix = { url = "git+https://codeberg.org/jcollie/zon2nix.git"; inputs.nixpkgs.follows = "nixpkgs"; }; # The assembler for the 6502 sources this project's tests are built from: # a reimplementation of Frank Kingswood's `as65`, which is the dialect # Klaus Dormann's tests are written in and which he will not move off. # The functional/ subproject fetches it through the Zig build system as # well; this is so that it can be run by hand. aigrette65 = { url = "git+https://git.jcollie.dev/jeff/aigrette65.git"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { nixpkgs, zon2nix, aigrette65, ... }: let makePackages = system: import nixpkgs { inherit system; }; forAllSystems = ( function: nixpkgs.lib.genAttrs [ "x86_64-linux" ] (system: function (makePackages system)) ); in { packages = forAllSystems (pkgs: rec { zig65 = pkgs.callPackage ./package.nix { }; default = zig65; }); devShells = forAllSystems (pkgs: { default = pkgs.mkShell { nativeBuildInputs = [ pkgs.zig_0_16 pkgs.pinact pkgs.kcov pkgs.perf pkgs.cc65 # ACME, which is what Tom Charlesworth's mb-audit is assembled # with; his own build script names it and the source says which # version it expects. pkgs.acme # And aigrette65, for the two of Klaus Dormann's tests that are # published as source only. aigrette65.packages.${pkgs.stdenv.hostPlatform.system}.default # Checks that every file says who owns it and under what terms. pkgs.reuse # Puts the built documentation where it can be read. pkgs.git-pages-cli # Regenerates build.zig.zon.nix from build.zig.zon. zon2nix.packages.${pkgs.stdenv.hostPlatform.system}.zon2nix ]; }; }); }; }