Finding earlier configuration files (to resolve a slack issue)

Hi All,

slack has stopped working for me in the last 3 days (it just displays a blank window, which flickers when the mouse is moved over it, menus seems to work OK), however I’ve made multiple changes during that time, without testing slack, so aren’t sure exactly when it broke.

I’ve booted back in to the build where it last worked, and would like to confirm that my current configuration matches the working configuration (I think the channel updates during that time may have contributed to the problem, but aren’t sure).

So, my question is…

How do I find the configuration files in /nix/store that are copied from /etc/nixos during the build?

I can see that there is a configuration.nix there for each build, and can see the .drv file for each build, but not how to get from one to the other.

Thanks very much,

As far as I understand, you can’t. When any Nix file (in your case, a configuration) is built, it is evaluated directly without copying it to the Nix Store. If any derivations are the result of this evaluation, those derivations are added to the Nix Store, but there is no information stored as to what put them there or how.

The only reason you can see the configuration.nix files in your store is (most probably) because you have your configuration in a flake, and the contents of a flake are copied to to the Nix Store before the flake is built. This was implemented originally to ensure remote flakes like github:NixOS/nixpkgs can be evaluated, but in the future (when this PR gets merged), local flakes will not be copied to the store anymore, only remote ones.

If you have your configuration tracked in a git repository, you can go the other way around, though. Just check out a previous version, and run the following commands to find what system this version of the configuration has built:

# Replace $hostname with the name of the machine you're building for
nix build --no-link --print-out-paths /etc/nixos#nixosConfigurations.$

Or alternatively if you have enabled system.copySystemConfiguration. In this case you should get it in /nix/var/nix/profiles/system-*-link/configuration.nix.

1 Like

Ohh interesting. Well, in that case, the solution would be easy, but I guess @akgrant doesn’t have this option enabled :sweat_smile:

@iFreilicht, @aszlig thanks for your replies!

I do have some builds from flakes, moving to flakes is part of what I was doing in the last 3 days, so it is slightly different to the channel configuration I was using earlier.

I do have the channel configuration files in git, but there isn’t a 1-to-1 relationship between git commits and rebuilds - part of the reason why I was moving to flakes. :slight_smile:

I don’t have system.copySystemConfiguration set, although I think it would be of limited use since my configuration is spread across multiple files and according to the documentation system.copySystemConfiguration only copies the one file, not imported files (in my original post I only mentioned configuration.nix as I assumed that all files would be copied from /etc/nixos).

I’ll play with the nix build command that @iFreilicht suggested.

Thanks again!

1 Like

I’ve finally realised the issue with slack - the GPUCache (~/.config/Slack/GPUCache) needed to be cleared as described in Chromium Blank Pages.

Thanks again to @iFreilicht and @aszlig for their help!


Thank you for posting the fix! It has been affecting me too