-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell.nix
40 lines (38 loc) · 1.82 KB
/
shell.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
with import <nixpkgs> { }; let
env = bundlerEnv {
ruby = pkgs.ruby;
name = "personal_site-bundler-env";
gemfile = ./Gemfile;
lockfile = ./Gemfile.lock;
gemset = ./gemset.nix;
gemConfig = {
ruby-vips = attrs: {
dontBuild = false;
postInstall = with pkgs; ''
cd "$(cat $out/nix-support/gem-meta/install-path)"
substituteInPlace lib/vips.rb \
--replace "library_name('vips', 42)" '"${lib.getLib vips}/lib/libvips${stdenv.hostPlatform.extensions.sharedLibrary}"' \
--replace "library_name('glib-2.0', 0)" '"${glib.out}/lib/libglib-2.0${stdenv.hostPlatform.extensions.sharedLibrary}"' \
--replace "library_name('gobject-2.0', 0)" '"${glib.out}/lib/libgobject-2.0${stdenv.hostPlatform.extensions.sharedLibrary}"'
'';
};
sass-embedded = attrs: {
DART_SASS = pkgs.fetchurl {
url = "https://github.com/sass/dart-sass/releases/download/1.64.2/dart-sass-1.64.2-linux-x64.tar.gz";
sha256 = "sha256-+RmtceWz5K2xaJZvuaJs31tocby4H/LwBBV15DRBCzs";
};
};
};
};
in
stdenv.mkDerivation {
name = "personal_site";
buildInputs = with pkgs; [ nodejs bundix ] ++ [ env ];
shellHook = ''
export NIX_SHELL="true"
alias prod_landing='JEKYLL_ENV="production" bundle exec jekyll serve --config "_config.yml,_config_landing.yml" --trace --livereload --livereload-port 35733 --port 3003 '
alias prod_blog='JEKYLL_ENV="production" bundle exec jekyll serve --trace --livereload --livereload-port 35732 --port 3002 '
alias dev_landing='bundle exec jekyll serve --config "_config.yml,_config_landing.yml" --trace --livereload --livereload-port 35731 --port 3001 --unpublished'
alias dev_blog='bundle exec jekyll serve --trace --livereload --livereload-port 35730 --port 3000 --unpublished'
'';
}