Compare commits

..

No commits in common. "bb4c4b6375f7863cb6f9469b4ca3274b2b83a42d" and "06fa652f9626590a9727f3ec8b48330ad3fcb78f" have entirely different histories.

3 changed files with 27 additions and 83 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
dependencies)
* Build and Run =pumo-system-info=
* Installation
1. Clone the repository
#+begin_src sh
@ -41,30 +41,6 @@ cargo build --release
./target/release/pumo-system-info
#+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
Since this is a utility for bringing information to eww, this project
needs to run fast. Fortunately, it does! Here are some benchmarks I

46
flake.lock generated
View File

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

View File

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