Skip to content

Instantly share code, notes, and snippets.

@ento
Last active October 31, 2018 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ento/a77fb97f581bdea4ed27c845107308bf to your computer and use it in GitHub Desktop.
Save ento/a77fb97f581bdea4ed27c845107308bf to your computer and use it in GitHub Desktop.
.bundle/
.overcommit.yml
vendor/

How to verify:

  1. Install nix
  2. Clone this gist and install overcommit twice in nix-shell:
git clone https://gist.github.com/ento/a77fb97f581bdea4ed27c845107308bf
# or git@gist.github.com:a77fb97f581bdea4ed27c845107308bf.git
cd a77fb97f581bdea4ed27c845107308bf
nix-shell
overcommit --install
overcommit --install # this fails
[ -w .git/hooks/overcommit-hook ] && echo "Master hook is writable" || echo "Master hooks is not writable"
# frozen_string_literal: true
source "https://rubygems.org"
group :development do
gem 'overcommit'
end
GEM
remote: https://rubygems.org/
specs:
childprocess (0.9.0)
ffi (~> 1.0, >= 1.0.11)
ffi (1.9.25)
iniparse (1.4.4)
overcommit (0.46.0)
childprocess (~> 0.6, >= 0.6.3)
iniparse (~> 1.4)
PLATFORMS
ruby
DEPENDENCIES
overcommit
BUNDLED WITH
1.16.3
{
childprocess = {
dependencies = ["ffi"];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0a61922kmvcxyj5l70fycapr87gz1dzzlkfpq85rfqk5vdh3d28p";
type = "gem";
};
version = "0.9.0";
};
ffi = {
source = {
remotes = ["https://rubygems.org"];
sha256 = "0jpm2dis1j7zvvy3lg7axz9jml316zrn7s0j59vyq3qr127z0m7q";
type = "gem";
};
version = "1.9.25";
};
iniparse = {
source = {
remotes = ["https://rubygems.org"];
sha256 = "1xbik6838gfh5yq9ahh1m7dzszxlk0g7x5lvhb8amk60mafkrgws";
type = "gem";
};
version = "1.4.4";
};
overcommit = {
dependencies = ["childprocess" "iniparse"];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0jfgpprjkq7hkyk7z0wc8difnnzmvmkin0b3bgsmnh6vvpyrz0mn";
type = "gem";
};
version = "0.46.0";
};
}
all: gemset.nix
gemset.nix: Gemfile
nix-shell -p bundix --run 'bundix --magic --lock'
{ pkgs ? import <nixpkgs> {} }:
let
gems = pkgs.bundlerEnv {
name = "overcommit-nix-mcve";
ruby = pkgs.ruby_2_5;
gemdir = ./.;
groups = ["default" "development" "test"];
};
in
pkgs.mkShell {
buildInputs = [
pkgs.ruby_2_5
gems
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment