NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18k stars 14.01k forks source link

xfce plugins aren't found on reboot #27339

Closed michaelpj closed 7 years ago

michaelpj commented 7 years ago

Issue description

I've added several xfce plugins to my environment.systemPackages, and this works fine. However, when I reboot the machine, they can't be found (items disappear from panels and can't be re-added).

Doing a nixos-rebuild switch brings them back again.

Steps to reproduce

environment.systemPackages = [ pkgs.xfce.xfce4_whiskermenu_plugin ]

Add a whisker menu item to a panel. Reboot.

Technical details

emmanuelrosa commented 7 years ago

How odd. I've never had that problem. Here are my XFCE plugins:

environment.systemPackages = with pkgs; [       
        xfce.xfce4_cpugraph_plugin
        xfce.xfce4-hardware-monitor-plugin
        xfce.xfce4_timer_plugin
];

As I understand it...

  1. You add the package to environment.systemPackages.
  2. You run nixos-rebuild ??? - Which command are you using here? Is it the "test" command?
  3. It works fine. Can you clarify your steps here? I recall having to log back in to XFCE for it to detect the plugins.
  4. You reboot the machine.
  5. Plugins can no longer be added, so effectively they've been removed from your environment.
  6. You run nixos-rebuild switch after which the plugins can be used again.

So if you don't mind, please elaborate on my questions above.

michaelpj commented 7 years ago

Here's the sequence of events:

  1. Add package to systemPackages
  2. nixos-rebuild switch
  3. Plugins seem to be there, add to panel.
  4. Reboot.
  5. Plugins (apparently) missing. Panel lacks plugin items, they don't appear to be added.
  6. nixos-rebuild switch
  7. Plugins seem to be there, can add to panel again.

This seems to be pretty reproducible, so I'm quite confused as to what's going on. Perhaps something to do with the order in which systemd starts things on boot? The switch might force some things to be reloaded.

emmanuelrosa commented 7 years ago

Yes, switch executes the activation process, which means impure changes outside of the Nix store can take place, such as starting/stopping services.

Do you have XFCE configured in configuration.nix? Something like this:

  services.xserver = {
        # Enable the X11 windowing system.
        enable = true;
        layout = "us";

        desktopManager.xfce.enable = true;
  };

Do you have any XFCE packages installed in your profile (installed via nix-env), rather than system wide? You can check with nix-env -q --installed.

michaelpj commented 7 years ago

Yup, here's the relevant bit of my config. I don't have any XFCE packages installed in my profile.

emmanuelrosa commented 7 years ago

@edolstra, I see you are the maintainer for some XFCE packages so perhaps I can pick your brain for a moment.

I don't understand how the XFCE panel is able to find non-core plugins, such as xfce4_whiskermenu_plugin.

I checked the XFCE panel's Nix store path, and as I expected, didn't find any symlinks to plugins in other Nix store paths. I checked the cmdline and environment of a running panel and nothing stood out. I saw the panel's wrapper, but it seems it's main purpose is to add Gstreamer. Based on the OP's description I'm leaning toward activation, although it runs at boot. So... yeah, I'm stumped.

michaelpj commented 7 years ago

I eventually discovered why this was, and it was entirely me - at some point I'd lost the mounting of /boot, so my new profiles were going into a different folder than the one I was booting from. So I was always booting into an old profile and then switching to the new one. PEBCAK.