I installed plank from unstable into a 18.03 system. It fails to get running applications.
[davidak@nixos:~]$ plank
(plank:18322): Gtk-WARNING **: 15:37:12.758: Locale not supported by C library.
Using the fallback 'C' locale.
[WARN 15:37:12.814197] [Environment:161] XDG_SESSION_CLASS not set in this environment!
[WARN 15:37:12.860595] [Preferences:192] '/run/current-system/sw/share/themes/Greybird/plank/dock.theme' is read-only!
[WARN 15:37:12.892718] Failed to get running applications: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.ayatana.bamf was not provided by any .service files
[WARN 15:37:12.898993] (Services/Matcher.c:296):plank_matcher_active_launchers: runtime check failed: (_tmp3_ != NULL)
[WARN 15:37:12.924205] Failed to register favorites: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.ayatana.bamf was not provided by any .service files
[WARN 15:37:12.994058] Creating surface took WAY TOO LONG (51ms), enabled downscaling for this cache!
On a different machine, also 18.03, i installed it using nix-env -i plank -f my-fork/ where i packaged it. There i don't have this problem.
Is there anything wrong with the method described below?
add unstable channel using nix-channel --add https://nixos.org/channels/nixos-unstable nixos-unstable
include this into your configuration.nix
{ config, pkgs, ... }:
let
unstable = import <nixos-unstable> {};
in
{
environment.systemPackages = with pkgs; [
unstable.plank
];
}
nixos-rebuild switch --upgrade[davidak@nixos:~]$ plank"x86_64-linux"Linux 4.14.52, NixOS, 18.03.132803.2f06e04b74e (Impala)yesyesnix-env (Nix) 2.0.4"nixos-18.03.132803.2f06e04b74e, nixos-hardware, nixos-unstable-18.09pre143771.a8c71037e04"/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgsI think this is related to #38991
@davidak This needs bamf in services.dbus.packages postulated by @jtojnar
If you could test that for me It would help me in mutually packaging elementary.
So I've packaged gala and when it's running plank will start yet it still cannot get the current running applications. But I haven't tested it with what was postulated.
I am looking into this. One problem is incorrectly seded location of units, though fixing it does not seem to be enough either. I also opened an upstream issue about the hardcoded path https://bugs.launchpad.net/bamf/+bug/1780557
So i added bamf and with gala running plank just works.

How did you add bamf? I can run it manually and have plank work, but for some reason systemd does not see my user service even with the fixed package: https://github.com/jtojnar/nixpkgs/tree/bamf
I added it the way you said and I rebooted.
Hmm, perhaps the restart is needed. I can run it fine in VM. Feel free to cherry-pick the commits to your branch.
I reproduced the issue on 18.09pre145524.2a8a5533d18 (Jellyfish).
It is fixed with the changes from @jtojnar and services.bamf.enable = true;.
Thank you very much!
(Would it be possible to enable it by default when plank is installed?)
Nix unfortunately does not support requiring NixOS options (remember, Nix also targets platforms other than NixOS).
Most helpful comment
I am looking into this. One problem is incorrectly
seded location of units, though fixing it does not seem to be enough either. I also opened an upstream issue about the hardcoded path https://bugs.launchpad.net/bamf/+bug/1780557