Skip to content

Instantly share code, notes, and snippets.

@emptyflask
Created October 29, 2019 20:34
Show Gist options
  • Save emptyflask/99f310df9fadd8419571599ce25eed88 to your computer and use it in GitHub Desktop.
Save emptyflask/99f310df9fadd8419571599ce25eed88 to your computer and use it in GitHub Desktop.
ruby nix shell
import ( builtins.fetchGit {
name = "nixpkgs-2019-08-25";
url = https://github.com/nixos/nixpkgs/;
rev = "8d1510abfb592339e13ce8f6db6f29c1f8b72924";
}) {
config = {
allowUnfree = true;
};
}
{pkgs, bundlerEnv, ...}:
with pkgs;
bundlerEnv {
inherit ruby_2_6;
name = "chronos-env";
gemdir = ../.;
groups = ["default" "development" "production" "test" "mover" "toolbox"];
gemConfig.openssl = attrs: {
buildInputs = [ openssl ];
};
gemConfig.pg = attrs: {
buildInputs = [ postgresql_9_6 ];
};
gemConfig.nokogiri = attrs: {
buildInputs = [ libiconv zlib ];
};
gemConfig.sassc = attrs: {
buildInputs = [ libsass ];
shellHook = ''
export SASS_LIBSASS_PATH=${libsass}
'';
};
}
{ pkgs ? import ./nix/config.nix }:
let
rubyenv = import ./nix/rubyenv.nix;
in pkgs.mkShell {
buildInputs = with pkgs; [
bundix
bundler
circleci-cli
elasticsearch5
libxml2
nodejs
postgresql_9_6
rubyenv
rubyenv.wrappedRuby
solargraph
yarn
];
}
@shepting
Copy link

Did you get this working? I seem to get a error: cannot coerce a function to a string, at /nix/store/278sb96d8sm0my75msa6mihis2jgh2ls-nixpkgs-2019-08-25/pkgs/build-support/mkshell/default.nix:28:3 message when running nix-shell shell.nix

@emptyflask
Copy link
Author

I don't think I've seen that error before with this configuration, but I'd recommend taking a look at https://github.com/emptyflask/rails-nix for some more up-to-date code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment