Nix pkg on Clear Linux

Hello, I’m trying to use nix pkg on clear linux (because current count of packages on clear is not enough so I’ve found another option). Everything works fine except 2 things that do not allow me use nix pkg freely:

  1. When I try to install some apps (vivaldi, googe-chrome, vscode, nerdfonts, etc.) I receive the message “error: while setting up the build environment: getting attributes of path ‘/etc/hosts’: No such file or directory”
  2. Apps do not see my local fonts

Anyone knows how to solve those ones? Thank you.

1 Like

I found that clear stores /etc/hosts, /etc/services and nsswitch.conf under /usr/share/defaults/etc/
For now I’ve created symlinks to the files, so installation process works fine. May be there is another way to solve the issue through .config/nixpkgs/config.nix ??

Still can’t find any solution for fonts. Also have some problems with kde themes under gnome …

I’m not really an expert on this, but… are you starting X11 from Nix packages? If your are starting it from Clear Linux packages probably you should look in its documentation for a solution

Hi @Nimdis ! Sorry this is an old thread. I stumbled across this post and thought I’d share some bits I’m aware of, with regard to your second post about fonts issues.

I’m also using Clear Linux, and found that the stateless system config setup deviates just enough from freedesktop norms to cause trouble sometimes, particularly with /etc coming out of the box with very little.

Thankfully I’ve had similar luck either just symlinking to the configs in /usr/share/defaults/etc/, or you can maintain your own copies in /etc and Clear Linux (and most applications) will respect the configs in /etc.

More specifically for the font issue, I copied /usr/share/defaults/fonts/fonts.conf to /etc/fonts/fonts.conf and have kept my changes in the new file in /etc and point my backup automation to roll up all of /etc.

Of course, if you don’t care to ever change fonts.conf, a symlink at /etc/fonts/fonts.conf pointing to /usr/share/defaults/fonts/fonts.conf should help.

As for KDE themes… I have no idea! Good luck there. :slight_smile:

P.S. if you’re looking for a certain config file on Clear and don’t know where it is, the mlocate tool is really handy! Just do sudo updatedb if you haven’t done that before, and then locate string and it searches an indexed database of your filesystems for that substring. Visit your local man pages for more information.


sudo mkdir -p /etc/fonts
sudo ln -s /usr/share/fonts/fonts.conf /etc/fonts/fonts.conf