diff --git a/.github/assets/demo.png b/.github/assets/demo.png deleted file mode 100644 index 137b845..0000000 Binary files a/.github/assets/demo.png and /dev/null differ diff --git a/Cargo.toml b/Cargo.toml index 0b62847..109f89b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,13 @@ [package] -name = "microfetch" -version = "0.4.13" -edition = "2024" +name = "microfetch" +description = "Microscopic fetch tool in Rust, for NixOS systems, with special emphasis on speed" +version = "0.4.13" +edition = "2024" +authors = [ "NotAShelf " ] +rust-version = "1.90" +readme = "./docs/README.md" +repository = "https://github.com/notashelf/microfetch" +license = "GPL-3.0" [lib] name = "microfetch_lib" diff --git a/README.md b/docs/README.md similarity index 79% rename from README.md rename to docs/README.md index 8f59640..2e8830b 100644 --- a/README.md +++ b/docs/README.md @@ -10,7 +10,7 @@

Microscopic fetch tool in Rust, for NixOS systems, with special emphasis on speed


Synopsis
- Features | Motivation
| Benchmarks
+ Features | Motivation | Benchmarks
Installation
@@ -27,11 +27,13 @@ communities. Aims to replace [fastfetch] on my personal system, but on your system: it is pretty _[fast](#benchmarks)_...

+
latest demo +

## Features @@ -55,10 +57,14 @@ on your system: it is pretty _[fast](#benchmarks)_... - Shell Colors - Did I mention fast? - Respects [`NO_COLOR` spec](https://no-color.org/) +- Funny [^2] [^1]: With the Mold linker, which is enabled by default in the Flake package, the binary size is roughly 350kb. That's nearly 20kb reduction in size :) +[^2]: I don't know how else to describe the (unhealthy) amount of handwritten + assembly that was written in order to make Microfetch faster. + ## Motivation [Rube-Goldmark Machine]: https://en.wikipedia.org/wiki/Rube_Goldberg_machine @@ -87,14 +93,15 @@ solve a technical problem. The "problem" Microfetch solves is entirely self-imposed. On the matter of _size_, the project is written in Rust, which comes at the cost of "bloated" dependency trees and the increased build times, but we make an extended effort to keep the dependencies minimal and build times -managable. The latter is also very easily mitigated with Nix's binary cache +manageable. The latter is also very easily mitigated with Nix's binary cache systems. Since Microfetch is already in Nixpkgs, you are recommended to use it to utilize the binary cache properly. The usage of Rust _is_ nice, however, since it provides us with incredible tooling and a very powerful language that allows for Microfetch to be as fast as possible. ~~Sure C could've been used here as well, but do you think I hate myself?~~ Microfetch now features handwritten assembly to unsafely optimize some areas. In hindsight you all -should have seen this coming. Is it faster? Yes. +should have seen this coming. Is it faster? Yes. Should you use this? If you +want to. Also see: [Rube-Goldmark Machine] @@ -128,9 +135,19 @@ up to date, but I will try to update the numbers as I make Microfetch faster. The point stands that Microfetch is significantly faster than every other fetch tool I have tried. This is to be expected, of course, since Microfetch is -designed _explicitly_ for speed and makes some tradeoffs to achieve it's +designed _explicitly_ for speed and makes some tradeoffs to achieve its signature speed. +> [!IMPORTANT] +> Some tools are excluded. Yes, I know. If you think they are important and thus +> should be covered in the benchmarks, feel free to create an issue. The purpose +> of this benchmarks section is not to badmouth other projects, but to +> demonstrate how much faster Microfetch is in comparison. Obviously Microfetch +> is designed to be small (in the sense of scope) and fast (in every definition +> of the word) so I speak of Microfetch's speed as a fact rather than an +> advantage. Reddit has a surprising ability to twist words and misunderstand +> ideals. + ### Benchmarking Individual Functions [Criterion.rs]: https://github.com/bheisler/criterion.rs @@ -169,46 +186,62 @@ performance regressions. ## Installation > [!NOTE] -> You will need a Nerdfonts patched font installed, and for your terminal -> emulator to support said font. Microfetch uses nerdfonts glyphs by default, +> You will need a Nerd Fonts patched font installed, and for your terminal +> emulator to support said font. Microfetch uses Nerd Fonts glyphs by default, > but this can be changed by [patching the program](#customizing). Microfetch is packaged in [nixpkgs](https://github.com/nixos/nixpkgs). It can be installed by adding `pkgs.microfetch` to your `environment.systemPackages`. -Additionally, you can try out Microfetch in a Nix shell. +Additionally, you can try out Microfetch in a Nix shell or install it using +flakes on non-NixOS systems. ```bash +# Enter a Nix shell with Microfetch; this will be lost on the next GC nix shell nixpkgs#microfetch + +# Install Microfetch globally; this will be kept on GC +nix profile add nixpkgs#microfetch ``` Or run it directly with `nix run` ```bash +# Run Microfetch from Nixpkgs. Subsequent runs will be faster. nix run nixpkgs#microfetch ``` -Non-Nix users will have to build Microfetch with `cargo`. It is not published -anywhere but I imagine you can use `cargo install --git` to install it from -source. +[crates.io]: https://crates.io/crates/microfetch + +Non-Nix users, if they plan to run this for some reason, will need to build +Microfetch from source or install it with `cargo`. Microfetch is published on +[crates.io] and can be installed with `cargo install`. ```bash -cargo install --git https://github.com/notashelf/microfetch.git +# Get Microfetch from crates.io +cargo install microfetch ``` -Microfetch is _currently_ not available anywhere else. Though, does it _really_ -have to be? +### Other Distros + + + +To my knowledge, there is no package for (nor a reason to package) Microfetch +but if you run a patched version for your distribution, feel free to leave your +repository (AUR, COPR, etc.) here as reference for those that might be +interested in Microfetch tailored to their distributions. ## Customizing -You can't. +You can't*. ### Why? -Customization, of most kinds, are expensive: I could try reading environment +Customization, of most kinds, is "expensive": I could try reading environment variables, parse command-line arguments or read a configuration file to allow configuring various fields but those inflate execution time and the resource consumption by a lot. Since Microfetch is closer to a code golf challenge than a -program that attempts to fill a gap, I have elected not to make this trade. +program that attempts to fill a gap, I have elected not to make this trade. This +is, of course, not without a solution. ### Really? @@ -217,13 +250,13 @@ program that attempts to fill a gap, I have elected not to make this trade. To be fair, you _can_ customize Microfetch by, well, patching it. It is certainly not the easiest way of doing so but if you are planning to change -something in Microfetch, patching is the best way to go. It will also the only -way that does not compromise on speed, unless you patch in bad code. Various -users have adapted Microfetch to their distribution by patching the -[main module] and inserting the logo of their choice. This is also the best way -to go if you plan to make small changes. If your changes are not small, you -might want to look for a program that is designed to be customizable; Microfetch -is built for maximum performance. +something in Microfetch, patching is the best way to go. It will also be the +only way that does not compromise on speed, unless you patch in bad code. +Various users have adapted Microfetch to their distribution of choice by +patching the [main module] and inserting the logo of their choice. This is also +the best way to go if you plan to make small changes. If your changes are not +small, you might want to look for a program that is designed to be customizable; +Microfetch is built for maximum performance and little else. The Nix package allows passing patches in a streamlined manner by passing `.overrideAttrs` to the derivation. You can apply your patches in `patches` and diff --git a/docs/assets/demo.png b/docs/assets/demo.png new file mode 100644 index 0000000..744f25d Binary files /dev/null and b/docs/assets/demo.png differ