tally/flake.nix
Emil Lerch 3c9ec72b88
All checks were successful
Build / Engine, CLI and TUI (push) Successful in 1m56s
Build / Android (push) Successful in 5m59s
Build / Sign (push) Successful in 3m38s
Build / Publish (push) Successful in 12s
add nix flake/fix release mode tests
2026-10-04 15:01:16 -07:00

46 lines
1.5 KiB
Nix

{
description = "Calculator with exact arithmetic, unit conversion and a programmer mode, as a CLI and TUI";
inputs.nixpkgs.url = "nixpkgs/master";
outputs = { self, nixpkgs }:
let
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
# Helper to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
in
{
packages = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
tally = pkgs.callPackage ./nix/package.nix {
# Pinned deliberately rather than tracking `pkgs.zig`: build.zig.zon
# declares 0.16.0 as the minimum, and 0.16 was a large standard
# library refactor, so a newer default would not build unchanged.
zig = pkgs.zig_0_16;
# The git-tracked tree, which keeps .zig-cache, zig-out, zig-pkg and
# the Android build outputs out of the derivation.
src = self;
};
in
{
inherit tally;
default = tally;
});
devShells = forAllSystems (system:
let pkgs = nixpkgs.legacyPackages.${system};
in
{
# `nix develop` for the CLI/TUI without mise. The versions here are the
# same ones .mise.toml pins; the Android toolchain stays with mise.
default = pkgs.mkShell {
packages = [
pkgs.zig_0_16
pkgs.zls
];
};
});
};
}