quox/flake.nix

52 lines
1.6 KiB
Nix

{ description = "quox: quantitative extensional type theory";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
idris2-pkgs.url = "github:claymager/idris2-pkgs";
nixpkgs.follows = "idris2-pkgs/nixpkgs";
tap.url = "git+https://git.rhiannon.website/rhi/idris2-tap?ref=main";
tap.inputs = {
flake-utils.follows = "flake-utils";
idris2-pkgs.follows = "idris2-pkgs";
nixpkgs.follows = "idris2-pkgs/nixpkgs";
};
};
outputs = { self, nixpkgs, idris2-pkgs, flake-utils, tap }:
let systems = with flake-utils.lib.system;
# [ x86_64-darwin x86_64-linux i686-linux ]; # FIXME
[ x86_64-linux ];
in
flake-utils.lib.eachSystem systems (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ idris2-pkgs.overlay ];
};
builders = pkgs.idris2-pkgs._builders;
testDeps = tap.packages.${system};
packages = rec {
quox-lib = builders.idrisPackage ./lib { };
quox = builders.idrisPackage ./exe { extraPkgs = packages; };
quox-tests = builders.idrisPackage ./tests {
extraPkgs = packages // testDeps;
};
};
devShells =
let mkDevShell = _: pkg:
pkgs.mkShell { buildInputs = [ (builders.devEnv pkg) ]; };
shells = packages // (with packages;
{ exe = quox; lib = quox-lib; tests = quox-tests; });
in builtins.mapAttrs mkDevShell shells;
in {
inherit packages devShells;
defaultPackage = packages.quox;
devShell = devShells.lib;
}
);
}