70 lines
1.7 KiB
Nix
70 lines
1.7 KiB
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
flake-utils = {
|
|
url = "github:numtide/flake-utils";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
pre-commit-hooks = {
|
|
url = "github:cachix/pre-commit-hooks.nix";
|
|
# inputs.nixpkgs.follows = "nixpgs";
|
|
};
|
|
};
|
|
outputs =
|
|
{
|
|
self,
|
|
nixpkgs,
|
|
flake-utils,
|
|
pre-commit-hooks,
|
|
...
|
|
}:
|
|
flake-utils.lib.eachDefaultSystem (
|
|
system:
|
|
let
|
|
pkgs = import nixpkgs { inherit system; };
|
|
in
|
|
with pkgs;
|
|
{
|
|
checks = {
|
|
# On every git commit, format the F# code first
|
|
pre-commit-check = pre-commit-hooks.lib.${system}.run {
|
|
src = ./.;
|
|
hooks = {
|
|
fantomas = {
|
|
enable = true;
|
|
name = "fantomas";
|
|
description = "Format your F# code with fantomas.";
|
|
entry = "dotnet fantomas";
|
|
files = "(\\.fs$)|(\\.fsx$)";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
devShells.default = mkShell {
|
|
inherit (self.checks.${system}.pre-commit-check) shellHook;
|
|
nativeBuildInputs = [
|
|
fsautocomplete
|
|
netcdf
|
|
# dotnet-sdk_8
|
|
gdb
|
|
rustup
|
|
(python3.withPackages (
|
|
python-pkgs: with python-pkgs; [
|
|
numpy
|
|
pillow
|
|
matplotlib
|
|
seaborn
|
|
pandas
|
|
]
|
|
))
|
|
# pipenv
|
|
];
|
|
LD_LIBRARY_PATH = lib.makeLibraryPath [
|
|
netcdf
|
|
openssl_3_3
|
|
];
|
|
};
|
|
}
|
|
);
|
|
}
|