On my NixOS, running Neofetch displays the ASCII Art without any infos on the side
Neofetch 3.0.1

Not touched (just installed neofetch)
https://gist.github.com/Litarvan/f3e8d0c81a3ddd7f5d33f0853c6b064d
How did you install Neofetch? It can't find it's default config.
nix-env -iA nixos.neofetch
The problem is that Neofetch can't find it's config file or a valid user config file.
/etc/neofetch/config exist?Your config file is either in /etc/neofetch/config or /usr/share/neofetch/config, you can copy it to your $HOME/.config/neofetch directory.
This was a known issue and has been fixed in https://github.com/dylanaraps/neofetch/commit/d1fa88b7423cf8b9e4bc7445b9b6e37738b83869.
Update to the latest release and the issue should resolve itself.
Adding this in get_default_config is working
elif [[ -f "$HOME/.nix-profile/etc/neofetch/config" ]]; then
default_config="$HOME/.nix-profile/etc/neofetch/config"
Also in release 3.2.0 it is not fixed when built from default.nix in nixpkgs.
/etc/neofetch/config does not exist
There is no /usr on NixOS
And my ~/.config/neofetch folder is empty
And, i can't apply the fix of dawidd since the neofetch binary is read-only on NixOS
Yes. One way is: you can fork neofetch and edit, then build nix package using official recipe from github after editing details leading to your fork and specific branch
https://github.com/NixOS/nixpkgs/blob/df8195b6038136cfd08865be22e3e3c394990031/pkgs/tools/misc/neofetch/default.nix
or just copy neofetch somewhere else where you have write permission (/home for example), edit and run this copy.
EDIT: i've managed to do it, here is modified nix recipe (save it as neofetch.nix, then build and install with nix-build neofetch.nix)
with import <nixpkgs> {};
stdenv.mkDerivation rec {
name = "neofetch-${version}";
version = "nixos";
src = fetchFromGitHub {
owner = "dawidd6";
repo = "neofetch";
rev = version;
sha256 = "0rjh6fs9fs6jk4fjlwh5zg1i8fd80xjf5mmk4licvsdjbjaqdnhr";
};
patchPhase = ''
substituteInPlace ./neofetch \
--replace "/usr/share" "$out/share"
'';
dontBuild = true;
makeFlags = [
"DESTDIR=$(out)"
"PREFIX="
];
meta = with stdenv.lib; {
description = "A fast, highly customizable system info script";
homepage = https://github.com/dylanaraps/neofetch;
license = licenses.mit;
platforms = platforms.all;
maintainers = with maintainers; [ alibabzo ];
};
}
It's fetching from my fork, you can see there a commit with fix described above. Well, i wanted to share, a package, but it seems like with nix package manager it is impossible to build one-file-package like deb or rpm, idk.
EDIT2: I've checked it a little and it's working only if one have installed neofetch from official repo and one must start it with full path, because default is official. I also dunno why i'm getting this message trying to build neofetch with vanilla official recipe: error: cannot auto-call a function that has an argument without a default value (‘stdenv’). It's building when i delete the first line containing fetchFromGithub. However this fix would be true for official neofetch, because when one install it, the directory with config is being created in .nix-profile. So, i apologize, but i can't do anything more with nixos. I just don't get this package manger's idea.
I see what the issue is now, my bad.
This will be fixed by https://github.com/dylanaraps/neofetch/pull/754 which removes the hard-coded paths from inside Neofetch.
Closing this since #754 is merged.Superseded by #765
Most helpful comment
Yes. One way is: you can fork neofetch and edit, then build nix package using official recipe from github after editing details leading to your fork and specific branch
https://github.com/NixOS/nixpkgs/blob/df8195b6038136cfd08865be22e3e3c394990031/pkgs/tools/misc/neofetch/default.nix
or just copy neofetch somewhere else where you have write permission (/home for example), edit and run this copy.
EDIT: i've managed to do it, here is modified nix recipe (save it as
neofetch.nix, then build and install withnix-build neofetch.nix)It's fetching from my fork, you can see there a commit with fix described above. Well, i wanted to share, a package, but it seems like with nix package manager it is impossible to build one-file-package like deb or rpm, idk.
EDIT2: I've checked it a little and it's working only if one have installed neofetch from official repo and one must start it with full path, because default is official. I also dunno why i'm getting this message trying to build neofetch with vanilla official recipe:
error: cannot auto-call a function that has an argument without a default value (‘stdenv’). It's building when i delete the first line containing fetchFromGithub. However this fix would be true for official neofetch, because when one install it, the directory with config is being created in .nix-profile. So, i apologize, but i can't do anything more with nixos. I just don't get this package manger's idea.