From f8d693547ce615cfd9189ba7d00053204e6b16bb Mon Sep 17 00:00:00 2001 From: electria Date: Mon, 9 Nov 2026 17:01:34 -0800 Subject: [PATCH 1/4] build(flake): update all --- flake.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/flake.lock b/flake.lock index 70c7363..1481218 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1790899423, - "narHash": "sha256-THGtz65UGJU+sonZidRboyCMk+9DclpMF7pwL4uDV4M=", + "lastModified": 1793836618, + "narHash": "sha256-TREenflwEjxOSq292FYwbc3kEm7TDRtXCZRNWEdjBmg=", "owner": "ipetkov", "repo": "crane", - "rev": "47b6b27ed9a3a9181415e4367d0c30ab2a0e0250", + "rev": "79fd63528501446749c09f08cad486a58c7d173e", "type": "github" }, "original": { @@ -20,11 +20,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "lastModified": 1791914995, + "narHash": "sha256-Zf/xfQEAasnwnmEfHqW/4hjDE/s44yn2hD4RuVIZRjA=", "owner": "numtide", "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "rev": "b7a79d3fea1e214f6d668d521cecec0c01e26544", "type": "github" }, "original": { @@ -35,11 +35,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1791260994, - "narHash": "sha256-MFBjw66d4h06MvpW6lIl7RwarLteD0sk859CncGwb1Q=", - "rev": "151fa4e8ddfdd8dd25d945ad94ed54a13de9f6e4", + "lastModified": 1794042290, + "narHash": "sha256-VZ8WvA9m3XN36juXyg/GwbDRU2OezOHJlXpJCXkccv0=", + "rev": "f4a03c008967841f2a0b3cb7c436fc6fc31671f6", "type": "tarball", - "url": "https://releases.nixos.org/nixos/unstable/nixos-26.11pre1086391.151fa4e8ddfd/nixexprs.tar.zst?lastModified=1791260994&rev=151fa4e8ddfdd8dd25d945ad94ed54a13de9f6e4" + "url": "https://releases.nixos.org/nixos/unstable/nixos-26.11pre1113206.f4a03c008967/nixexprs.tar.zst?lastModified=1794042290&rev=f4a03c008967841f2a0b3cb7c436fc6fc31671f6" }, "original": { "type": "tarball", From 0634af10f156e6b02ce6f7d15d52cabaa318af0d Mon Sep 17 00:00:00 2001 From: electria Date: Mon, 9 Nov 2026 17:02:01 -0800 Subject: [PATCH 2/4] build: optimize profiles --- Cargo.toml | 21 ++++++++++++++++++++- flake.nix | 5 ++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 58f4091..3cd725f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,5 @@ +cargo-features = ["profile-rustflags"] + [package] name = "itop" description = "top program, made in iced" @@ -13,6 +15,23 @@ sysinfo = "0.39.6" version = "0.14.0" features = [ "canvas", "smol" ] +[profile.debug] +debug = true +strip = "none" +debug-assertions = true +overflow-checks = true + +[profile.dev] +opt-level = 3 +rustflags = ["-Clink-arg=-fuse-ld=mold"] + +debug = false +strip = "debuginfo" +debug-assertions = false +overflow-checks = false + [profile.release] -lto = true +panic = "abort" codegen-units = 1 +lto = true +strip = "symbols" diff --git a/flake.nix b/flake.nix index 1c9efff..e17d2c2 100644 --- a/flake.nix +++ b/flake.nix @@ -104,7 +104,10 @@ LD_LIBRARY_PATH = lib.makeLibraryPath dlDeps; inputsFrom = [ crate ]; - packages = [ pkgs.rust-analyzer ]; + packages = with pkgs; [ + rust-analyzer + mold + ]; }; } ); From 6d8cff280e447c675ad75bc271228e6e0e79d207 Mon Sep 17 00:00:00 2001 From: electria Date: Mon, 9 Nov 2026 17:06:26 -0800 Subject: [PATCH 3/4] refactor: format Cargo.toml --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 3cd725f..91bd982 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ sysinfo = "0.39.6" [dependencies.iced] version = "0.14.0" -features = [ "canvas", "smol" ] +features = ["canvas", "smol"] [profile.debug] debug = true From 1b814f968862804d13da999a3c8beef80164129c Mon Sep 17 00:00:00 2001 From: electria Date: Mon, 9 Nov 2026 17:10:59 -0800 Subject: [PATCH 4/4] fix: fill screen horizontally before, the line graph would always be one step behind (left) --- src/app/graph.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/graph.rs b/src/app/graph.rs index 8a3796a..79a96b7 100644 --- a/src/app/graph.rs +++ b/src/app/graph.rs @@ -35,7 +35,7 @@ impl canvas::Program for Graph { frame.stroke( &canvas::Path::new(|builder| { for (index, value) in self.timeline.iter().enumerate() { - let x = index as f32 / self.timeline.len() as f32 * bounds.width; + let x = index as f32 / (self.timeline.len() - 1) as f32 * bounds.width; let y = bounds.height - value / 100. * bounds.height; builder.line_to(Point::new(x, y)) }