aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Audron <audron@cocaine.farm>2025-02-22 18:39:52 +0100
committerMax Audron <audron@cocaine.farm>2025-02-22 18:39:52 +0100
commit9411cfa7572431801872152d8d964634e1504b89 (patch)
tree124aa797ae433ab8db0d282661eb4a8f63a7b0c8
parentadd todos to readme (diff)
update flake
Diffstat (limited to '')
-rw-r--r--README.md36
-rw-r--r--flake.lock43
-rw-r--r--flake.nix132
3 files changed, 117 insertions, 94 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..60de75d
--- /dev/null
+++ b/README.md
@@ -0,0 +1,36 @@
+Native rust implementation of the Quassel protocol and library functions
+
+# Features
+
+| Feature | Description |
+| -------------------- | ---------------------------------------------------------------------------------------------------------------------- |
+| client | Enable client side trait implementations |
+| server | Enable server side trait implementations |
+| framing | Enable support for tokio\'s [codec::Framed](url:https://docs.rs/tokio-util/latest/tokio_util/codec/struct.Framed.html) |
+| all-quassel-features | enable all protocol features |
+| long-message-id | Serialize message IDs as i64 |
+| long-time | Serialize Message Time as i64 |
+| rich-messages | add avatar url and real name to messages |
+| sender-prefixes | Show prefixes for senders in backlog |
+| authenticators | Support for exchangeable auth backends |
+| bench | Enable the test crate/feature for running benchmarks |
+
+# TODOs
+
+- [TODO] Implementation of Syncable Objects {#implementation-of-syncable-objects}
+ - [DONE] AliasManager
+ - [TODO] BacklogManager
+ - [DONE] BufferSyncer
+ - [DONE] BufferViewConfig
+ - [DONE] BufferViewManager
+ - [DONE] CertManager
+ - [DONE] CoreInfo
+ - [DONE] HighlightRuleManager
+ - [DONE] Identity
+ - [DONE] IgnoreListManager
+ - [DONE] IrcChannel
+ - [TODO] IrcListHelper
+ - [TODO] IrcUser
+ - [TODO] Network
+ - [TODO] NetworkInfo
+ - [TODO] NetworkConfig
diff --git a/flake.lock b/flake.lock
index f883155..02b38af 100644
--- a/flake.lock
+++ b/flake.lock
@@ -3,11 +3,11 @@
"advisory-db": {
"flake": false,
"locked": {
- "lastModified": 1702914599,
- "narHash": "sha256-QYwzxCTyW5cEmBOZuikoBs7pO4H6TkC6oikLxIxuzyk=",
+ "lastModified": 1740173919,
+ "narHash": "sha256-qtoA7HqDHFKZmxr1m0j3pU+GAMZmec0UwVVppwew4q0=",
"owner": "rustsec",
"repo": "advisory-db",
- "rev": "bc17aeb6838cfc331384dc4360a98ca4d56f2320",
+ "rev": "e0532140057bb10fc8283d3b5217e3be6b8a3bc8",
"type": "github"
},
"original": {
@@ -17,17 +17,12 @@
}
},
"crane": {
- "inputs": {
- "nixpkgs": [
- "nixpkgs"
- ]
- },
"locked": {
- "lastModified": 1702918879,
- "narHash": "sha256-tWJqzajIvYcaRWxn+cLUB9L9Pv4dQ3Bfit/YjU5ze3g=",
+ "lastModified": 1739936662,
+ "narHash": "sha256-x4syUjNUuRblR07nDPeLDP7DpphaBVbUaSoeZkFbGSk=",
"owner": "ipetkov",
"repo": "crane",
- "rev": "7195c00c272fdd92fc74e7d5a0a2844b9fadb2fb",
+ "rev": "19de14aaeb869287647d9461cbd389187d8ecdb7",
"type": "github"
},
"original": {
@@ -44,11 +39,11 @@
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
- "lastModified": 1702880623,
- "narHash": "sha256-QAYoNlBVefYLesWYx1IVVg4F62sQKK5SSkW8JIUpUpQ=",
+ "lastModified": 1740119667,
+ "narHash": "sha256-8LsFuU6ORym0DUIqp0Kga95w5T+9UnN3aHaephEakvw=",
"owner": "nix-community",
"repo": "fenix",
- "rev": "e1e80b02d3fe09d78d93095a02ce80b49ecd1810",
+ "rev": "019d950c784141c8f3ba6ad5d8a53f72fee0953f",
"type": "github"
},
"original": {
@@ -62,11 +57,11 @@
"systems": "systems"
},
"locked": {
- "lastModified": 1701680307,
- "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
+ "lastModified": 1731533236,
+ "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
- "rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
+ "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
@@ -77,16 +72,16 @@
},
"nixpkgs": {
"locked": {
- "lastModified": 1702780907,
- "narHash": "sha256-blbrBBXjjZt6OKTcYX1jpe9SRof2P9ZYWPzq22tzXAA=",
+ "lastModified": 1739923778,
+ "narHash": "sha256-BqUY8tz0AQ4to2Z4+uaKczh81zsGZSYxjgvtw+fvIfM=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "1e2e384c5b7c50dbf8e9c441a9e58d85f408b01f",
+ "rev": "36864ed72f234b9540da4cf7a0c49e351d30d3f1",
"type": "github"
},
"original": {
"owner": "NixOS",
- "ref": "nixos-23.11",
+ "ref": "nixos-24.11",
"repo": "nixpkgs",
"type": "github"
}
@@ -103,11 +98,11 @@
"rust-analyzer-src": {
"flake": false,
"locked": {
- "lastModified": 1702654920,
- "narHash": "sha256-Kvym2mv/f4duzYJLL+HBOTHkr8GbqCc3bDtuBN9TSvQ=",
+ "lastModified": 1740077634,
+ "narHash": "sha256-KlYdDhon/hy91NutuBeN8e3qTKf3FXgsudWsjnHud68=",
"owner": "rust-lang",
"repo": "rust-analyzer",
- "rev": "21b06c1beb9bb59369ffd652f5d617bcf6952e05",
+ "rev": "88fbdcd510e79ef3bcd81d6d9d4f07bdce84be8c",
"type": "github"
},
"original": {
diff --git a/flake.nix b/flake.nix
index c0f2edd..94c8ba1 100644
--- a/flake.nix
+++ b/flake.nix
@@ -2,12 +2,9 @@
description = "Build a cargo project";
inputs = {
- nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
+ nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
- crane = {
- url = "github:ipetkov/crane";
- inputs.nixpkgs.follows = "nixpkgs";
- };
+ crane.url = "github:ipetkov/crane";
flake-utils.url = "github:numtide/flake-utils";
@@ -22,14 +19,25 @@
};
};
- outputs = { self, nixpkgs, crane, flake-utils, advisory-db, fenix, ... }:
- flake-utils.lib.eachDefaultSystem (system:
+ outputs =
+ {
+ self,
+ nixpkgs,
+ crane,
+ flake-utils,
+ advisory-db,
+ fenix,
+ ...
+ }:
+ flake-utils.lib.eachDefaultSystem (
+ system:
let
pkgs = import nixpkgs { inherit system; };
inherit (pkgs) lib;
- rustToolchain = with fenix.packages.${system};
+ rustToolchain =
+ with fenix.packages.${system};
combine [
stable.defaultToolchain
(stable.withComponents [ "rust-src" ])
@@ -37,33 +45,15 @@
rust-analyzer
];
- craneLib = crane.lib.${system}.overrideToolchain rustToolchain;
+ craneLib = (crane.mkLib pkgs).overrideToolchain rustToolchain;
+
+ markdownFilter = path: _type: builtins.match ".*md$" path != null;
+ markdownOrCargo = path: type: (markdownFilter path type) || (craneLib.filterCargoSources path type);
src = lib.cleanSourceWith {
- # Apply the default source cleaning from nixpkgs
- src = lib.cleanSource ./.;
-
- # Then add our own filter on top
- filter = orig_path: type:
- let
- path = (toString orig_path);
- base = baseNameOf path;
- parentDir = baseNameOf (dirOf path);
-
- matchesSuffix = lib.any (suffix: lib.hasSuffix suffix base) [
- ".rs"
- ".toml"
- ".md"
- ];
-
- # Cargo.toml already captured above
- isCargoFile = base == "Cargo.lock";
-
- # .cargo/config.toml already captured above
- isCargoConfig = parentDir == ".cargo" && base == "config";
- in
- type == "directory" || matchesSuffix || isCargoFile
- || isCargoConfig;
+ src = ./.;
+ filter = markdownOrCargo;
+ name = "source";
};
# Build *just* the cargo dependencies, so we can reuse
@@ -77,44 +67,45 @@
};
in
{
- checks = {
- # Build the crate as part of `nix flake check` for convenience
- inherit libquassel;
-
- # Run clippy (and deny all warnings) on the crate source,
- # again, resuing the dependency artifacts from above.
- #
- # Note that this is done as a separate derivation so that
- # we can block the CI if there are issues here, but not
- # prevent downstream consumers from building our crate by itself.
- libquassel-clippy = craneLib.cargoClippy {
- inherit cargoArtifacts src;
- cargoClippyExtraArgs = "--all-targets -- --deny warnings";
+ checks =
+ {
+ # Build the crate as part of `nix flake check` for convenience
+ inherit libquassel;
+
+ # Run clippy (and deny all warnings) on the crate source,
+ # again, resuing the dependency artifacts from above.
+ #
+ # Note that this is done as a separate derivation so that
+ # we can block the CI if there are issues here, but not
+ # prevent downstream consumers from building our crate by itself.
+ libquassel-clippy = craneLib.cargoClippy {
+ inherit cargoArtifacts src;
+ cargoClippyExtraArgs = "--all-targets -- --deny warnings";
+ };
+
+ libquassel-doc = craneLib.cargoDoc { inherit cargoArtifacts src; };
+
+ # Check formatting
+ libquassel-fmt = craneLib.cargoFmt { inherit src; };
+
+ # Audit dependencies
+ libquassel-audit = craneLib.cargoAudit { inherit src advisory-db; };
+
+ # Run tests with cargo-nextest
+ # Consider setting `doCheck = false` on `libquassel` if you do not want
+ # the tests to run twice
+ libquassel-nextest = craneLib.cargoNextest {
+ inherit cargoArtifacts src;
+ partitions = 1;
+ partitionType = "count";
+ };
+ }
+ // lib.optionalAttrs (system == "x86_64-linux") {
+ # NB: cargo-tarpaulin only supports x86_64 systems
+ # Check code coverage (note: this will not upload coverage anywhere)
+ libquassel-coverage = craneLib.cargoTarpaulin { inherit cargoArtifacts src; };
};
- libquassel-doc = craneLib.cargoDoc { inherit cargoArtifacts src; };
-
- # Check formatting
- libquassel-fmt = craneLib.cargoFmt { inherit src; };
-
- # Audit dependencies
- libquassel-audit = craneLib.cargoAudit { inherit src advisory-db; };
-
- # Run tests with cargo-nextest
- # Consider setting `doCheck = false` on `libquassel` if you do not want
- # the tests to run twice
- libquassel-nextest = craneLib.cargoNextest {
- inherit cargoArtifacts src;
- partitions = 1;
- partitionType = "count";
- };
- } // lib.optionalAttrs (system == "x86_64-linux") {
- # NB: cargo-tarpaulin only supports x86_64 systems
- # Check code coverage (note: this will not upload coverage anywhere)
- libquassel-coverage =
- craneLib.cargoTarpaulin { inherit cargoArtifacts src; };
- };
-
packages.default = libquassel;
# apps.default = flake-utils.lib.mkApp {
@@ -136,5 +127,6 @@
gtk3
];
};
- });
+ }
+ );
}