Skip to content

Commit

Permalink
Update of the nix flake tooling (#1108)
Browse files Browse the repository at this point in the history
  • Loading branch information
hellwolf authored Oct 7, 2022
1 parent 810e423 commit eef6e1f
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 277 deletions.
12 changes: 7 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,19 @@ At minimum, you will need to have these available in your development environmen

You may also use [nix package manager](https://nixos.org/download.html) to get a reproducible, declarative and reliable development environment.

Development shells options are available under `devShells` folder ([nix flakes](https://nixos.wiki/wiki/Flakes) required):
Development shells options are available as different devShells commands in ([nix flakes](https://nixos.wiki/wiki/Flakes) required):

- minimum, minimum development environment for building monorepo.
- whitehat, additional ethereum development toolings including slither, echidna, etc.
- spec, for developing of Superfluid haskell spec.
- spec, for developing of Superfluid haskell spec,
- full, everything included.

To use them:

- `nix develop path:flakes/minimum` or `npm run shell`
- `nix develop path:flakes/whitehat` or `npm run shell:whitehat`
- `nix develop path:flakes/spec` or `npm run shell:spec`
- `nix develop .` or `npm run shell`
- `nix develop .#whitehat` or `npm run shell:whitehat`
- `nix develop .#spec` or `npm run shell:spec`
- `nix develop .#full` or `npm run shell:full`

### Installing Dependencies

Expand Down
26 changes: 0 additions & 26 deletions devShells/minimum/flake.nix

This file was deleted.

43 changes: 0 additions & 43 deletions devShells/spec/flake.lock

This file was deleted.

24 changes: 0 additions & 24 deletions devShells/spec/flake.nix

This file was deleted.

144 changes: 0 additions & 144 deletions devShells/whitehat/flake.lock

This file was deleted.

26 changes: 0 additions & 26 deletions devShells/whitehat/flake.nix

This file was deleted.

12 changes: 6 additions & 6 deletions devShells/minimum/flake.lock → flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 72 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
description = "Flake commands (including dev shells) for working with the monorepo.";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flakeUtils.url = "github:numtide/flake-utils";
foundry.url = "github:shazow/foundry.nix";
};

outputs = { self, nixpkgs, flakeUtils, foundry } :
flakeUtils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
# minimem development shell
minimumEVMDevInputs = with pkgs; [
# for nodejs ecosystem
yarn
nodejs-16_x
# for solidity development
foundry.defaultPackage.${system}
];
# additional tooling for whitehat hackers
whitehatInputs = with pkgs; [
slither-analyzer
echidna
];
# for developing specification
specInputs = with pkgs; [
# for nodejs ecosystem
yarn
gnumake
nodePackages.nodemon
# for haskell spec
cabal-install
haskell.compiler.ghc92
(haskell-language-server.override {
supportedGhcVersions = [ "924" ];
})
hlint
gnuplot
# sage math
sage
# yellow-paper pipeline
haskellPackages.lhs2tex
python39Packages.pygments
(texlive.combine {
inherit (texlive)
scheme-basic metafont
collection-latex collection-latexextra
collection-bibtexextra collection-mathscience
collection-fontsrecommended collection-fontsextra;
})
];
in {
devShells.default = with pkgs; mkShell {
buildInputs = minimumEVMDevInputs;
};
devShells.whitehat = with pkgs; mkShell {
buildInputs = minimumEVMDevInputs
++ whitehatInputs;
};
devShells.spec = with pkgs; mkShell {
buildInputs = specInputs;
};
devShells.full = with pkgs; mkShell {
buildInputs = minimumEVMDevInputs
++ whitehatInputs
++ specInputs;
};
});
}

Loading

0 comments on commit eef6e1f

Please sign in to comment.