-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
38 lines (36 loc) · 951 Bytes
/
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
with import <nixpkgs> {};
let
nix_pkgs_with_hugo_106 = import (builtins.fetchGit {
name = "nix_pkgs_with_hugo_106";
url = "https://github.com/NixOS/nixpkgs/";
ref = "refs/heads/nixos-22.11";
rev = "6adf48f53d819a7b6e15672817fa1e78e5f4e84f";
}) {};
os = if pkgs.system == "x86_64-darwin"
then "darwin"
else "linux";
in stdenv.mkDerivation {
name = "node";
buildInputs = [
git
nodejs
yarn
nix_pkgs_with_hugo_106.hugo
];
shellHook = ''
export PATH="$PWD/node_modules/.bin/:$PATH"
mkdir -p $PWD/node_modules/.bin/hugo
if [ ! -f $PWD/node_modules/.bin/hugo/hugo ]
then
ln -s ${nix_pkgs_with_hugo_106.hugo}/bin/hugo $PWD/node_modules/.bin/hugo/hugo
fi
cat <<EOT > $PWD/node_modules/.bin/hugo/version.json
{
"arch": "x64",
"extended": true,
"os": "${os}",
"version": "0.106.0"
}
EOT
'';
}