chore: complete deprecate nimbus-build-system

This commit is contained in:
darshankabariya 2026-02-10 03:06:58 +05:30
parent a9f9327b97
commit ad5b5a74e9
No known key found for this signature in database
GPG Key ID: 9A92CCD9899F0D22
4 changed files with 52 additions and 47 deletions

View File

@ -1,16 +1,30 @@
# nim-e2e-reliability
Nim implementation of the e2e reliability protocol
# nim-sds
Nim implementation of the e2e reliability protocol.
## Quick start
```bash
# Build the shared library
nix build '.?submodules=1#libsds'
# Run tests
nix develop '.?submodules=1' --command nim test sds.nims
# Clean the Nix store
nix run '.#clean'
```
## Building
### Nix (recommended)
### Desktop
Build the shared library:
```bash
nix build --print-out-paths '.?submodules=1#libsds'
```
Build for Android:
### Android
```bash
nix build --print-out-paths '.?submodules=1#libsds-android-arm64'
nix build --print-out-paths '.?submodules=1#libsds-android-amd64'
@ -18,14 +32,15 @@ nix build --print-out-paths '.?submodules=1#libsds-android-x86'
nix build --print-out-paths '.?submodules=1#libsds-android-arm'
```
### Development shell
<details>
<summary>Development shell</summary>
Enter the dev shell (sets up vendored dependencies automatically):
```bash
nix develop '.?submodules=1'
```
Then build directly with nim:
Then build directly with Nim:
```bash
# Linux
nim libsdsDynamicLinux sds.nims
@ -42,12 +57,15 @@ nim libsdsStaticWindows sds.nims
Run tests:
```bash
nimble test
nim test sds.nims
```
The built library is output to `build/`.
### Android (without Nix)
</details>
<details>
<summary>Android (without Nix)</summary>
Download the latest Android NDK. For example, on Ubuntu with Intel:
@ -82,3 +100,12 @@ ARCH=arm64 ANDROID_ARCH=aarch64-linux-android ARCH_DIRNAME=aarch64-linux-android
| arm | `arm` | `armv7a-linux-androideabi` | `arm-linux-androideabi` |
The library is output to `build/libsds.so`.
</details>
## Maintenance
```bash
# Clean unreferenced Nix store packages
nix run '.#clean'
```

23
flake.lock generated
View File

@ -1,27 +1,5 @@
{
"nodes": {
"nimbusBuildSystem": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1769685810,
"narHash": "sha256-mANqcQcRXb08ZR8WF6SoyVrL/nXUePtMZfpNx25BlLI=",
"ref": "refs/heads/master",
"rev": "0e7a764edae92b224326b3700f062702489ce2b4",
"revCount": 238,
"submodules": true,
"type": "git",
"url": "file:./vendor/nimbus-build-system"
},
"original": {
"submodules": true,
"type": "git",
"url": "file:./vendor/nimbus-build-system"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1757590060,
@ -40,7 +18,6 @@
},
"root": {
"inputs": {
"nimbusBuildSystem": "nimbusBuildSystem",
"nixpkgs": "nixpkgs"
}
}

View File

@ -7,19 +7,12 @@
};
inputs = {
# We are pinning the commit because ultimately we want to use same commit across different projects.
# A commit from nixpkgs 24.11 release : https://github.com/NixOS/nixpkgs/tree/release-24.11
# Pinned commit from nixpkgs 24.11 release (provides Nim 2.2.4).
# https://github.com/NixOS/nixpkgs/tree/release-24.11
nixpkgs.url = "github:NixOS/nixpkgs?rev=0ef228213045d2cdb5a169a95d63ded38670b293";
# Used only for its pinned Nim compiler package.
# The build system itself (Makefiles, env.sh) is NOT used — we call nimble directly.
# WARNING: Remember to update commit and use 'nix flake update' to update flake.lock.
nimbusBuildSystem = {
url = "git+file:./vendor/nimbus-build-system?submodules=1";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, nimbusBuildSystem }:
outputs = { self, nixpkgs }:
let
stableSystems = [
"x86_64-linux" "aarch64-linux"
@ -49,10 +42,9 @@
in rec {
packages = forAllSystems (system: let
pkgs = pkgsFor.${system};
nim = nimbusBuildSystem.packages.${system}.nim;
buildTargets = pkgs.callPackage ./nix/default.nix {
inherit stableSystems nim;
inherit stableSystems;
src = self;
};
@ -76,8 +68,18 @@
}) targets));
devShells = forAllSystems (system: {
default = pkgsFor.${system}.callPackage ./nix/shell.nix {
inherit (nimbusBuildSystem.packages.${system}) nim;
default = pkgsFor.${system}.callPackage ./nix/shell.nix {};
});
# nix run '.#clean' — garbage-collect the Nix store
apps = forAllSystems (system: {
clean = {
type = "app";
program = toString (pkgsFor.${system}.writeShellScript "nix-clean" ''
echo "Removing old Nix generations and unreferenced packages..."
nix-collect-garbage -d
echo "Done."
'');
};
});
};

@ -1 +0,0 @@
Subproject commit 0e7a764edae92b224326b3700f062702489ce2b4