# SPDX-FileCopyrightText: © 2026 Jeffrey C. Ollie # SPDX-License-Identifier: MIT { description = "zig-smi"; inputs = { nixpkgs = { url = "https://channels.nixos.org/nixos-unstable/nixexprs.tar.xz"; }; }; # No `zon2nix` input, and no `build.zig.zon.nix`: this library has no # dependencies beyond `std`, so there is nothing for a sandboxed build to # fetch and nothing to generate. Add both back the day that changes. outputs = { nixpkgs, ... }: let inherit (nixpkgs) lib; makePackages = system: import nixpkgs { inherit system; }; forAllSystems = lib.genAttrs lib.systems.flakeExposed; in { packages = forAllSystems ( system: let pkgs = makePackages system; in rec { zig-smi = pkgs.callPackage ./package.nix { }; default = zig-smi; } ); # A Zig library is source, so the package exists to be *run* rather than # installed: it compiles every module and runs every test, which is the # only thing there is to check here. There are no virtual machine tests # -- nothing in this library does any I/O worth booting a guest for. checks = forAllSystems ( system: let pkgs = makePackages system; in { zig-smi = pkgs.callPackage ./package.nix { }; } ); devShells = forAllSystems ( system: let pkgs = makePackages system; in { default = pkgs.mkShell { name = "zig-smi"; nativeBuildInputs = [ pkgs.zig_0_17 pkgs.git-pages-cli pkgs.pinact pkgs.reuse ]; }; } ); }; }