diff --git a/nix/Cargo.nix_patches.md b/nix/Cargo.nix_patches.md deleted file mode 100644 index 39ef390580..0000000000 --- a/nix/Cargo.nix_patches.md +++ /dev/null @@ -1,6 +0,0 @@ -Apply these instructions after generating the `Cargo.nix` file. - -- Find `veloren-common` crate in `Cargo.nix`: - - Comment the `optional = true;` line for "structopt" and "csv" dependencies. - - See [this issue](https://github.com/kolloch/crate2nix/issues/129) on `crate2nix` repository for more info. - - Note that the suggested workaround in the issue **does not** work for us. diff --git a/nix/README.md b/nix/README.md index cd0de67841..b5f8812859 100644 --- a/nix/README.md +++ b/nix/README.md @@ -192,7 +192,6 @@ To update `Cargo.nix` (and `crate-hashes.json`) using latest `Cargo.lock`, run: ```shell crate2nix generate -f ../Cargo.toml ``` -Then follow the instructions in the `Cargo.nix_patches.md` file. ### Rust toolchain diff --git a/nix/veloren.nix b/nix/veloren.nix index e7b2912aff..c08457b117 100644 --- a/nix/veloren.nix +++ b/nix/veloren.nix @@ -73,7 +73,16 @@ let callPackage ./Cargo.nix { defaultCrateOverrides = with common; with crateDeps; defaultCrateOverrides // { - veloren-common = _: { + veloren-common = oldAttrs: { + # see: https://github.com/kolloch/crate2nix/issues/129 + dependencies = + map + (dep: + if dep.name == "csv" || dep.name == "structopt" + then builtins.removeAttrs dep [ "optional" ] + else dep) + oldAttrs.dependencies; + # Disable `git-lfs` check here since we check it ourselves # We have to include the command output here, otherwise Nix won't run it DISABLE_GIT_LFS_CHECK = utils.isGitLfsSetup common.gitLfsCheckFile;