diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-11-29 18:48:07 +0100 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-11-29 18:48:07 +0100 |
commit | cbd9aec4bf2e488156f5dc101271d572af0cd2ca (patch) | |
tree | 57c7b6397084c1c386aab1a25f1fa93e84480338 /pkgs/by-name/ya/yambar-cpu | |
parent | fix(modules/lf/cmds/set_clipboard_path): Provide feedback to the user (diff) | |
download | nixos-config-cbd9aec4bf2e488156f5dc101271d572af0cd2ca.zip |
chore(pkgs/by-name/ya/{cpu,memory}): Merge
There is no reason to keep these two programs separate.
Diffstat (limited to '')
-rw-r--r-- | pkgs/by-name/ya/yambar-cpu/flake.lock | 61 | ||||
-rwxr-xr-x | pkgs/by-name/ya/yambar-cpu/update.sh | 6 | ||||
-rw-r--r-- | pkgs/by-name/ya/yambar-modules/.envrc (renamed from pkgs/by-name/ya/yambar-cpu/.envrc) | 0 | ||||
-rw-r--r-- | pkgs/by-name/ya/yambar-modules/.gitignore (renamed from pkgs/by-name/ya/yambar-cpu/.gitignore) | 0 | ||||
-rw-r--r-- | pkgs/by-name/ya/yambar-modules/Cargo.lock (renamed from pkgs/by-name/ya/yambar-cpu/Cargo.lock) | 18 | ||||
-rw-r--r-- | pkgs/by-name/ya/yambar-modules/Cargo.toml (renamed from pkgs/by-name/ya/yambar-cpu/Cargo.toml) | 2 | ||||
-rw-r--r-- | pkgs/by-name/ya/yambar-modules/flake.nix (renamed from pkgs/by-name/ya/yambar-cpu/flake.nix) | 2 | ||||
-rw-r--r-- | pkgs/by-name/ya/yambar-modules/package.nix (renamed from pkgs/by-name/ya/yambar-cpu/package.nix) | 4 | ||||
-rw-r--r-- | pkgs/by-name/ya/yambar-modules/src/cpu.rs (renamed from pkgs/by-name/ya/yambar-cpu/src/main.rs) | 3 |
9 files changed, 14 insertions, 82 deletions
diff --git a/pkgs/by-name/ya/yambar-cpu/flake.lock b/pkgs/by-name/ya/yambar-cpu/flake.lock deleted file mode 100644 index aaddd6a5..00000000 --- a/pkgs/by-name/ya/yambar-cpu/flake.lock +++ /dev/null @@ -1,61 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1731890469, - "narHash": "sha256-D1FNZ70NmQEwNxpSSdTXCSklBH1z2isPR84J6DQrJGs=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "5083ec887760adfe12af64830a66807423a859a7", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/pkgs/by-name/ya/yambar-cpu/update.sh b/pkgs/by-name/ya/yambar-cpu/update.sh deleted file mode 100755 index b9404867..00000000 --- a/pkgs/by-name/ya/yambar-cpu/update.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env sh - -[ "$1" = "upgrade" ] && cargo upgrade -cargo update - -# vim: ft=sh diff --git a/pkgs/by-name/ya/yambar-cpu/.envrc b/pkgs/by-name/ya/yambar-modules/.envrc index 2f9f1a81..2f9f1a81 100644 --- a/pkgs/by-name/ya/yambar-cpu/.envrc +++ b/pkgs/by-name/ya/yambar-modules/.envrc diff --git a/pkgs/by-name/ya/yambar-cpu/.gitignore b/pkgs/by-name/ya/yambar-modules/.gitignore index ea8c4bf7..ea8c4bf7 100644 --- a/pkgs/by-name/ya/yambar-cpu/.gitignore +++ b/pkgs/by-name/ya/yambar-modules/.gitignore diff --git a/pkgs/by-name/ya/yambar-cpu/Cargo.lock b/pkgs/by-name/ya/yambar-modules/Cargo.lock index 43d40482..6b689d29 100644 --- a/pkgs/by-name/ya/yambar-cpu/Cargo.lock +++ b/pkgs/by-name/ya/yambar-modules/Cargo.lock @@ -15,13 +15,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] -name = "cpu_usage" -version = "0.1.0" -dependencies = [ - "sysinfo", -] - -[[package]] name = "crossbeam-deque" version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -54,9 +47,9 @@ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "libc" -version = "0.2.164" +version = "0.2.167" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f" +checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" [[package]] name = "ntapi" @@ -129,3 +122,10 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "yambar-modules" +version = "0.1.0" +dependencies = [ + "sysinfo", +] diff --git a/pkgs/by-name/ya/yambar-cpu/Cargo.toml b/pkgs/by-name/ya/yambar-modules/Cargo.toml index 6d66301a..8e3995fe 100644 --- a/pkgs/by-name/ya/yambar-cpu/Cargo.toml +++ b/pkgs/by-name/ya/yambar-modules/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "cpu_usage" +name = "yambar-modules" version = "0.1.0" edition = "2021" diff --git a/pkgs/by-name/ya/yambar-cpu/flake.nix b/pkgs/by-name/ya/yambar-modules/flake.nix index 3a27bccf..e3d0cd49 100644 --- a/pkgs/by-name/ya/yambar-cpu/flake.nix +++ b/pkgs/by-name/ya/yambar-modules/flake.nix @@ -1,5 +1,5 @@ { - description = "A smart way to check your cpu usage"; + description = "Extension modules for yambar(1)"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; diff --git a/pkgs/by-name/ya/yambar-cpu/package.nix b/pkgs/by-name/ya/yambar-modules/package.nix index 90f1a558..79281429 100644 --- a/pkgs/by-name/ya/yambar-cpu/package.nix +++ b/pkgs/by-name/ya/yambar-modules/package.nix @@ -1,6 +1,6 @@ {rustPlatform}: rustPlatform.buildRustPackage { - pname = "yambar-cpu"; + pname = "yambar-modules"; version = "0.1.0"; src = ./.; @@ -9,6 +9,6 @@ rustPlatform.buildRustPackage { }; meta = { - mainProgram = "cpu_usage"; + mainProgram = "yambar-modules"; }; } diff --git a/pkgs/by-name/ya/yambar-cpu/src/main.rs b/pkgs/by-name/ya/yambar-modules/src/cpu.rs index 9314b81e..5a6dd084 100644 --- a/pkgs/by-name/ya/yambar-cpu/src/main.rs +++ b/pkgs/by-name/ya/yambar-modules/src/cpu.rs @@ -2,10 +2,9 @@ use std::{thread, time::Duration}; use sysinfo::{CpuExt, System, SystemExt}; -fn main() { +pub fn cpu() { let mut sys = System::new(); - // Number of CPUs: loop { sys.refresh_cpu(); let cpu_usage: f32 = sys.cpus().iter().map(|cpu| cpu.cpu_usage()).sum(); |