Compare commits

...

2 Commits

3 changed files with 83 additions and 27 deletions

View File

@ -19,7 +19,7 @@ be used with my [[https://elkowar.github.io/eww/][eww]] configuration.
- Nix package manager with flakes (optional, for building and managing - Nix package manager with flakes (optional, for building and managing
dependencies) dependencies)
* Installation * Build and Run =pumo-system-info=
1. Clone the repository 1. Clone the repository
#+begin_src sh #+begin_src sh
@ -41,6 +41,30 @@ cargo build --release
./target/release/pumo-system-info ./target/release/pumo-system-info
#+end_src #+end_src
* Installation
** With Cargo
You can install =pumo-system-info= using the following command:
#+begin_src sh
cargo install --path .
#+end_src
** Flake Input
You can add this repository in your flake inputs like so:
#+begin_src nix
inputs.pumo-system-info.url = "git+https://labs.phundrak.com/phundrak/pumo-system-info";
#+end_src
You can also make it follow your =nixpkgs= version with this:
#+begin_src nix
pumo-system-info = {
url = "git+https://labs.phundrak.com/phundrak/pumo-system-info";
inputs.nixpkgs.follows = "nixpkgs";
};
#+end_src
You can now install =inputs.pumo-system-info.packages.${system}.default=
as a package. =${system}= can be either =x86_64-linux= or =aarch64-linux=.
* Performance * Performance
Since this is a utility for bringing information to eww, this project Since this is a utility for bringing information to eww, this project
needs to run fast. Fortunately, it does! Here are some benchmarks I needs to run fast. Fortunately, it does! Here are some benchmarks I

46
flake.lock generated
View File

@ -1,12 +1,30 @@
{ {
"nodes": { "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": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1747744144, "lastModified": 1748693115,
"narHash": "sha256-W7lqHp0qZiENCDwUZ5EX/lNhxjMdNapFnbErcbnP11Q=", "narHash": "sha256-StSrWhklmDuXT93yc3GrTlb0cKSS0agTAxMGjLKAsY8=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "2795c506fe8fb7b03c36ccb51f75b6df0ab2553f", "rev": "910796cabe436259a29a72e8d3f5e180fc6dfacc",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -18,6 +36,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay"
} }
@ -29,11 +48,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1748054080, "lastModified": 1748918260,
"narHash": "sha256-rwFiLLNCwkj9bqePtH1sMqzs1xmohE0Ojq249piMzF4=", "narHash": "sha256-KhXNXQ5IDLvwwYfJ0pXDjwIuisZ2qM6F7fcXjIGZy/4=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "2221d8d53c128beb69346fa3ab36da3f19bb1691", "rev": "c9736155bc1eb7c7cf3a925920850e61c07ab22a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -41,6 +60,21 @@
"repo": "rust-overlay", "repo": "rust-overlay",
"type": "github" "type": "github"
} }
},
"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", "root": "root",

View File

@ -2,37 +2,35 @@
description = "System information in JSON format for eww"; description = "System information in JSON format for eww";
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = { rust-overlay = {
url = "github:oxalica/rust-overlay"; url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
}; };
outputs = { outputs = {
nixpkgs, nixpkgs,
rust-overlay, rust-overlay,
flake-utils,
... ...
}: let }:
supportedSystems = ["x86_64-linux" "aarch64-linux"]; flake-utils.lib.eachSystem ["x86_64-linux" "aarch64-linux"] (
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
pkgsFor = nixpkgs.legacyPackages;
in {
packages = forAllSystems (system: {
default = pkgsFor.${system}.callPackage ./. {};
});
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
devShells = forAllSystems (
system: let system: let
overlays = [(import rust-overlay)]; overlays = [(import rust-overlay)];
pkgs = import nixpkgs {inherit system overlays;}; pkgs = import nixpkgs { inherit system overlays; };
rustVersion = pkgs.rust-bin.fromRustupToolchainFile ./rustup-toolchain.toml; rustVersion = pkgs.rust-bin.fromRustupToolchainFile ./rustup-toolchain.toml;
in pkgsFor = nixpkgs.legacyPackages;
pkgs.mkShell { in {
buildInputs = with pkgs; [ formatter = pkgs.alejandra;
packages.default = pkgsFor.${system}.callPackage ./. {};
devShells.default = with pkgs;
mkShell {
buildInputs = [
bacon bacon
cargo
rustVersion rustVersion
]; ];
};
} }
); );
};
} }