-
Notifications
You must be signed in to change notification settings - Fork 3
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
14 changed files
with
75 additions
and
287 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,11 +1,3 @@ | ||
if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then | ||
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs=" | ||
fi | ||
source_url "https://raw.githubusercontent.com/cachix/devenv/d1f7b48e35e6dee421cfd0f51481d17f77586997/direnvrc" "sha256-YBzqskFZxmNb3kYVoKD9ZixoPXJh1C9ZvTLGFRkauZ0=" | ||
|
||
nix_direnv_watch_file devenv.nix | ||
nix_direnv_watch_file devenv.lock | ||
nix_direnv_watch_file devenv.yaml | ||
if ! use flake . --impure | ||
then | ||
echo "devenv could not be build. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2 | ||
fi | ||
use devenv |
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
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 |
---|---|---|
|
@@ -3,4 +3,5 @@ | |
.ghcup/ | ||
node_modules/ | ||
|
||
.devenv.flake.nix | ||
.pre-commit-config.yaml |
This file was deleted.
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
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ pkgs, ... }: | ||
|
||
{ | ||
languages.javascript.enable = true; | ||
|
||
pre-commit.hooks = { | ||
shellcheck.enable = true; | ||
shfmt.enable = true; | ||
}; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
inputs: | ||
nixpkgs: | ||
url: github:NixOS/nixpkgs/nixpkgs-unstable |
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,44 +1,42 @@ | ||
#!/usr/bin/env bash | ||
|
||
asdf_plugin_path() { | ||
echo "$(dirname "$(dirname "$0")")" | ||
dirname "$(dirname "$0")" | ||
} | ||
|
||
ghcup_bin_dir() { | ||
echo "$(asdf_plugin_path)/.ghcup/bin" | ||
echo "$(asdf_plugin_path)/.ghcup/bin" | ||
} | ||
|
||
ensure_ghcup() { | ||
if ! test -f "$(ghcup_bin_dir)/ghcup" | ||
then | ||
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | env \ | ||
BOOTSTRAP_HASKELL_MINIMAL=1 \ | ||
BOOTSTRAP_HASKELL_NONINTERACTIVE=1 \ | ||
GHCUP_INSTALL_BASE_PREFIX="$(asdf_plugin_path)" \ | ||
sh > /dev/null | ||
fi | ||
if ! test -f "$(ghcup_bin_dir)/ghcup"; then | ||
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | env \ | ||
BOOTSTRAP_HASKELL_MINIMAL=1 \ | ||
BOOTSTRAP_HASKELL_NONINTERACTIVE=1 \ | ||
GHCUP_INSTALL_BASE_PREFIX="$(asdf_plugin_path)" \ | ||
sh >/dev/null | ||
fi | ||
} | ||
|
||
list_all_versions() { | ||
ensure_ghcup | ||
"$(ghcup_bin_dir)/ghcup" list -t "$1" -r | awk '{printf $2" "}' | ||
ensure_ghcup | ||
"$(ghcup_bin_dir)/ghcup" list -t "$1" -r | awk '{printf $2" "}' | ||
} | ||
|
||
ver() { | ||
echo "$1" | awk -F . '{ printf("%02d%02d", $1,$2); }' | ||
echo "$1" | awk -F . '{ printf("%02d%02d", $1,$2); }' | ||
} | ||
|
||
install_version() { | ||
local tool="$1" | ||
local version="$2" | ||
local path="$3" | ||
|
||
ensure_ghcup | ||
|
||
if [[ "$tool" == "ghc" ]] || { [[ "$tool" == "hls" ]] && [[ $(ver "$version") -ge $(ver "1.7") ]]; } | ||
then | ||
"$(ghcup_bin_dir)/ghcup" install "$tool" "$version" -i "$path" | ||
else | ||
"$(ghcup_bin_dir)/ghcup" install "$tool" "$version" -i "${path}/bin" | ||
fi | ||
local tool="$1" | ||
local version="$2" | ||
local path="$3" | ||
|
||
ensure_ghcup | ||
|
||
if [[ $tool == "ghc" ]] || { [[ $tool == "hls" ]] && [[ $(ver "$version") -ge $(ver "1.7") ]]; }; then | ||
"$(ghcup_bin_dir)/ghcup" install "$tool" "$version" -i "$path" | ||
else | ||
"$(ghcup_bin_dir)/ghcup" install "$tool" "$version" -i "${path}/bin" | ||
fi | ||
} |
Submodule bats
deleted from
e9fd17
Oops, something went wrong.