2021-08-06 06:54:39 +03:00
|
|
|
{ pkgs }:
|
2021-06-26 08:58:06 +03:00
|
|
|
let
|
|
|
|
args = '' --arg userDefaults "$HOME/.config/hix/hix.conf" --arg src ./.'';
|
|
|
|
# Use HIX_ROOT to override the version of hix used when developing new hix features.
|
|
|
|
# See docs/dev/hix.md for details.
|
|
|
|
hixProject = "\${HIX_ROOT:-${./..}}/hix/project.nix";
|
2021-08-06 06:54:39 +03:00
|
|
|
in pkgs.symlinkJoin {
|
2021-06-26 08:58:06 +03:00
|
|
|
name = "hix";
|
|
|
|
paths = [
|
2021-08-06 06:54:39 +03:00
|
|
|
(pkgs.writeScriptBin "hix-shell" ''
|
2021-06-26 08:58:06 +03:00
|
|
|
nix-shell ${hixProject} ${args} -A shell "$@"
|
|
|
|
'')
|
2021-08-06 06:54:39 +03:00
|
|
|
(pkgs.writeScriptBin "hix-build" ''
|
2021-06-26 08:58:06 +03:00
|
|
|
nix-build ${hixProject} ${args} "$@"
|
|
|
|
'')
|
2021-08-06 06:54:39 +03:00
|
|
|
(pkgs.writeScriptBin "hix-instantiate" ''
|
2021-06-26 08:58:06 +03:00
|
|
|
nix-instantiate ${hixProject} ${args} "$@"
|
|
|
|
'')
|
2021-08-06 06:54:39 +03:00
|
|
|
(pkgs.writeScriptBin "hix-env" ''
|
2021-06-26 08:58:06 +03:00
|
|
|
nix-env -f ${hixProject} ${args} "$@"
|
|
|
|
'')
|
2021-08-06 06:54:39 +03:00
|
|
|
(pkgs.writeScriptBin "hix" ''
|
2021-06-26 08:58:06 +03:00
|
|
|
cmd=$1
|
|
|
|
shift
|
|
|
|
case $cmd in
|
|
|
|
update)
|
|
|
|
nix-env -iA hix -f https://github.com/input-output-hk/haskell.nix/tarball/master
|
|
|
|
;;
|
|
|
|
build|dump-path|eval|log|path-info|run|search|show-derivation|sign-paths|verify|why-depends)
|
|
|
|
nix $cmd -f ${hixProject} ${args} "$@"
|
|
|
|
;;
|
|
|
|
repl)
|
|
|
|
nix $cmd ${hixProject} ${args} "$@"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
nix $cmd "$@"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
'')
|
|
|
|
];
|
|
|
|
} // {
|
|
|
|
project = import ./project.nix;
|
2021-08-06 06:54:39 +03:00
|
|
|
}
|