on 19052d8 help sign in
haskell.nix/hix/default.nix
43 lines 1.2 kB history raw
1{ pkgs }:
2let
3 args = '' --arg userDefaults "$HOME/.config/hix/hix.conf" --arg src ./.'';
4 # Use HIX_ROOT to override the version of hix used when developing new hix features.
5 # See docs/dev/hix.md for details.
6 hixProject = "\${HIX_ROOT:-${./..}}/hix/project.nix";
7in pkgs.symlinkJoin {
8 name = "hix";
9 paths = [
10 (pkgs.writeScriptBin "hix-shell" ''
11 nix-shell ${hixProject} ${args} -A shell "$@"
12 '')
13 (pkgs.writeScriptBin "hix-build" ''
14 nix-build ${hixProject} ${args} "$@"
15 '')
16 (pkgs.writeScriptBin "hix-instantiate" ''
17 nix-instantiate ${hixProject} ${args} "$@"
18 '')
19 (pkgs.writeScriptBin "hix-env" ''
20 nix-env -f ${hixProject} ${args} "$@"
21 '')
22 (pkgs.writeScriptBin "hix" ''
23 cmd=$1
24 shift
25 case $cmd in
26 update)
27 nix-env -iA hix -f https://github.com/input-output-hk/haskell.nix/tarball/master
28 ;;
29 build|dump-path|eval|log|path-info|run|search|show-derivation|sign-paths|verify|why-depends)
30 nix $cmd -f ${hixProject} ${args} "$@"
31 ;;
32 repl)
33 nix $cmd ${hixProject} ${args} "$@"
34 ;;
35 *)
36 nix $cmd "$@"
37 ;;
38 esac
39 '')
40 ];
41} // {
42 project = import ./project.nix;