# Miscellaneous Notes ## Quirks about cargo2nix/rust in Nix If you use submodules in your crate (like `crdt` and `replication` in `garage_table`), you must list them in `default.nix` The Windows target does not work. it might be solvable through [overrides](https://github.com/cargo2nix/cargo2nix/blob/master/overlay/overrides.nix). Indeed, we pass `x86_64-pc-windows-gnu` but mingw need `x86_64-w64-mingw32` We have a simple [PR on cargo2nix](https://github.com/cargo2nix/cargo2nix/pull/201) that fixes critical bugs but the project does not seem very active currently. We must use [my patched version of cargo2nix](https://github.com/superboum/cargo2nix) to enable i686 and armv6l compilation. We might need to contribute to cargo2nix in the future. ## Nix Nix has no armv7 + musl toolchains but armv7l is backward compatible with armv6l. Signing keys are generated with: ``` nix-store --generate-binary-cache-key nix.web.deuxfleurs.fr cache-priv-key.pem cache-pub-key.pem ``` We copy the secret key in our nix folder: ``` cp cache-priv-key.pem /etc/nix/signing-key.sec ``` Manually sign We can sign the whole store with: ``` nix sign-paths --all -k /etc/nix/signing-key.sec ``` Or simply the current package and its dependencies with: ``` nix sign-paths --recursive -k /etc/nix/signing-key.sec ``` Setting a key in `nix.conf` will do the signature at build time automatically without additional commands, edit the `nix.conf` of your builder: ```toml secret-key-files = /etc/nix/signing-key.sec max-jobs = auto cores = 8 ``` Now you are ready to build your packages: ```bash cat > $HOME/.awsrc <