X display flickering

I am running 21.11, and bspwm as my window manager. I recently made an edit in home.nix to my polybar configuration. After running home-manager switch, my X display began flickering, randomly, constantly, about 1-2 times every 1-2 seconds. It appears like a black window with no decorations is being drawn over the entire display except a row maybe 20 pixels along the top border.

I have confirmed that it is X, because if I drop down to a TTY, there is no flickering. Also, if I connect an external display, that display is fine, but my internal laptop display continues to flicker.

I don’t think it is related to my polybar config, because I stopped it with a systemctl --user stop polybar.service and the flickering continues.

edit: I switched back one generation (2022-03-03) and the problem persisted. I switched back one more generation (2022-02-07) and the problem cleared up. How can I determine which package messed things up.

p.s. During boot, in the systemd boot loader, I switched to generation 151. But when I run `sudo nix-env --list-generations --profile /nix/var/nix/profiles/system’, it shows generation 152 as current. Why is that?

If you switch into a non-default generation, it won’t match… with the default generation (called “current” by nix-env). EDIT: perhaps it’s unclear that the choice is the boot menu is not a persistent one.

1 Like

Can you diff the generations with diff-closures to narrow things down?

Is there something I need to install to run nix store? My nix doesn’t have a store command.

I expect that your nix is too old.

nix (Nix) 2.3.16. Too old?

There’s a known issue with picom and nvidia cards. I know I have to disable picom if my system suspends.

I am running picom, but on Irix Xe Graphics.

Nix 2.3 does not have the nix store sub-command. 2.4 does.

Apparently, there is an issue with Iris Xe as well. I just stopped my picom service and the flickering problem has gone away. Thanks for the tip. What is the issue? Is there a solution?

Follow-up question: If I select a non-default generation at boot, how can I query the system to tell me which generation was used at boot? Since --list-generation shows me the default, and not the currently loaded one. Terminilogy here leads to confusion obviously.

Second follow-up question: Running sudo nixos-rebuild --upgrade switch updates my channel, updates packages and switches to the new generation, but is there a way to list the packages that will be updated before commiting? Also, is there a way to query the channel to see if there are any package updates?

edit: spelling

I find this useful:

$ ls -l /run/{booted,current}-system

EDIT: note that both can differ from the “current” generation. You can use nixos-rebuild test or activate any system version manually.

Is there a way to associate those store paths to the nix-env generation numbering?

I know nothing nice. But if you

$ ls -l /nix/var/nix/profiles/system*

you could grep the hash and see from which number(s) it gets linked.

The issue is clearly “solved”, but for reference and completeness, the nix subcommands exist since nix 2.4. They’re experimental and behind a feature flag by default (experimental-features = nix-command flakes in nix.extraOptions).

Sorry for sending you down a wild goose chase there, I’m usually more careful about pointing at experimental features. Guess I was just a bit excited upon realizing how useful that command is for bisecting :slight_smile:

No problem. Actually the problem has been identified as an issue with picom. I don’t know the particulars, don’t know if it is Nix specific, and don’t know the solution other than to temporarily disable picom.

Then, for fun, we went down a bunch of unrelated rabbit holes.

Good leaning, and appreciate the replies.

1 Like