Neovim IDE in a NixOS Docker Container
docker run --volumes-from=nix -it \
-v $(pwd):/home \
-w /home \
--name <change-me> \
-p 9005:9005 \
-p 3000:3000 \| {-# LANGUAGE OverloadedStrings #-} | |
| module Example where | |
| import Language.Marlowe | |
| main :: IO () | |
| main = print . pretty $ contract | |
| {- Define a contract, Close is the simplest contract which just ends the contract straight away |
| pragma solidity >=0.4.21 <0.7.0; | |
| // It's important to avoid vulnerabilities due to numeric overflow bugs | |
| // OpenZeppelin's SafeMath library, when used correctly, protects agains such bugs | |
| // More info: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2018/\ | |
| // november/smart-contract-insecurity-bad-arithmetic/ | |
| import "@openzeppelin/contracts/math/SafeMath.sol"; | |
| import "@Openzeppelin/contracts/access/Ownable.sol"; |
| with import <nixpkgs> {}; | |
| # with pkgs; | |
| stdenv.mkDerivation { | |
| name = "ipfsenv"; | |
| buildInputs = [ipfs]; | |
| shellHook = '' | |
| ipfs init |
| with import <nixpkgs> {}; | |
| # with pkgs; | |
| stdenv.mkDerivation { | |
| name = "dapp_monkey"; | |
| buildInputs = [python37 nodejs]; | |
| shellHook = '' | |
| npm install body-parser express morgan nodemon web3 |
| with import <nixpkgs> {}; | |
| # with pkgs; | |
| stdenv.mkDerivation { | |
| name = "Express API"; | |
| buildInputs = [python37 nodejs]; | |
| shellHook = '' | |
| npm install bitcoin-core bitcoinjs-lib bitcoinjs-message body-parser crypto-js express hex2ascii morgan nodemon |
| # This imports the nix package collection, | |
| # so we can access the `pkgs` and `stdenv` variables | |
| with import <nixpkgs> {}; | |
| # Make a new "derivation" that represents our shell | |
| stdenv.mkDerivation { | |
| name = "haskell_env"; | |
| # The packages in the `buildInputs` list will be added to the PATH in our shell | |
| buildInputs = [ |
| { nixpkgs ? import <nixpkgs> {} }: | |
| let | |
| inherit (nixpkgs) pkgs; | |
| inherit (pkgs) haskellPackages; | |
| haskellDeps = ps: with ps; [ | |
| base | |
| lens | |
| mtl | |
| ]; |
| " Neovim Plugins https://github.com/neovim/neovim/wiki/Related-projects#plugins | |
| " vim-plug Plugin Manager - https://github.com/junegunn/vim-plug#usage | |
| " Specify a directory for plugins | |
| " - For Neovim: ~/.local/share/nvim/plugged | |
| " - For Vim: ~.vim/plugged | |
| " - Avoid using standard Vim directory names like 'plugin' | |
| " - Reload .vimrc and :PlugInstall to install plugins. | |
| call plug#begin('~/.local/share/nvim/plugged') | |
| " Make sure you use single quotes |