typstfmt icon indicating copy to clipboard operation
typstfmt copied to clipboard

Usage with nix

Open DieracDelta opened this issue 1 year ago • 15 comments

I added pre-commit to my package list, and pre-commit install && pre-commit autoupdate to my nix-shell shellHook. I created a default config (typstfmt --make-default-config), then echoed into the pre-commit config per the readme. When I commit, I get the following error:

[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to /home/jrestivo/.cache/pre-commit/patch1694283539-3337861.
[INFO] Installing environment for https://github.com/astrale-sharp/typstfmt.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Restored changes from /home/jrestivo/.cache/pre-commit/patch1694283539-3337861.
An unexpected error has occurred: CalledProcessError: command: ('/nix/store/hrpvwkjz04s9i4nmli843hyw9z4pwhww-bash-4.4-p23/bin/bash', '-e', '/home/jrestivo/.nix-profile/bin/cargo', 'install', '--bins', '--root', '/home/jrestivo/.cache/pre-commit/repodr4sbjo2/rustenv-system', '--path', '.')
return code: 101
stdout: (none)
stderr:
    error: failed to parse manifest at `/home/jrestivo/.cache/pre-commit/repodr4sbjo2/Cargo.toml`

    Caused by:
      invalid type: map, expected a sequence for key `package.authors`
Check the log at /home/jrestivo/.cache/pre-commit/pre-commit.log

I'm not sure what to make of this. Advice would be appreciated!

Note: I am on NixOS.

DieracDelta avatar Sep 09 '23 18:09 DieracDelta