diff --git a/.devcontainer.json b/.devcontainer.json
new file mode 100644
index 00000000..11fcc81f
--- /dev/null
+++ b/.devcontainer.json
@@ -0,0 +1,35 @@
+{
+ "containerEnv": {
+ "HOME": "/home/vscode"
+ },
+ "containerUser": "vscode",
+ "customizations": {
+ "jetbrains": {
+ "plugins": [
+ "com.jetbrains.rust",
+ "systems.fehn.intellijdirenv"
+ ]
+ },
+ "vscode": {
+ "extensions": [
+ "rust-lang.rust-analyzer",
+ "ms-vscode.cpptools",
+ "mkhl.direnv",
+ "vadimcn.vscode-lldb",
+ "tamasfe.even-better-toml"
+ ],
+ "settings": {
+ "rust-analyzer.cargo.features": [
+ "vendored"
+ ]
+ }
+ }
+ },
+ "image": "ghcr.io/cachix/devenv/devcontainer:latest",
+ "overrideCommand": false,
+ "runArgs": [
+ "--userns=keep-id:uid=1000,gid=1000"
+ ],
+ "updateContentCommand": "devenv test",
+ "updateRemoteUserUID": true
+}
diff --git a/.envrc b/.envrc
new file mode 100644
index 00000000..7e9a2d60
--- /dev/null
+++ b/.envrc
@@ -0,0 +1,10 @@
+export DIRENV_WARN_TIMEOUT=20s
+
+eval "$(devenv direnvrc)"
+
+# `use devenv` supports the same options as the `devenv shell` command.
+#
+# To silence the output, use `--quiet`.
+#
+# Example usage: use devenv --quiet --impure --option services.postgres.enable:bool true
+use devenv
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
new file mode 100644
index 00000000..a5b50cb5
--- /dev/null
+++ b/.github/pull_request_template.md
@@ -0,0 +1,26 @@
+
+## Description
+
+Please describe the changes made in the Pull Request here.
+
+## How to Test
+
+If there are any specific test procedures that pertain to this change in
+particular, you may describe them here.
+
+## Related Issues
+
+If this pull request resolves an issue that can be found in the repository's
+issue tracker, you [may reference the issue here using a keyword](https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword).
+Example: This pull request closes [TODO].
+
+## Checklist
+
+- [ ] I have read, understood, and acknowledged the [NOTICE](https://github.com/namib-project/libcoap-rs/blob/main/NOTICE.md) file and the [Contribution Guide](https://github.com/namib-project/libcoap-rs/blob/main/CONTRIBUTING.md)
+- [ ] I affirm that I have the right to submit the changes made by this pull
+ request under the BSD-2-Clause license as indicated in the NOTICE file.
+- [ ] This PR is either a) free of any LLM-generated code, or b) I have
+ disclosed all uses of LLM-generated code in this pull request and
+ indicated the models that were used.
+ Any submitted LLM-generated code may verifiably be licensed under the
+ BSD-2-Clause license.
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index f29720f2..111a9209 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -28,50 +28,44 @@ jobs:
LLVM_PROFILE_FILE: "${{ github.workspace }}/coverage-data/coverage/libcoap-rs-%p-%m.profraw"
RUSTFLAGS: "${{ matrix.rust_version == 'nightly' && '-Cinstrument-coverage -Cpanic=abort -Zpanic_abort_tests' || ' ' }}"
RUSTDOCFLAGS: "${{ matrix.rust_version == 'nightly' && '-C instrument-coverage -Cpanic=abort -Zpanic_abort_tests -Z unstable-options --persist-doctests target/debug/doctests' || ' ' }}"
- LIBRARY_FEATURES: |
- ${{ (matrix.crate == 'libcoap-rs' && 'tcp,vendored,rand')
- || (matrix.crate == 'libcoap-sys' && 'default,vendored')
- || 'vendored'
- }}
- LIBCOAP_RS_DTLS_BACKEND: ${{ matrix.dtls_backend }}
LIBCOAP_RS_BUILD_SYSTEM: "vendored"
- DTLS_LIBRARY_FEATURES: |
- ${{ (matrix.crate == 'libcoap-rs' && matrix.dtls_backend == 'tinydtls' && 'tcp,dtls-psk,dtls-rpk,dtls-tinydtls-sys-vendored')
- || (matrix.crate == 'libcoap-rs' && matrix.dtls_backend == 'mbedtls' && 'tcp,dtls-psk,dtls-pki')
- || (matrix.crate == 'libcoap-rs' && matrix.dtls_backend == 'openssl' && 'tcp,dtls-psk,dtls-pki,dtls-openssl-sys-vendored')
- || (matrix.crate == 'libcoap-rs' && matrix.dtls_backend == 'gnutls' && 'tcp,dtls-psk,dtls-pki,dtls-rpk')
- || (matrix.crate == 'libcoap-sys' && matrix.dtls_backend == 'tinydtls' && 'dtls,dtls-tinydtls-sys-vendored')
- || (matrix.crate == 'libcoap-sys' && matrix.dtls_backend == 'mbedtls' && 'dtls')
- || (matrix.crate == 'libcoap-sys' && matrix.dtls_backend == 'openssl' && 'dtls,dtls-openssl-sys-vendored')
- || (matrix.crate == 'libcoap-sys' && matrix.dtls_backend == 'gnutls' && 'dtls')
- || 'vendored'
- }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- - uses: dtolnay/rust-toolchain@stable
+ - uses: nixbuild/nix-quick-install-action@v33
+ - name: Restore and save Nix store in GitHub cache
+ uses: nix-community/cache-nix-action@v6
with:
- components: rust-src, rustc, rust-std, cargo, llvm-tools, llvm-tools-preview
- toolchain: ${{ matrix.rust_version == 'msrv' && '1.82' || matrix.rust_version }}
- - if: matrix.dtls_backend == 'gnutls'
- uses: awalsh128/cache-apt-pkgs-action@v1.4.3
- with:
- packages: libgnutls28-dev libgnutls30
- version: 1.0
- - if: matrix.dtls_backend == 'mbedtls'
- uses: awalsh128/cache-apt-pkgs-action@v1.4.3
- with:
- packages: libmbedtls-dev
- version: 1.0
- - run: cargo test -p ${{ matrix.crate }} --no-default-features --features "$LIBRARY_FEATURES" --features "$DTLS_LIBRARY_FEATURES" --no-fail-fast
+ # restore and save a cache using this key
+ primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/devenv.lock') }}
+ # if there's no cache hit, restore a cache by this prefix
+ restore-prefixes-first-match: nix-${{ runner.os }}-
+ # collect garbage until the Nix store size (in bytes) is at most this number
+ # before trying to save a new cache
+ # 1G = 1073741824
+ gc-max-store-size: 3G
+ # do purge caches
+ purge: true
+ # purge all versions of the cache
+ purge-prefixes: nix-${{ runner.os }}-
+ # last accessed more than this number of seconds ago
+ # relative to the start of the `Post Restore and save Nix store` phase
+ purge-last-accessed: 86400
+ # except any version with the key that is the same as the `primary-key`
+ purge-primary-key: never
+ - name: Install devenv.sh using Nix
+ run: nix profile install 'nixpkgs#devenv'
+ - name: Run tests
+ run: devenv shell --option rust-version:string ${{ matrix.rust_version }} ${{ matrix.crate }}:test_${{ matrix.dtls_backend }}
- if: matrix.rust_version == 'nightly'
+ name: Generate coverage data
run: |
mkdir -p coverage-data/test-binaries
mkdir -p target/debug/doctests
- cp $(cargo test -p ${{ matrix.crate }} --no-run --message-format=json --no-default-features --features "$LIBRARY_FEATURES" --features "$DTLS_LIBRARY_FEATURES" --no-fail-fast \
+ devenv shell --option rust-version:string ${{ matrix.rust_version }} 'cp $(${{ matrix.crate }}:test_${{ matrix.dtls_backend }} --no-run --message-format=json --no-fail-fast \
| jq -r "select(.profile.test == true) | .filenames[]" \
- | grep -v dSYM -) coverage-data/test-binaries/
+ | grep -v dSYM -) coverage-data/test-binaries/'
cp -r target/debug/doctests coverage-data/test-binaries/
- if: matrix.rust_version == 'nightly'
uses: actions/upload-artifact@v4
@@ -80,6 +74,8 @@ jobs:
name: test-coverage-data-${{ matrix.crate }}-${{ matrix.dtls_backend }}
path: |
coverage-data/
+ - name: devenv.sh garbage collection
+ run: devenv gc
lint:
name: lint
@@ -88,13 +84,32 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
+ - uses: nixbuild/nix-quick-install-action@v33
+ - name: Restore and save Nix store in GitHub cache
+ uses: nix-community/cache-nix-action@v6
+ with:
+ # restore and save a cache using this key
+ primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/devenv.lock') }}
+ # if there's no cache hit, restore a cache by this prefix
+ restore-prefixes-first-match: nix-${{ runner.os }}-
+ # collect garbage until the Nix store size (in bytes) is at most this number
+ # before trying to save a new cache
+ # 1G = 1073741824
+ gc-max-store-size: 3G
+ # do purge caches
+ purge: true
+ # purge all versions of the cache
+ purge-prefixes: nix-${{ runner.os }}-
+ # last accessed more than this number of seconds ago
+ # relative to the start of the `Post Restore and save Nix store` phase
+ purge-last-accessed: 86400
+ # except any version with the key that is the same as the `primary-key`
+ purge-primary-key: never
+ - name: Install devenv.sh using Nix
+ run: nix profile install 'nixpkgs#devenv'
- uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
- # Nightly required for rustfmt's --emit=checkstyle argument
- - uses: dtolnay/rust-toolchain@nightly
- with:
- components: clippy, rustfmt
- uses: baptiste0928/cargo-install@v3
with:
crate: clippy-reviewdog-filter
@@ -102,7 +117,7 @@ jobs:
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
- reviewdog -reporter=github-pr-check -fail-level=any
+ devenv shell --option rust-version:string nightly reviewdog -reporter=github-pr-check -fail-level=any
docs:
runs-on: ubuntu-latest
@@ -113,16 +128,31 @@ jobs:
with:
submodules: true
ref: ${{ env.HEAD_REF }}
- # --all-features uses GNUTLS as backend, must provide it.
- - uses: awalsh128/cache-apt-pkgs-action@v1.4.3
- with:
- packages: libgnutls28-dev libgnutls30
- version: 1.0
- - uses: dtolnay/rust-toolchain@nightly
+ - uses: nixbuild/nix-quick-install-action@v33
+ - name: Restore and save Nix store in GitHub cache
+ uses: nix-community/cache-nix-action@v6
with:
- components: rustc
+ # restore and save a cache using this key
+ primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/devenv.lock') }}
+ # if there's no cache hit, restore a cache by this prefix
+ restore-prefixes-first-match: nix-${{ runner.os }}-
+ # collect garbage until the Nix store size (in bytes) is at most this number
+ # before trying to save a new cache
+ # 1G = 1073741824
+ gc-max-store-size: 3G
+ # do purge caches
+ purge: true
+ # purge all versions of the cache
+ purge-prefixes: nix-${{ runner.os }}-
+ # last accessed more than this number of seconds ago
+ # relative to the start of the `Post Restore and save Nix store` phase
+ purge-last-accessed: 86400
+ # except any version with the key that is the same as the `primary-key`
+ purge-primary-key: never
+ - name: Install devenv.sh using Nix
+ run: nix profile install 'nixpkgs#devenv'
- name: Build documentation
- run: cargo doc --all-features --no-deps --workspace
+ run: devenv shell docs
- uses: actions/upload-artifact@v4
id: upload-docs
with:
diff --git a/.gitignore b/.gitignore
index bc1dc4b5..11b71119 100644
--- a/.gitignore
+++ b/.gitignore
@@ -87,3 +87,28 @@ fabric.properties
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
+
+# Devenv
+.devenv*
+devenv.local.nix
+
+# direnv
+.direnv
+
+# pre-commit
+.pre-commit-config.yaml
+
+# VSCode, see https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
+# VS Code files for those working on multiple tools
+.vscode/*
+!.vscode/settings.json
+!.vscode/tasks.json
+!.vscode/launch.json
+!.vscode/extensions.json
+!.vscode/*.code-snippets
+
+# Local History for Visual Studio Code
+.history/
+
+# Built Visual Studio Code Extensions
+*.vsix
diff --git a/.idea/editor.xml b/.idea/editor.xml
new file mode 100644
index 00000000..ead1d8a3
--- /dev/null
+++ b/.idea/editor.xml
@@ -0,0 +1,248 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 00000000..369389b4
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/Test_libcoap_rs__GnuTLS_.xml b/.idea/runConfigurations/Test_libcoap_rs__GnuTLS_.xml
new file mode 100644
index 00000000..0493d347
--- /dev/null
+++ b/.idea/runConfigurations/Test_libcoap_rs__GnuTLS_.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/Test_libcoap_rs__MbedTLS_.xml b/.idea/runConfigurations/Test_libcoap_rs__MbedTLS_.xml
new file mode 100644
index 00000000..0696b480
--- /dev/null
+++ b/.idea/runConfigurations/Test_libcoap_rs__MbedTLS_.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/Test_libcoap_rs__OpenSSL_.xml b/.idea/runConfigurations/Test_libcoap_rs__OpenSSL_.xml
new file mode 100644
index 00000000..309f693e
--- /dev/null
+++ b/.idea/runConfigurations/Test_libcoap_rs__OpenSSL_.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/Test.xml b/.idea/runConfigurations/Test_libcoap_rs__no_DTLS_.xml
similarity index 76%
rename from .idea/runConfigurations/Test.xml
rename to .idea/runConfigurations/Test_libcoap_rs__no_DTLS_.xml
index 4f6e6f9d..9dd7e398 100644
--- a/.idea/runConfigurations/Test.xml
+++ b/.idea/runConfigurations/Test_libcoap_rs__no_DTLS_.xml
@@ -1,6 +1,7 @@
-
-
+
+
+
diff --git a/.idea/runConfigurations/Test_libcoap_rs__tinyDTLS_.xml b/.idea/runConfigurations/Test_libcoap_rs__tinyDTLS_.xml
new file mode 100644
index 00000000..b04fdeb8
--- /dev/null
+++ b/.idea/runConfigurations/Test_libcoap_rs__tinyDTLS_.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/Test_libcoap_rs__wolfSSL_.xml b/.idea/runConfigurations/Test_libcoap_rs__wolfSSL_.xml
new file mode 100644
index 00000000..8263f8ca
--- /dev/null
+++ b/.idea/runConfigurations/Test_libcoap_rs__wolfSSL_.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/Test_libcoap_sys__GnuTLS_.xml b/.idea/runConfigurations/Test_libcoap_sys__GnuTLS_.xml
new file mode 100644
index 00000000..e171a334
--- /dev/null
+++ b/.idea/runConfigurations/Test_libcoap_sys__GnuTLS_.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/Test_libcoap_sys__MbedTLS_.xml b/.idea/runConfigurations/Test_libcoap_sys__MbedTLS_.xml
new file mode 100644
index 00000000..46e9efb2
--- /dev/null
+++ b/.idea/runConfigurations/Test_libcoap_sys__MbedTLS_.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/Test_libcoap_sys__OpenSSL_.xml b/.idea/runConfigurations/Test_libcoap_sys__OpenSSL_.xml
new file mode 100644
index 00000000..131d0348
--- /dev/null
+++ b/.idea/runConfigurations/Test_libcoap_sys__OpenSSL_.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/Test_libcoap_sys__tinyDTLS_.xml b/.idea/runConfigurations/Test_libcoap_sys__tinyDTLS_.xml
new file mode 100644
index 00000000..5a2333b8
--- /dev/null
+++ b/.idea/runConfigurations/Test_libcoap_sys__tinyDTLS_.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations/Test_libcoap_sys__wolfSSL_.xml b/.idea/runConfigurations/Test_libcoap_sys__wolfSSL_.xml
new file mode 100644
index 00000000..031ef341
--- /dev/null
+++ b/.idea/runConfigurations/Test_libcoap_sys__wolfSSL_.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.reviewdog.yml b/.reviewdog.yml
index b87a18eb..3b5ff013 100644
--- a/.reviewdog.yml
+++ b/.reviewdog.yml
@@ -1,6 +1,6 @@
runner:
clippy:
- cmd: 'find . -type f -name \*.rs -exec touch {} \;; cargo clippy --message-format json 2>&1 | clippy-reviewdog-filter'
+ cmd: 'find . -type f -name \*.rs -exec touch {} \;; cargo clippy --features vendored --message-format json 2>&1 | clippy-reviewdog-filter'
format: checkstyle
rustfmt:
cmd: 'find . -type f -name \*.rs -exec touch {} \;; cargo fmt -- --emit checkstyle 2>&1'
diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644
index 00000000..3efc5a6a
--- /dev/null
+++ b/.vscode/launch.json
@@ -0,0 +1,156 @@
+{
+ // Use IntelliSense to learn about possible attributes.
+ // Hover to view descriptions of existing attributes.
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+ "version": "0.2.0",
+ "configurations": [
+
+ {
+ "type": "lldb",
+ "request": "launch",
+ "name": "Debug unit tests in library 'libcoap_rs'",
+ "cargo": {
+ "args": [
+ "test",
+ "--no-run",
+ "--lib",
+ "--package=libcoap-rs",
+ "--features=vendored,default,dtls-rpk,dtls-pki"
+ ],
+ "filter": {
+ "name": "libcoap_rs",
+ "kind": "lib"
+ }
+ },
+ "initCommands":["settings set target.disable-aslr false"],
+ "args": [],
+ "cwd": "${workspaceFolder}/libcoap"
+ },
+ {
+ "type": "lldb",
+ "request": "launch",
+ "name": "Debug integration test 'dtls_pki_client_server_test'",
+ "cargo": {
+ "args": [
+ "test",
+ "--no-run",
+ "--test=dtls_pki_client_server_test",
+ "--package=libcoap-rs",
+ "--features=vendored,default,dtls-pki"
+ ],
+ "filter": {
+ "name": "dtls_pki_client_server_test",
+ "kind": "test"
+ }
+ },
+ "initCommands":["settings set target.disable-aslr false"],
+ "args": [],
+ "cwd": "${workspaceFolder}/libcoap"
+ },
+ {
+ "type": "lldb",
+ "request": "launch",
+ "name": "Debug integration test 'dtls_psk_client_server_test'",
+ "cargo": {
+ "args": [
+ "test",
+ "--no-run",
+ "--test=dtls_psk_client_server_test",
+ "--package=libcoap-rs",
+ "--features=vendored,default,dtls-psk,dtls-cid"
+ ],
+ "filter": {
+ "name": "dtls_psk_client_server_test",
+ "kind": "test"
+ }
+ },
+ "initCommands":["settings set target.disable-aslr false"],
+ "args": [],
+ "cwd": "${workspaceFolder}/libcoap"
+ },
+ {
+ "type": "lldb",
+ "request": "launch",
+ "name": "Debug integration test 'dtls_rpk_client_server_test'",
+ "cargo": {
+ "args": [
+ "test",
+ "--no-run",
+ "--test=dtls_rpk_client_server_test",
+ "--package=libcoap-rs",
+ "--features=vendored,default,dtls-rpk"
+ ],
+ "filter": {
+ "name": "dtls_rpk_client_server_test",
+ "kind": "test"
+ }
+ },
+ "initCommands":["settings set target.disable-aslr false"],
+ "args": [],
+ "cwd": "${workspaceFolder}/libcoap"
+ },
+ {
+ "type": "lldb",
+ "request": "launch",
+ "name": "Debug integration test 'tcp_client_server_test'",
+ "cargo": {
+ "args": [
+ "test",
+ "--no-run",
+ "--test=tcp_client_server_test",
+ "--package=libcoap-rs",
+ "--features=vendored,default"
+ ],
+ "filter": {
+ "name": "tcp_client_server_test",
+ "kind": "test"
+ }
+ },
+ "initCommands":["settings set target.disable-aslr false"],
+ "args": [],
+ "cwd": "${workspaceFolder}/libcoap"
+ },
+ {
+ "type": "lldb",
+ "request": "launch",
+ "name": "Debug integration test 'udp_client_server_test'",
+ "cargo": {
+ "args": [
+ "test",
+ "--no-run",
+ "--test=udp_client_server_test",
+ "--package=libcoap-rs",
+ "--features=vendored,default"
+ ],
+ "filter": {
+ "name": "udp_client_server_test",
+ "kind": "test"
+ }
+ },
+ "initCommands":["settings set target.disable-aslr false"],
+ "args": [],
+ "cwd": "${workspaceFolder}/libcoap"
+ },
+ {
+ "type": "lldb",
+ "request": "launch",
+ "name": "Debug unit tests in library 'libcoap_sys'",
+ "cargo": {
+ "args": [
+ "test",
+ "--no-run",
+ "--lib",
+ "--package=libcoap-sys",
+ "--features=vendored,default,dtls-rpk,dtls-pki"
+ ],
+ "filter": {
+ "name": "libcoap_sys",
+ "kind": "lib"
+ }
+ },
+ "initCommands":["settings set target.disable-aslr false"],
+ "args": [],,
+ "cwd": "${workspaceFolder}/libcoap-sys"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 00000000..d3bd4e2e
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,232 @@
+# Contribution Guide for libcoap-rs
+
+1. [Environment Setup](#environment-setup)
+ 1. [Using Nix/devenv.sh natively](#using-nixdevenvsh-natively)
+ 1. [IDE Setup](#ide-setup)
+ 2. [Manual Environment Setup](#manual-environment-setup)
+ 3. [Using Nix/devenv.sh with an IDE using devcontainers](#using-nixdevenvsh-with-an-ide-using-devcontainers)
+2. [Committing your Code](#committing-your-code)
+3. [Submitting a Pull Request](#submitting-a-pull-request)
+ 1. [General and LLM-specific Legal Considerations](#general-and-llm-specific-legal-considerations)
+4. [Conduct Guidelines](#conduct-guidelines)
+
+## Environment Setup
+
+In order to work on or with libcoap-rs, you need an environment that provides
+the necessary dependencies and tools for building the library. You may either
+provide this environment by installing the necessary dependencies yourself or
+by using the Nix-based development shell (based on
+[devenv.sh](https://devenv.sh/)) provided as part of this repository.
+
+If you desire an isolated environment, do not want to install the Nix package
+manager on your system, or want to develop on systems unsupported by Nix while
+still not manually installing the necessary dependencies, we also provide some
+(minimally tested) [Development Containers](https://containers.dev/) for use
+with JetBrains CLion or VS Code.
+
+### Using Nix/devenv.sh natively
+
+Assuming you have the [Nix package manager](https://nixos.org/) installed, you
+can enter the preconfigured development shell from the command line using the
+following commands while in the repository's root directory:
+
+```sh
+# Install devenv in your local profile (if not already installed)
+nix profile add 'nixpkgs#devenv'
+devenv shell
+```
+
+If you have [`direnv`](https://direnv.net/) installed and configured for your
+shell, you may also set the necessary environment variables for your current
+shell by running `direnv allow`. You will typically be prompted for this when
+entering the repository's root directory using your shell (feel free to
+inspect `.envrc` to ensure you're not running untrusted code).
+This way, you can use the preconfigured environment while still utilizing your
+local shell's features and custom configuration.
+
+#### IDE Setup
+
+For VS Code, is should suffice to install the `mkhl.direnv` extension and allow
+the `.envrc` file to use the Nix-provided environment.
+
+On JetBrains IDEs (namely, CLion and RustRover), follow these steps:
+1. Install the [Direnv integration](https://plugins.jetbrains.com/plugin/15285-direnv-integration)
+ plugin.
+ On CLion, also install the [Rust plugin](https://plugins.jetbrains.com/plugin/22407-rust)
+ for language support.
+2. On restart, you will get a notification that prompts you to allow importing
+ the direnv configuration (`.envrc`). Do this.
+3. Go to `File -> Settings -> Languages & Frameworks -> Rust`.
+ Set your toolchain location to `[REPOSITORY ROOT]/.devenv/profile/bin`.
+ Set the standard library (sources) path to
+ `[REPOSITORY ROOT]/.devenv/profile/lib/rustlib/src/rust`.
+ Save your changed settings.
+4. Open `libcoap/Cargo.toml` (not `Cargo.toml` or `libcoap-sys/Cargo.toml`) in
+ the IDE's editor, navigate to the line defining the `vendored` feature, and
+ tick the checkmark to the left (between the line number and the line
+ content).
+ Because the provided development environment doesn't have a system-wide
+ version of the C library to link against, this is necessary to allow the
+ `Cargo` sync/code completion/etc. to work properly.
+
+Note that changes to the environment (due to changes in `devenv.nix` or
+`devenv.lock`) might require an IDE restart to apply.
+
+### Manual Environment Setup
+
+The specifics of manually setting up your environment depend on your operating
+system and remaining environment.
+
+In general, a development environment for libcoap-rs must contain all necessary
+dependencies for building libcoap as well as a recent version of `Rust` (see the
+`libcoap` and `libcoap-sys` crate's `Cargo.toml` for the current Minimum
+Supported Rust Version).
+These dependencies are also necessary for utilizing `libcoap-rs` as a library,
+you can therefore refer to [`BUILDING.md`](BUILDING.md) for the current list
+of dependencies.
+
+Additionally, you will want to install the following tools:
+- `clippy` and `rustfmt` (**strongly recommended**)
+
+ These are static analysis tools we utilize to maintain a consistent code style
+ and prevent common mistakes.
+ If you've been writing Rust code for some time, you're probably already
+ familiar with these tools.
+
+ Resolving all `clippy` warnings and `rustfmt` lints is necessary before your
+ merge/pull request can be accepted. The CI pipeline will also perform these
+ checks and show lints in the Pull/Merge Request overview, but it is easier and
+ quicker to run these tools and resolve these issues before creating a commit,
+ pushing it, or creating a pull request.
+
+ If you are using `rustup`, you can install these tools using
+ `rustup component add rustfmt clippy`.
+- Rust (and possibly C) integrations for your favorite code editor or IDE
+ (**recommended**).
+
+ As libcoap-rs is a Rust binding to a C library, you will probably want your
+ editor to support both languages.
+
+ For VSCode, you can use the `rust-lang.rust-analyzer` and `ms-vscode.cpptools`
+ extensions for syntax highlighting and `vadimcn.vscode-lldb` for
+ running/debugging support.
+
+ If you're using JetBrains IDEs, you can use CLion for C support and install
+ the [Rust plugin](https://plugins.jetbrains.com/plugin/22407-rust) to gain
+ the functionality usually included with RustRover.
+
+### Using Nix/devenv.sh with an IDE using devcontainers
+
+Note: this is only minimally tested, contributions for improvements are welcome.
+
+We also provide a `.devcontainer.json` file conforming to the [Development
+Containers](https://containers.dev/) specification for use with VS Code and
+CLion (RustRover is untested as of now).
+
+If you have the necessary dev container support installed in your IDE, you will
+get a notification asking you whether you want to start the dev container when
+opening the cloned repository.
+
+For VS Code, everything should work out of the box. For CLion, you might have
+to follow the [IDE setup outlined previously](#ide-setup) with the repository
+root at `/IdeaProjects/libcoap-rs`, i.e.:
+- Toolchain location: `/IdeaProjects/libcoap-rs/.devenv/profile/bin`
+- Standard library: `/IdeaProjects/libcoap-rs/.devenv/profile/lib/rustlib/src/rust`
+
+For both IDEs, don't forget to allow importing the direnv config/`.envrc` file
+if prompted.
+
+## Committing your Code
+
+In general, we follow the typical workflow used for open source Git(Hub)
+projects, which can be summed up as follows:
+- If you are not a project member, create a fork of the `libcoap-rs` repository
+- Create a separate branch for each independent "thing" (feature, bugfix, ...)
+ you work on. Try to find a middle ground between creating too many branches
+ for changes that are tightly coupled to each other and creating huge branches
+ full of unrelated changes.
+- Create a separate commit (within reason) for each independent change you make
+ in your branch. Ideally, each commit represents an atomic intermediate step
+ in development that can be independently tested and cherry-picked (although
+ there are many situations in which this is not possible).
+- Commit your changes to the appropriate branch with a descriptive commit
+ message (see below).
+- Prefer rebasing over merging when pulling in changes from the upstream main
+ branch, *unless there is a good reason to merge*.
+- Prefer using [fixup commits](https://git-scm.com/docs/git-commit/2.51.0#Documentation/git-commit.txt---fixupamendrewordcommit)
+ over creating new commits when fixing code created in this branch.
+
+For your commit message, adhere to the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/)
+specification. You may use types other than `fix` and `feat` in your commit
+message where appropriate (e.g., `docs` for documentation changes or
+`refactor` for refactorings). While `libcoap-rs` is not stable, you may omit
+marking breaking changes explicitly.
+
+The first line of your commit message must concisely describe the change you
+made. Ideally, the remainder of the commit message describes both the reasoning
+behind your change as well as any other important information relating to it.
+
+## Submitting a Pull Request
+
+Once you are happy with your changes, you may submit them for upstreaming by
+creating a pull request. The upstream repository provides a template for the
+pull request description that you should use when creating your PR.
+
+Please make sure that your pull request is approprately marked as ready for
+review or as a draft. You may create a draft pull request if you intend to get
+feedback on your code before it is ready for submission. If so, please indicate
+the kind of feedback you want in your pull request description.
+
+Before marking your PR as ready for review, please make sure to rebase and
+[autosquash](https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt---autosquash)
+your branch to clean up the commit history. Once the review process is
+completed and your PR is approved, you should also rebase and squash any changes
+made as part of the review process. **However, please do not rebase and/or
+squash the commit history during the review process, as this will make it harder
+to keep track of changes**.
+
+For your Pull Request to be merged, the following conditions need to be met:
+- You must have checked off all items in the checklist provided in the PR
+ description template.
+- The CI pipeline must complete without failures.
+- All review comments must be addressed/your PR must be approved by a
+ maintainer.
+- Your commit history must be autosquashed to be free of any fixup commits
+ created during the development process (i.e., you must autosquash all fixup
+ commits **after** the review process is completed).
+- Your branch should be free of merge conflicts with the upstream main branch.
+- Your commit history should follow the recommendations made in
+ [the previous section](#committing-your-code).
+
+### General and LLM-specific Legal Considerations
+
+(Disclaimer: I am not a lawyer, take all of this with a grain of salt)
+
+For any code you submit as a contribution to the libcoap-rs repository, you
+**must** ensure that you own all necessary rights to submit said code under the
+project's license (BSD-2-Clause).
+
+Typically (in oversimplified terms), this is the case if you are a) the sole
+author of said contribution and b) have exclusively worked on your contribution
+in your free time. In all other cases, you must check with the appropriate
+rights holders (e.g., the other authors or your employer) before submitting any
+code as a pull/merge request to this repository.
+
+This also has implications regarding the use of code generated using Large
+Language Models (LLMs). Since the legal situation regarding the copyright
+ownership of LLM-generated code is unclear (as of the time this guide is
+written), it is possible that most LLM-generated code is not eligible for
+inclusion in this repository.
+
+Therefore, we will only accept LLM-generated code (i.e., code we deem to likely
+be the output of an LLM) if the use of such a model is a) clearly disclosed and
+b) the model used is verifiably free of any legal issues.
+Any other LLM-generated submission, especially those where use of said
+technologies is not properly disclosed, will be rejected. Intentionally hiding
+the use of LLMs may also result in you being blocked from further contribution.
+
+## Conduct Guidelines
+
+While we do not have a formal code of conduct, we expect any contributor to be
+respectful of others and act appropriately. We reserve the right to exclude any
+contributor for any behavior that we deem to be inappropriate or malicious.
diff --git a/devenv.lock b/devenv.lock
new file mode 100644
index 00000000..94a7c71a
--- /dev/null
+++ b/devenv.lock
@@ -0,0 +1,158 @@
+{
+ "nodes": {
+ "devenv": {
+ "locked": {
+ "dir": "src/modules",
+ "lastModified": 1757852601,
+ "owner": "cachix",
+ "repo": "devenv",
+ "rev": "8190bcacd6077785bc35b03fb281cc410f74d629",
+ "type": "github"
+ },
+ "original": {
+ "dir": "src/modules",
+ "owner": "cachix",
+ "repo": "devenv",
+ "type": "github"
+ }
+ },
+ "flake-compat": {
+ "flake": false,
+ "locked": {
+ "lastModified": 1747046372,
+ "owner": "edolstra",
+ "repo": "flake-compat",
+ "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
+ "type": "github"
+ },
+ "original": {
+ "owner": "edolstra",
+ "repo": "flake-compat",
+ "type": "github"
+ }
+ },
+ "git-hooks": {
+ "inputs": {
+ "flake-compat": "flake-compat",
+ "gitignore": "gitignore",
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1757588530,
+ "owner": "cachix",
+ "repo": "git-hooks.nix",
+ "rev": "b084b2c2b6bc23e83bbfe583b03664eb0b18c411",
+ "type": "github"
+ },
+ "original": {
+ "owner": "cachix",
+ "repo": "git-hooks.nix",
+ "type": "github"
+ }
+ },
+ "gitignore": {
+ "inputs": {
+ "nixpkgs": [
+ "git-hooks",
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1709087332,
+ "owner": "hercules-ci",
+ "repo": "gitignore.nix",
+ "rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
+ "type": "github"
+ },
+ "original": {
+ "owner": "hercules-ci",
+ "repo": "gitignore.nix",
+ "type": "github"
+ }
+ },
+ "mk-shell-bin": {
+ "locked": {
+ "lastModified": 1677004959,
+ "owner": "rrbutani",
+ "repo": "nix-mk-shell-bin",
+ "rev": "ff5d8bd4d68a347be5042e2f16caee391cd75887",
+ "type": "github"
+ },
+ "original": {
+ "owner": "rrbutani",
+ "repo": "nix-mk-shell-bin",
+ "type": "github"
+ }
+ },
+ "nix2container": {
+ "inputs": {
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1752002763,
+ "owner": "nlewo",
+ "repo": "nix2container",
+ "rev": "4f2437f6a1844b843b380d483087ae6d461240ee",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nlewo",
+ "repo": "nix2container",
+ "type": "github"
+ }
+ },
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1755783167,
+ "owner": "cachix",
+ "repo": "devenv-nixpkgs",
+ "rev": "4a880fb247d24fbca57269af672e8f78935b0328",
+ "type": "github"
+ },
+ "original": {
+ "owner": "cachix",
+ "ref": "rolling",
+ "repo": "devenv-nixpkgs",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "devenv": "devenv",
+ "git-hooks": "git-hooks",
+ "mk-shell-bin": "mk-shell-bin",
+ "nix2container": "nix2container",
+ "nixpkgs": "nixpkgs",
+ "pre-commit-hooks": [
+ "git-hooks"
+ ],
+ "rust-overlay": "rust-overlay"
+ }
+ },
+ "rust-overlay": {
+ "inputs": {
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1757817311,
+ "owner": "oxalica",
+ "repo": "rust-overlay",
+ "rev": "7005365b81bcc335f2b744aa30446f4e575e8dc2",
+ "type": "github"
+ },
+ "original": {
+ "owner": "oxalica",
+ "repo": "rust-overlay",
+ "type": "github"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/devenv.nix b/devenv.nix
new file mode 100644
index 00000000..ff813ac7
--- /dev/null
+++ b/devenv.nix
@@ -0,0 +1,206 @@
+{ pkgs, lib, config, inputs, ... }:
+let
+ possible_dtls_libraries = [ "openssl" "mbedtls" "gnutls" "wolfssl" ];
+in {
+ # https://devenv.sh/basics/
+ options = {
+ rust-version = lib.mkOption {
+ type = lib.types.enum [ "msrv" "stable" "nightly" ];
+ default = "stable";
+ description = "Version of the Rust toolchain to use";
+ };
+
+ dtls-library = lib.mkOption {
+ type = lib.types.enum ([ "all" "none" ] ++ possible_dtls_libraries);
+ default = "all";
+ description = "DTLS library/libraries that should be provided for libcoap to link against.";
+ };
+ };
+
+ config = rec {
+ # https://devenv.sh/packages/
+ packages =
+ let wolfssl-libcoap = (pkgs.wolfssl.override {
+ variant = "opensslall";
+ extraConfigureFlags = [
+ "--enable-dtls"
+ "--enable-psk"
+ "--enable-aesccm"
+ "--enable-dh"
+ ];
+ }).overrideAttrs (final: prev: {
+ # Need to override the CFLAGS in the preConfigure script, because
+ # adding more than one CFLAG to extraConfigureFlags causes issues
+ # due to the whitespace (see
+ # https://discourse.nixos.org/t/cmakeflags-and-spaces-in-option-values/20170)
+ preConfigure = ''
+ export CFLAGS="-DHAVE_ALPN -DHAVE_EX_DATA"
+ '';
+ });
+ in with pkgs; (
+ # Generic dependencies. We want LLDB for the VS Code dev container (gdb is also
+ # provided by setting languages.c.enable = true).
+ [ autoconf automake libtool pkg-config lldb rustPlatform.bindgenHook ]
+ # DTLS library specific dependencies
+ ++ (if config.dtls-library == "all" then [ openssl mbedtls gnutls wolfssl-libcoap ]
+ else if config.dtls-library == "openssl" then [ openssl ]
+ else if config.dtls-library == "mbedtls" then [ mbedtls ]
+ else if config.dtls-library == "gnutls" then [ gnutls ]
+ else if config.dtls-library == "wolfssl" then [ wolfssl-libcoap ]
+ else [])
+ );
+
+ # https://devenv.sh/languages/
+ languages = {
+ rust = let
+ # Parse the MSRV from the Cargo.toml files, choose the newer one of both MSRVs.
+ libcoap-msrv = (builtins.fromTOML (builtins.readFile ./libcoap/Cargo.toml)).package.rust-version;
+ libcoap-sys-msrv = (builtins.fromTOML (builtins.readFile ./libcoap-sys/Cargo.toml)).package.rust-version;
+ msrv = if (builtins.compareVersions libcoap-msrv libcoap-sys-msrv) >= 0 then libcoap-msrv else libcoap-sys-msrv;
+ in {
+ enable = true;
+
+ # Explicitly setting the version is not supported when channel == "nixpkgs", so we set it
+ # to stable here if necessary.
+ channel = if config.rust-version == "msrv" then "stable" else config.rust-version;
+ version = if config.rust-version == "msrv" then msrv else if config.rust-version == "nightly" then "2025-09-13" else "latest";
+
+ components = ["rustc" "cargo" "clippy" "rustfmt" "rust-analyzer" "rust-src"];
+ };
+ c = {
+ enable = true;
+ };
+ };
+
+ # https://devenv.sh/processes/
+
+ # https://devenv.sh/services/
+
+ # https://devenv.sh/scripts/
+ scripts = let
+ # Features that should always be enabled for development scripts.
+ default_features = [ "vendored" ];
+ # Features specific to either of the crates.
+ crate_specific_feature_matrix = {
+ libcoap-rs = [ "tcp" "rand" ];
+ libcoap-sys = [ "default" ];
+ };
+ # Feaures specific to some DTLS libraries.
+ dtls_supported_feature_matrix = {
+ openssl = [ "tls" "dtls-psk" "dtls-pki" ];
+ mbedtls = [ "tls" "dtls-psk" "dtls-pki" "dtls-cid" ];
+ gnutls = [ "tls" "dtls-psk" "dtls-pki" "dtls-rpk" ];
+ tinydtls = [ "dtls-psk" "dtls-rpk" "dtls-tinydtls-sys-vendored" ];
+ wolfssl = [ "tls" "dtls-psk" "dtls-pki"];
+ };
+ # This monstrosity of a nix expression generates a script for each crate + dtls library combo that runs all tests available for that specific crate+library combo.
+ in (builtins.listToAttrs (lib.lists.flatten (lib.mapAttrsToList (dtls_lib: dtls_features:
+ if config.dtls-library == "all" || dtls_lib == "tinydtls" || config.dtls-library == dtls_lib then
+ (lib.mapAttrsToList (crate_name: crate_features:
+ (lib.nameValuePair (crate_name + ":test_" + dtls_lib) {
+ exec = ''
+ LIBCOAP_RS_DTLS_BACKEND=${dtls_lib} cargo test -p ${crate_name} --no-default-features --features ${ lib.concatStringsSep "," (default_features ++ crate_features ++ dtls_features) } "$@"
+ '';
+ description = "Run all possible tests for the ${crate_name} crate using the ${dtls_lib} DTLS library.";
+ })
+ ) crate_specific_feature_matrix)
+ else []
+ ) dtls_supported_feature_matrix))) // {
+ # Documentation builder script.
+ docs = let
+ # gnutls has the largest feature set, so prefer using it for the documentation builds.
+ doc_dtls_lib = if config.dtls-library == "all" then "gnutls" else config.dtls-library;
+ in {
+ exec = ''
+ cargo doc --no-deps --workspace --features ${
+ lib.concatStringsSep "," (
+ (map (x: "libcoap-rs/"+x) crate_specific_feature_matrix.libcoap-rs)
+ ++ (map (x: "libcoap-sys/"+x) crate_specific_feature_matrix.libcoap-sys)
+ ++ dtls_supported_feature_matrix."${doc_dtls_lib}"
+ ++ default_features
+ )
+ }
+ '';
+ description = "Build the library documentation";
+ };
+ };
+
+ # A pretty
+ enterShell = ''
+ cat << EOF
+
+ Entering the libcoap-rs development environment!
+
+ Environment-provided DTLS libraries: ${ if config.dtls-library == "all" then lib.concatStringsSep "," possible_dtls_libraries else config.dtls-library}
+
+ Some helpful scripts/commands you can run for your convenience:
+ ${ lib.concatStringsSep "\n" (lib.mapAttrsToList (name: value: "${name} \t${value.description}") scripts) }
+
+ EOF
+ '';
+
+ # https://devenv.sh/tasks/
+ # tasks = {
+ # "myproj:setup".exec = "mytool build";
+ # "devenv:enterShell".after = [ "myproj:setup" ];
+ # };
+
+ # https://devenv.sh/tests/
+ enterTest = ''
+ '';
+
+ # Add clippy and rustfmt checks as git commit hooks.
+ # https://devenv.sh/git-hooks/
+ git-hooks.hooks = {
+ clippy = {
+ enable = true;
+ settings.allFeatures = true;
+ };
+ rustfmt = {
+ enable = true;
+ # Set to check mode so that we don't automatically make changes to the
+ # code.
+ settings.check = true;
+ };
+ };
+
+ # See full reference at https://devenv.sh/reference/options/
+
+ # Development container specification.
+ devcontainer.enable = true;
+ devcontainer.settings = {
+ updateContentCommand = "devenv test";
+
+ # Required for rootless podman, see
+ # https://github.com/cachix/devenv/issues/935.
+ runArgs = [
+ "--userns=keep-id:uid=1000,gid=1000"
+ ];
+ containerUser = "vscode";
+ updateRemoteUserUID = true;
+ containerEnv = {
+ HOME = "/home/vscode";
+ };
+
+ # Install appropriate JetBrains IDE plugins.
+ customizations.jetbrains.plugins = [
+ "com.jetbrains.rust"
+ "systems.fehn.intellijdirenv"
+ ];
+
+ # Install appropraite VS Code extensions.
+ customizations.vscode = {
+ extensions = [
+ "rust-lang.rust-analyzer"
+ "ms-vscode.cpptools"
+ "mkhl.direnv"
+ "vadimcn.vscode-lldb"
+ "tamasfe.even-better-toml"
+ ];
+ settings = {
+ "rust-analyzer.cargo.features" = ["vendored"];
+ };
+ };
+ };
+ };
+}
diff --git a/devenv.yaml b/devenv.yaml
new file mode 100644
index 00000000..290910d1
--- /dev/null
+++ b/devenv.yaml
@@ -0,0 +1,15 @@
+inputs:
+ mk-shell-bin:
+ url: github:rrbutani/nix-mk-shell-bin
+ nix2container:
+ url: github:nlewo/nix2container
+ inputs:
+ nixpkgs:
+ follows: nixpkgs
+ nixpkgs:
+ url: github:cachix/devenv-nixpkgs/rolling
+ rust-overlay:
+ url: github:oxalica/rust-overlay
+ inputs:
+ nixpkgs:
+ follows: nixpkgs