dev-templates/purescript/flake.nix

44 lines
1.2 KiB
Nix
Raw Normal View History

2022-12-21 16:04:57 +01:00
{
description = "A Nix-flake-based Purescript development environment";
inputs = {
2023-03-06 12:28:29 +01:00
nixpkgs.url = "github:NixOS/nixpkgs/release-22.11";
2022-12-21 16:04:57 +01:00
flake-utils.url = "github:numtide/flake-utils";
easy-purescript-nix = {
url = "github:justinwoo/easy-purescript-nix";
flake = false;
};
};
2023-03-06 12:28:29 +01:00
2022-12-21 16:04:57 +01:00
outputs =
{ self
, nixpkgs
, flake-utils
, easy-purescript-nix
}:
2023-03-06 12:28:29 +01:00
2022-12-21 16:04:57 +01:00
flake-utils.lib.eachDefaultSystem (system:
let
2023-03-06 12:28:29 +01:00
pkgs = import nixpkgs { inherit system; };
2022-12-21 16:04:57 +01:00
easy-ps = import easy-purescript-nix { inherit pkgs; };
in
{
devShells.default = pkgs.mkShell {
2023-03-06 12:28:29 +01:00
packages = (with pkgs; [ nodejs ]) ++ (with easy-ps; [
purs
spago
purescript-language-server
purs-tidy
]);
shellHook = with easy-ps; ''
echo "Purs `${purs}/bin/purs --version`"
echo "Spago `${spago}/bin/spago --version`"
echo "Purescript Language Server `${purescript-language-server}/bin/purescript-language-server --version`"
echo "Purs Tidy `${purs-tidy}/bin/purs-tidy --version`"
2022-12-21 16:04:57 +01:00
echo "Node.js `${pkgs.nodejs}/bin/node --version`"
'';
};
});
}