Installing libfetch on NixOS using Flakes
libfetch is a GNU/Linux port of the FreeBSD userland utility similar to Wget. I created it because I really didn’t like how heavy Wget is, and I didn’t have the knowledge to write it from scratch so I decided to port it. It’s pretty lightweight compared to Wget. But let’s dive into installing it on NixOS if you’re interested in doing it.
Adding the input
First, add the libfetch input to your flake.nix.
{
inputs = {
libfetch = {
url = "git+https://gitea.foss-daily.org/kayoubi13/libfetch";
inputs.nixpkgs.follows = "nixpkgs"; # this line is optional, prevents downloading two versions of nixpkgs but disables cache
};
};
}
Alternatively you can use the GitHub mirror if you prefer being tracked by Microsoft and give up your User Rights.
{
inputs = {
libfetch = {
url = "github:foss-daily/libfetch";
inputs.nixpkgs.follows = "nixpkgs";
};
};
}
For flakes instructions, we assume you are passing in
libfetchthroughspecialArgsor equivalent. Like this:
specialArgs = { inherit libfetch; }
Installing the Package
Add the package to your system packages or equivalent:
{ libfetch, pkgs, ... }:
{
environment.systemPackages = [
libfetch.packages.${pkgs.stdenv.hostPlatform.system}.default
];
}
After setting everything up
You can verify that everything is working by running:
fetch -o /dev/null https://proof.ovh.net/files/1Gb.dat
If everything went right, you should be ready to go! Have fun downloading whatever you need to! :D