mirror of
https://github.com/ilyakooo0/haskell.nix.git
synced 2024-09-11 15:05:33 +03:00
* Include dependencies of haskell.nix that were tracked in `nix/sources.json` as flake inputs (`flake.lock` replaces `nix/sources.json`). * Use `flake-compat` to continue to provide a compatible interface for non flake projects. Co-authored-by: Alexander Bantyev <balsoft@balsoft.ru> Co-authored-by: Shea Levy <shea@shealevy.com>
44 lines
1.2 KiB
Nix
44 lines
1.2 KiB
Nix
{ pkgs }:
|
|
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";
|
|
in pkgs.symlinkJoin {
|
|
name = "hix";
|
|
paths = [
|
|
(pkgs.writeScriptBin "hix-shell" ''
|
|
nix-shell ${hixProject} ${args} -A shell "$@"
|
|
'')
|
|
(pkgs.writeScriptBin "hix-build" ''
|
|
nix-build ${hixProject} ${args} "$@"
|
|
'')
|
|
(pkgs.writeScriptBin "hix-instantiate" ''
|
|
nix-instantiate ${hixProject} ${args} "$@"
|
|
'')
|
|
(pkgs.writeScriptBin "hix-env" ''
|
|
nix-env -f ${hixProject} ${args} "$@"
|
|
'')
|
|
(pkgs.writeScriptBin "hix" ''
|
|
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;
|
|
}
|