Last active
April 26, 2024 16:35
-
-
Save SgtPooki/96ef075847f8556c59492925feb1d7d8 to your computer and use it in GitHub Desktop.
shell.nix files for various dev environments
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
{ pkgs ? import <nixpkgs> {} }: | |
pkgs.mkShell { | |
buildInputs = [ | |
pkgs.virtualenv | |
(pkgs.python3.withPackages (ps: with ps; [ | |
ps.pip | |
])) | |
]; | |
shellHook = '' | |
if [ ! -d ".venv" ]; then | |
echo "Creating virtual environment..." | |
virtualenv .venv | |
fi | |
echo "Activating virtual environment..." | |
source .venv/bin/activate | |
echo "Python version: $(python --version)" | |
echo "Pip version: $(pip --version)" | |
if ! pip show aider-chat > /dev/null 2>&1; then | |
echo "Installing aider-chat..." | |
pip install aider-chat | |
else | |
echo "aider-chat is already installed." | |
fi | |
''; | |
} |
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
{ pkgs ? import <nixpkgs> {} }: | |
let | |
deno = import ./deno-installer.nix { inherit pkgs; }; | |
in | |
pkgs.mkShell { | |
buildInputs = [ deno ]; | |
} |
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
{ pkgs ? import <nixpkgs> {} }: | |
pkgs.stdenv.mkDerivation rec { | |
pname = "deno"; | |
version = "1.42.4"; | |
src = pkgs.fetchurl { | |
url = "https://github.com/denoland/deno/releases/download/v${version}/deno-aarch64-apple-darwin.zip"; | |
# curl -sL "https://github.com/denoland/deno/releases/download/v1.42.4/deno-aarch64-apple-darwin.zip" | shasum -a 256 | cut -d " " -f 1 | |
sha256 = "d0589dc6e85a7b938486029908d013daf98ddba00006bcb685c50218eb5d12c3"; | |
}; | |
buildInputs = [ pkgs.unzip ]; # Ensure unzip is available | |
unpackPhase = '' | |
unzip $src -d $TMPDIR | |
sourceRoot=$TMPDIR | |
''; | |
installPhase = '' | |
install -D $sourceRoot/deno -t $out/bin | |
''; | |
meta = with pkgs.lib; { | |
description = "A secure runtime for JavaScript and TypeScript"; | |
homepage = "https://deno.land/"; | |
license = licenses.mit; | |
platforms = [ "aarch64-darwin" ]; | |
}; | |
} |
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
{ pkgs ? import <nixpkgs> {} | |
}: | |
pkgs.mkShell { | |
name="node20-dev-environment"; | |
buildInputs = [ | |
pkgs.nodejs_20 | |
]; | |
shellHook = '' | |
echo "Start developing..." | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment