Skip to content

Instantly share code, notes, and snippets.

@mgreenly
Created April 8, 2025 12:41
Show Gist options
  • Save mgreenly/60642c951123da4287acfa603a152eba to your computer and use it in GitHub Desktop.
Save mgreenly/60642c951123da4287acfa603a152eba to your computer and use it in GitHub Desktop.
simple ruby shell.nix
let
tarball = fetchTarball "https://github.com/NixOS/nixpkgs/archive/refs/tags/24.11.tar.gz";
pkgs = import tarball { config = {}; overlays = []; };
in
pkgs.mkShell {
packages = with pkgs; [
nodejs
ruby
];
nativeBuildInputs = with pkgs; [
pkg-config
libyaml
postgresql
mariadb
];
shellHook = with pkgs; ''
export LOCALE_ARCHIVE="${glibcLocales}/lib/locale/locale-archive";
export PS1='\[\e[93;1;2m\]nix-shell@\W\[\e[0m\]\\$ '
export GEM_HOME=$PWD/.nix-gems
export GEM_PATH=$PWD/.nix-gems:${ruby}/${ruby.gemPath}
export PATH=$PWD/.nix-gems/bin:$PATH
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment