Created
January 22, 2022 21:44
-
-
Save jonknapp/c5930b532d0a145124a4cef04b3a132e to your computer and use it in GitHub Desktop.
nix shell script that provides the env needed to "rails new" a project
This file contains hidden or 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
# https://ghedam.at/15978/an-introduction-to-nix-shell | |
with (import <nixpkgs> {}); | |
mkShell { | |
buildInputs = [ | |
gcc | |
gnumake | |
libiconv | |
libxml2 | |
libxslt | |
nodejs | |
openssl | |
pkgconfig | |
postgresql | |
readline | |
ruby | |
yarn | |
zlib | |
]; | |
shellHook = '' | |
gem_home=$(mktemp -d) | |
echo "Using temporary folder for gems... $gem_home" | |
export GEM_HOME=$gem_home | |
export GEM_PATH=$GEM_HOME | |
export PATH=$GEM_HOME/bin:$PATH | |
export name="rails-bootstrap: $gem_home" | |
gem list -i ^bundler$ || gem install bundler --no-document | |
gem list -i ^rails$ || gem install rails --no-document | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment