Skip to content

Instantly share code, notes, and snippets.

@worldofpeace
Last active June 2, 2023 17:10
Show Gist options
  • Save worldofpeace/27fcdcb111ddf58ba1227bf63501a5fe to your computer and use it in GitHub Desktop.
Save worldofpeace/27fcdcb111ddf58ba1227bf63501a5fe to your computer and use it in GitHub Desktop.
NixOS Pantheon Docs

Pantheon Desktop

Pantheon is the desktop environment created for the elementary OS distribution. It is written from scratch in Vala, utilizing GNOME technologies with GTK 3 and Granite. All of Pantheon is working in NixOS and the applications should be available, aside from a few exceptions. To enable Pantheon, set

services.xserver.desktopManager.pantheon.enable = true;

This automatically enables LightDM and Pantheon's LightDM Greeter. If you'd like to disable this, set

services.xserver.displayManager.lightdm.greeters.pantheon.enable = false;
services.xserver.displayManager.lightdm.enable = false;

but please be aware using Pantheon without LightDM as a display manager will break screenlocking from the UI.

The NixOS module for Pantheon installs all of Pantheon's default applications. If you'd like to not install Pantheon's apps, set

services.pantheon.apps.enable = false;

You can also use environment.pantheon.excludePackages to remove any other app (like geary).

Wingpanel and Switchboard plugins

Wingpanel and Switchboard work differently than they do in other distributions, as far as using plugins. You cannot install a plugin globally (like with environment.systemPackages) to start using it.

You instead should be using the following options:

  • services.xserver.desktopManager.pantheon.extraWingpanelIndicators
  • services.xserver.desktopManager.pantheon.extraSwitchboardPlugs

to configure the programs with plugs or indicators.

The difference in NixOS is both these programs are patched to load plugins from a directory that is the value of an environment variable. All of which is controlled in Nix.

If you need to configure the particular packages manually you can override1 the packages like:

wingpanel-with-indicators.override {
  indicators = [
    pkgs.some-special-indicator
  ];
};

switchboard-with-plugs.override {
  plugs = [
    pkgs.some-special-plug
  ];
};

please note that, like how the nixos options describe these as extra plugins, this would only add to the default plugins included with the programs.

If for some reason you'd like to configure which plugins to use exactly, both packages have an argument for this:

wingpanel-with-indiactors.override {
  useDefaultIndicators = false;
  indicators = specialListOfIndicators;
};

switchboard-with-plugs.override {
  useDefaultPlugs = false;
  plugs = specialListOfPlugs;
};

this could be most useful with testing a particular plugin isolated.

This could be used most promeninently in an overlay.

FAQ

I've switched from a different desktop and Pantheon's theming looks messed up?

Open Switchboard and go to: Administration -> About -> Restore Default Settings -> Restore Settings. This will reset any DConf settings to their Pantheon defaults. Note this could reset certain GNOME specific preferences if that desktop was used prior.

Using Pantheon sometimes makes my shutdow take a long time?

It's currently undetermined what process/s fight with Systemd during shutdown, there's many reports, but elementary OS has lowered the default system timeout to lessen the impact of the issue. If you'd like to do this in NixOS, set

systemd.extraConfig = ''
  DefaultTimeoutStopSec=10s
  DefaultTimeoutStartSec=10s
'';

I can't enable both Gnome 3 and Pantheon

This is a known issue and there is no known workaround.

Does Appcenter work, or is it available?

Appcenter has been available since 20.03, but it is of little use. This is because there's no functioning Packagekit backend for Nix 2.0. In the near future you will be able to install Flatpak applications from Appcenter on NixOS. See this issue.

Footnotes

  1. See the package overriding sections in the NixOS manuals.

@worldofpeace
Copy link
Author

this is in the manual since a while now https://nixos.org/manual/nixos/stable/index.html#chap-pantheon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment