-
Notifications
You must be signed in to change notification settings - Fork 23
/
flake.nix
59 lines (51 loc) · 1.51 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
let
out = system:
let
pkgs = import nixpkgs {
inherit system;
};
gems = pkgs.bundlerEnv {
name = "your-package";
inherit (pkgs) ruby;
gemdir = ./.;
};
lock-gems = pkgs.writeShellScriptBin "lock-gems" ''
bundle lock
bundix -l
'';
in
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
bundler
ruby
bundix
gems
lock-gems
# in case you choose to `bundle install` manually (you do not
# need to do this)
zlib
libxml2
lzma
pkg-config
libxslt
];
env = {
# evil hack to make ruby not think it is 1970 and utf-8 does not exist
LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive";
# make nokogiri compile way faster because we have good system libs
BUNDLE_BUILD__NOKOGIRI = "--use-system-libraries";
# bundle please don't put x86_64-linux in the lock file >:(
BUNDLE_FORCE_RUBY_PLATFORM = "true";
};
};
};
in
flake-utils.lib.eachDefaultSystem out;
}