quox/flake.nix

60 lines
1.7 KiB
Nix
Raw Permalink Normal View History

2022-05-04 11:09:49 -04:00
{ description = "quox: quantitative extensional type theory";
inputs = {
nixpkgs.url = "nixpkgs";
2022-10-30 08:26:44 -04:00
flake-utils.url = "github:numtide/flake-utils";
idris2-pkgs = {
url = "github:lizard-business/idris2-pkgs?ref=idris0.6.0"; # [fixme]
# url = "github:claymager/idris2-pkgs";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
tap = {
url = "git+https://git.rhiannon.website/rhi/idris2-tap?ref=main";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
inputs.idris2-pkgs.follows = "idris2-pkgs";
};
2022-05-04 11:09:49 -04:00
};
outputs = { self, nixpkgs, idris2-pkgs, flake-utils, tap }:
2022-06-19 08:22:58 -04:00
let
packagePaths = {
quox-lib = ./lib;
quox = ./exe;
quox-tests = ./tests;
};
extraDeps = [ tap ];
systems = with flake-utils.lib.system;
[ x86_64-darwin x86_64-linux i686-linux ];
in
2022-06-19 08:22:58 -04:00
with builtins;
flake-utils.lib.eachSystem systems (system:
2022-05-04 11:09:49 -04:00
let
2022-06-19 08:22:58 -04:00
basePkgs = import nixpkgs {
2022-05-04 11:09:49 -04:00
inherit system;
overlays = [ idris2-pkgs.overlay ];
};
2022-06-19 08:22:58 -04:00
builders = basePkgs.idris2-pkgs._builders;
2022-06-19 08:22:58 -04:00
extraDepPkgs =
foldl' (acc: pkg: acc // pkg.packages.${system}) { } extraDeps;
mkPackage = name: path:
builders.idrisPackage path { extraPkgs = extraDepPkgs // packages; };
mkDevShell = _: pkg:
basePkgs.mkShell { buildInputs = [ (builders.devEnv pkg) ]; };
2022-05-04 12:35:43 -04:00
2022-06-19 08:22:58 -04:00
packages = mapAttrs mkPackage packagePaths;
devShells = mapAttrs mkDevShell packages;
2022-05-06 14:27:45 -04:00
in {
inherit packages devShells;
defaultPackage = packages.quox;
2022-06-19 08:22:58 -04:00
devShell = devShells.quox-lib;
2022-05-04 11:09:49 -04:00
}
);
}