Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Empty infos on NixOS #752

Closed
Litarvan opened this issue Jun 17, 2017 · 10 comments
Closed

Empty infos on NixOS #752

Litarvan opened this issue Jun 17, 2017 · 10 comments
Labels

Comments

@Litarvan
Copy link

Description

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

Neofetch version

Neofetch 3.0.1

Screenshot

Screenshot

Config file

Not touched (just installed neofetch)

Verbose log

https://gist.github.com/Litarvan/f3e8d0c81a3ddd7f5d33f0853c6b064d

@dylanaraps
Copy link
Owner

How did you install Neofetch? It can't find it's default config.

@Litarvan
Copy link
Author

nix-env -iA nixos.neofetch

@dylanaraps
Copy link
Owner

dylanaraps commented Jun 18, 2017

The problem is that Neofetch can't find it's config file or a valid user config file.

  • Does /etc/neofetch/config exist?
  • Does the issue occur with the latest git master?

@konimex
Copy link
Contributor

konimex commented Jun 20, 2017

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 d1fa88b.

@dylanaraps
Copy link
Owner

Update to the latest release and the issue should resolve itself.

@dawidd6
Copy link
Contributor

dawidd6 commented Jun 21, 2017

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.

@dylanaraps dylanaraps reopened this Jun 21, 2017
@Litarvan
Copy link
Author

/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

@dawidd6
Copy link
Contributor

dawidd6 commented Jun 23, 2017

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.

@dylanaraps
Copy link
Owner

I see what the issue is now, my bad.

This will be fixed by #754 which removes the hard-coded paths from inside Neofetch.

@dylanaraps dylanaraps added the Bug label Jun 26, 2017
@konimex
Copy link
Contributor

konimex commented Jul 1, 2017

Closing this since #754 is merged.Superseded by #765

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants