squiggle/flake.nix

94 lines
3.2 KiB
Nix
Raw Normal View History

2022-03-24 16:16:23 +00:00
{
2022-03-24 16:20:40 +00:00
description = "Building codium for rescript development";
2022-03-24 16:16:23 +00:00
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
2022-03-24 17:52:24 +00:00
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
2022-03-24 16:16:23 +00:00
};
outputs =
{ self
, nixpkgs
2022-03-24 17:52:24 +00:00
, flake-compat
2022-03-24 16:16:23 +00:00
}:
let
# Generate a user-friendly version number.
version = builtins.substring 0 8 self.lastModifiedDate;
# System types to support.
2022-03-24 16:33:37 +00:00
supportedSystems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ];
2022-03-24 16:16:23 +00:00
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
# Nixpkgs instantiated for supported system types.
nixpkgsFor = forAllSystems (system:
import nixpkgs {
inherit system;
overlays = [ self.overlay ];
});
in
{
overlay = final: prev: { };
# the default devShell used when running `nix develop`
devShell = forAllSystems (system: self.devShells.${system}.defaultShell);
devShells = forAllSystems (system:
let
pkgs = nixpkgsFor."${system}";
in
{
2022-03-24 17:52:24 +00:00
# In case we don't want to provide an editor, this defaultShell will provide only coq packages we need.
2022-03-24 16:16:23 +00:00
defaultShell = pkgs.mkShell {
buildInputs = with pkgs; [
yarn
2022-03-24 18:42:27 +00:00
yarn2nix
npm
nodejs
2022-03-24 17:52:24 +00:00
(pkgs.vscode-with-extensions.override {
2022-03-24 16:16:23 +00:00
vscode = pkgs.vscodium;
vscodeExtensions = pkgs.vscode-utils.extensionsFromVscodeMarketplace [
2022-03-24 18:21:54 +00:00
{
name = "rescript-vscode";
publisher = "chenglou92";
version = "1.2.1";
sha256 = "sha256-7/YakKtJ4WhgAR4rZltrq8g4TtM5QZ2spbrEUrNoXVg=";
}
2022-03-24 17:52:24 +00:00
{
name = "vim";
publisher = "vscodevim";
version = "1.22.2";
sha256 = "sha256-dtIlgODzRdoMKnG9050ZcCX3w15A/R3FaMc+ZylvBbU=";
}
2022-03-24 16:16:23 +00:00
{
2022-03-24 17:52:24 +00:00
name = "vscode-typescript-next";
publisher = "ms-vscode";
version = "4.7.20220323";
sha256 = "sha256-mjiBCyg5As/XAU9I5k6jEZWGJA3P6P5o1roe2bS7aUI=";
2022-03-24 16:16:23 +00:00
}
2022-03-24 18:42:27 +00:00
{
name = "nix-ide";
publisher = "jnoortheen";
version = "0.1.20";
sha256 = "sha256-Q6X41I68m0jaCXaQGEFOoAbSUrr/wFhfCH5KrduOtZo=";
}
{
name = "json";
publisher = "ZainChen";
version = "2.0.2";
sha256 = "sha256-nC3Q8KuCtn/jg1j/NaAxWGvnKe/ykrPm2PUjfsJz8aI=";
}
{
name = "prettier-vscode";
publisher = "esbenp";
version = "9.3.0";
sha256 = "sha256-hJgPjWf7a8+ltjmXTK8U/MwqgIZqBjmcCfHsAk2G3PA=";
}
2022-03-24 16:16:23 +00:00
];
2022-03-24 17:52:24 +00:00
})
];
};
}
);
2022-03-24 16:16:23 +00:00
};
}