Idris2/nix/templates/pkgWithDeps/flake.nix

39 lines
1.1 KiB
Nix
Raw Normal View History

2021-03-15 17:21:50 +03:00
{
description = "My Idris 2 package";
inputs.flake-utils.url = "github:numtide/flake-utils";
2021-03-15 17:21:50 +03:00
inputs.idris = {
url = "github:idris-lang/Idris2";
2021-03-15 17:21:50 +03:00
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
inputs.pkg = {
url = "github:idris-lang/pkg";
2021-03-15 17:21:50 +03:00
inputs.flake-utils.follows = "flake-utils";
inputs.idris.follows = "idris";
};
outputs = { self, nixpkgs, idris, flake-utils, pkg }: flake-utils.lib.eachDefaultSystem (system:
let
npkgs = import nixpkgs { inherit system; };
my-pkg = pkg.packages.${system}.installLibrary;
idrisPkgs = idris.packages.${system};
buildIdris = idris.buildIdris.${system};
pkgs = buildIdris {
projectName = "pkgWithDeps";
src = ./.;
idrisLibraries = [ pkg ];
};
in rec {
packages = pkgs // idrisPkgs;
defaultPackage = pkgs.build;
devShell = npkgs.mkShell {
buildInputs = [ idrisPkgs.idris2 npkgs.rlwrap ];
shellHook = ''
alias idris2="rlwrap -s 1000 idris2 --no-banner"
'';
};
}
);
}