daml/shell.nix
Claudio Bley 823c3eb34a
Use POSIX compliant check for DADE_NO_PRE_COMMIT (#15827)
It did not work when using an old Bash version:
```
./.envrc: line 8: [: -v: unary operator expected
```
2022-12-07 22:10:18 +01:00

12 lines
356 B
Nix

{ pkgs ? import ./nix/nixpkgs.nix { }
, default ? import ./nix/default.nix { inherit pkgs; }
}:
pkgs.mkShell {
buildInputs = pkgs.lib.attrsets.mapAttrsToList (name: value: value) default.toolAttrs;
shellHook = ''
# install pre-commit hook (opt-out by setting `DADE_NO_PRE_COMMIT`)
test "x$DADE_NO_PRE_COMMIT" = x && pre-commit install
'';
}