Files
nix-custom-sqlite/flake.nix
T
2026-05-18 23:38:14 +09:00

45 lines
1.1 KiB
Nix

{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs }:
let
inherit (nixpkgs) lib;
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forAllSystems = f: lib.genAttrs systems (system: f system nixpkgs.legacyPackages.${system});
in {
mkSqlite = import ./src/mk-sqlite.nix { inherit lib; };
packages = forAllSystems (system: pkgs: let
productVars = {
enableMinimal = [ true false ];
enableDebug = [ true false ];
enableInteractive = [ true false ];
};
in lib.mergeAttrsList (lib.mapCartesianProduct (args@{
enableMinimal,
enableDebug,
enableInteractive,
}: let
result = self.mkSqlite {
inherit
pkgs
enableMinimal
enableDebug
enableInteractive;
};
in {
"sqlite-amalgamation${result.suffix}" = result.amalgamation;
"sqlite${result.suffix}" = result.sqlite;
"sqlite-static${result.suffix}" = result.sqlite-static;
}) productVars));
};
}