-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
159 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,88 @@ | ||
################################################################## | ||
# Development shells | ||
################################################################## | ||
{ pkgs, precommit }: | ||
{ self, ... }: | ||
|
||
{ | ||
# | ||
# | ||
# $ nix develop github:r17x/nixpkgs | ||
# | ||
# | ||
default = pkgs.mkShell { | ||
description = "r17x/nixpkgs development environment"; | ||
shellHook = precommit.shellHook or ''''; | ||
buildInputs = precommit.buildInputs or [ ]; | ||
packages = precommit.packages or [ ]; | ||
}; | ||
perSystem = { pkgs, ... }: | ||
{ | ||
pre-commit.check.enable = true; | ||
pre-commit.devShell = self.devShells.default; | ||
pre-commit.settings.hooks = { | ||
actionlint.enable = true; | ||
shellcheck.enable = true; | ||
stylua.enable = true; | ||
# TODO https://github.com/cachix/pre-commit-hooks.nix/issues/196 | ||
# make override and pass configuration | ||
luacheck.enable = false; | ||
|
||
# | ||
# | ||
# $ nix develop github:r17x/nixpkgs#node18 | ||
# | ||
# | ||
node18 = pkgs.mkShell { | ||
description = "Node.js 18 Development Environment"; | ||
buildInputs = with pkgs; [ | ||
nodejs_18 | ||
(nodePackages.yarn.override { nodejs = nodejs_18; }) | ||
]; | ||
}; | ||
# .nix related | ||
deadnix.enable = true; | ||
nixpkgs-fmt.enable = true; | ||
}; | ||
|
||
# | ||
# | ||
# $ nix develop github:r17x/nixpkgs#ocamlorg | ||
# | ||
# | ||
ocamlorg = | ||
let ocamlPackages = pkgs.ocaml-ng.ocamlPackages_4_14; in | ||
pkgs.mkShell { | ||
description = "OCaml.org development environment"; | ||
buildInputs = with ocamlPackages; [ ocaml merlin ]; | ||
nativeBuildInputs = with pkgs; [ | ||
opam | ||
pkg-config | ||
libev | ||
oniguruma | ||
openssl | ||
gmp | ||
]; | ||
}; | ||
|
||
# | ||
# | ||
# $ nix develop github:r17x/nixpkgs#pnpm | ||
# | ||
# | ||
pnpm = pkgs.mkShell { | ||
description = "Nodejs with PNPM"; | ||
devShells = { | ||
default = pkgs.mkShell { }; | ||
# | ||
# | ||
# $ nix develop github:r17x/nixpkgs#node18 | ||
# | ||
# | ||
node18 = pkgs.mkShell { | ||
description = "Node.js 18 Development Environment"; | ||
buildInputs = with pkgs; [ | ||
nodejs_18 | ||
(nodePackages.yarn.override { nodejs = nodejs_18; }) | ||
]; | ||
}; | ||
|
||
# | ||
# | ||
# $ nix develop github:r17x/nixpkgs#ocamlorg | ||
# | ||
# | ||
ocamlorg = | ||
let ocamlPackages = pkgs.ocaml-ng.ocamlPackages_4_14; in | ||
pkgs.mkShell { | ||
description = "OCaml.org development environment"; | ||
buildInputs = with ocamlPackages; [ ocaml merlin ]; | ||
nativeBuildInputs = with pkgs; [ | ||
opam | ||
pkg-config | ||
libev | ||
oniguruma | ||
openssl | ||
gmp | ||
]; | ||
}; | ||
|
||
# | ||
# | ||
# $ nix develop github:r17x/nixpkgs#pnpm | ||
# | ||
# | ||
pnpm = pkgs.mkShell { | ||
description = "Nodejs with PNPM"; | ||
|
||
buildInputs = with pkgs; [ | ||
nodejs_18 | ||
(nodePackages.pnpm.override { nodejs = nodejs_18; }) | ||
]; | ||
}; | ||
buildInputs = with pkgs; [ | ||
nodejs_18 | ||
(nodePackages.pnpm.override { nodejs = nodejs_18; }) | ||
]; | ||
}; | ||
|
||
# | ||
# | ||
# $ nix develop github:r17x/nixpkgs#rust-wasm | ||
# | ||
# | ||
rust-wasm = pkgs.mkShell { | ||
# declared ENV variables when starting shell | ||
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}"; | ||
# | ||
# | ||
# $ nix develop github:r17x/nixpkgs#rust-wasm | ||
# | ||
# | ||
rust-wasm = pkgs.mkShell { | ||
# declared ENV variables when starting shell | ||
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}"; | ||
|
||
nativeBuildInputs = with pkgs; [ rustc cargo gcc rustfmt clippy ]; | ||
}; | ||
nativeBuildInputs = with pkgs; [ rustc cargo gcc rustfmt clippy ]; | ||
}; | ||
}; | ||
|
||
}; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters