Dfetch on NixOS
July 6, 2026 ยท View on GitHub
This repository provides a Nix flake for building, running, and installing Dfetch on NixOS and other Linux systems with Nix.
Use the Flake
Add Dfetch to your flake inputs:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
dfetch.url = "github:David17c/Dfetch";
};
}
Install the package in your NixOS configuration:
{ inputs, pkgs, ... }:
{
environment.systemPackages = [
inputs.dfetch.packages.${pkgs.stdenv.hostPlatform.system}.default
];
}
Then rebuild:
sudo nixos-rebuild switch --flake /path/to/your/flake#your-hostname
Use the NixOS Module
The flake also exposes a small NixOS module that installs Dfetch through programs.dfetch.
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
dfetch.url = "github:David17c/Dfetch";
};
outputs = { self, nixpkgs, dfetch, ... }: {
nixosConfigurations.your-hostname = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
dfetch.nixosModules.default
{
programs.dfetch.enable = true;
}
];
};
};
}
Run Without Installing
You can run Dfetch directly from the flake:
nix run github:David17c/Dfetch
Development Shell
Enter a shell with Go and Git available:
nix develop github:David17c/Dfetch
Package Counting on Nix
When the packages module is enabled in Dfetch's config, Nix package counting checks the standard system and user profile paths and combines their results. Dfetch queries each profile's Nix requisites and filters them with the same package-oriented rules used by Fastfetch, so it is not limited to executable links in bin.
/run/current-systemfor the active NixOS system profile~/.nix-profilefor the user's default Nix profile$XDG_STATE_HOME/nix/profileor~/.local/state/nix/profilefor the newer user profile location/etc/profiles/per-user/$USERfor the per-user profile
Missing profile directories are ignored, so Dfetch still works on systems that only have some of these paths.
Dfetch Configuration
Dfetch reads its runtime configuration from:
~/.config/dfetch/dfetch.conf
Include packages in the modules block to show package information:
modules {
userinfo
os
kernel
packages
memory
disk
}
For general configuration and usage, see the main README.