diff options
| -rwxr-xr-x | scripts/bin/new-shell | 12 | ||||
| -rw-r--r-- | shell/bucklescript.nix | 22 | ||||
| -rw-r--r-- | shell/elm.nix | 15 | ||||
| -rw-r--r-- | shell/go.nix | 9 | ||||
| -rw-r--r-- | shell/haskell.nix | 31 | ||||
| -rw-r--r-- | shell/idris.nix | 14 | ||||
| -rw-r--r-- | shell/purescript.nix | 16 |
7 files changed, 119 insertions, 0 deletions
diff --git a/scripts/bin/new-shell b/scripts/bin/new-shell new file mode 100755 index 0000000..313ef91 --- /dev/null +++ b/scripts/bin/new-shell @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +kind=$1; + +[[ -f "$kind" ]] && echo "You need to specify the type of shell" && exit 1; + +shell_path="$HOME/nixos/shell/$kind.nix"; + +[[ ! -f "$shell_path" ]] && echo "Shell $kind doesn't exist" && exit 1; + +cp $shell_path ./default.nix; + diff --git a/shell/bucklescript.nix b/shell/bucklescript.nix new file mode 100644 index 0000000..62f2db5 --- /dev/null +++ b/shell/bucklescript.nix @@ -0,0 +1,22 @@ +{ pkgs ? import <nixpkgs> {}, ... }: + +let + bsb = pkgs.stdenv.mkDerivation { + name = "rescript-compiler"; + version = "0.0.0"; + src = pkgs.fetchFromGitHub { + user = "rescript-lang"; + repo = "rescript-compiler"; + }; + }; + + packages = with pkgs; [ + bsb + nodejs-15_x + yarn + ]; +in +pkgs.stdenv.mkDerivation { + name = "elm-project"; + buildInputs = packages; +} diff --git a/shell/elm.nix b/shell/elm.nix new file mode 100644 index 0000000..b26fb1e --- /dev/null +++ b/shell/elm.nix @@ -0,0 +1,15 @@ +{ pkgs ? import <nixpkgs> {}, ... }: + +let + packages = with pkgs; [ + elmPackages.elm + elmPackages.create-elm-app + elmPackages.elm-format + elmPackages.elm-language-server + nodejs-15_x + yarn + ]; +in pkgs.stdenv.mkDerivation { + name = "elm-project"; + buildInputs = packages; +} diff --git a/shell/go.nix b/shell/go.nix new file mode 100644 index 0000000..6af8f85 --- /dev/null +++ b/shell/go.nix @@ -0,0 +1,9 @@ +{}: +with import <nixpkgs> {}; +stdenv.mkDerivation { + name = "goenv"; + buildInputs = with pkgs; [ go gopls golangci-lint ]; + shellHook = '' + export GOROOT="${pkgs.go.out}/share/go"; + ''; +} diff --git a/shell/haskell.nix b/shell/haskell.nix new file mode 100644 index 0000000..9f34468 --- /dev/null +++ b/shell/haskell.nix @@ -0,0 +1,31 @@ +{ nixpkgs ? import <nixpkgs> {}, haskellPackages ? nixpkgs.haskellPackages, compiler ? "default", doBenchmark ? false }: + +let + inherit (nixpkgs) pkgs; + systemPackages = [ + haskellPackages.haskell-language-server + haskellPackages.cabal-install + pkgs.entr # Re-run on file change + ]; + + commonHsPackages = with haskellPackages; [ + base + bytestring + containers + random + raw-strings-qq + ]; +in + with haskellPackages; mkDerivation { + pname = "hs-project"; + version = "0.1.0.0"; + src = ./.; + isLibrary = true; + isExecutable = true; + libraryHaskellDepends = commonHsPackages; + executableHaskellDepends = commonHsPackages; + executableSystemDepends = systemPackages; + testHaskellDepends = commonHsPackages ++ [ hspec ]; + license = "MIT"; + hydraPlatforms = stdenv.lib.platforms.none; + } diff --git a/shell/idris.nix b/shell/idris.nix new file mode 100644 index 0000000..4bf4315 --- /dev/null +++ b/shell/idris.nix @@ -0,0 +1,14 @@ +{}: +with import <nixpkgs> {}; +let + idrDependencies = with pkgs.idrisPackages; [ + js + ]; + dependencies = with pkgs; [ + idris2 + ]; +in +stdenv.mkDerivation { + name = "idris-pigeon"; + buildInputs = dependencies ++ idrDependencies; +} diff --git a/shell/purescript.nix b/shell/purescript.nix new file mode 100644 index 0000000..511ed46 --- /dev/null +++ b/shell/purescript.nix @@ -0,0 +1,16 @@ +{ pkgs ? import <nixpkgs> {}, ... }: + +let + packages = with pkgs; [ + purescript + spago + nodePackages.purescript-language-server + dhall-lsp-server + nodejs-15_x + yarn + ]; +in +pkgs.stdenv.mkDerivation { + name = "purescript-proj"; + buildInputs = packages; +} |
