forked from nix-community/crate2nix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
33 lines (29 loc) · 1010 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
#
# A development shell environment for crate2nix.
#
# This can be used for interactive development.
# A pure version of this is used for "run_tests.sh" and "regenerate_cargo.sh".
#
# Use pinned version of nixos-unstable by default to make sure this works.
# Override with e.g.
# nix-shell --arg pkgs 'import <nixos> {config = {}; }'
{ pkgs ? import ./nix/nixpkgs.nix { config = { }; }
, sources ? import ./nix/sources.nix
, dependencies ? pkgs.callPackage ./nix/dependencies.nix { }
, lib ? pkgs.lib
}:
pkgs.mkShell {
buildInputs = lib.attrValues dependencies.dev;
shellHook = ''
if [ -n "$PS1" ]; then
# We are in an interactive shell
echo "" >&2
echo -e "\e[1mNote\e[0m:" >&2
echo -e " \e[1mcrate2nix\e[0m is not nstalled by shell.nix (this environment) anymore." >&2
echo -e " Please refer to the README.md for other installation methods." >&2
echo "" >&2
fi
export NIX_PATH="nixpkgs=${sources.nixpkgs}"
export IN_CRATE2NIX_SHELL=1;
'';
}