Skip to content

services.plasma5: Update start menu with an activationScript - #42910

Merged
ttuegel merged 1 commit into
NixOS:masterfrom
bkchr:kde_update_start_menu
Jul 14, 2018
Merged

ttuegel merged 1 commit into
NixOS:masterfrom
bkchr:kde_update_start_menu

Conversation

@bkchr

@bkchr bkchr commented Jul 3, 2018 •

Copy link
Copy Markdown
Contributor

To update the plasma start menu kbuildsyscoca5 needs to be executed.
There are several people complaining about missing applications in their
plasma start menu.
This patch adds a activationScript for plasma, that runs
kbuildsyscoca5 for each user that has isNormalUser == true.

Motivation for this change

#41416
Fixes: #40915
#42548

Things done

@peterhoeg @ttuegel

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

To update the plasma start menu `kbuildsyscoca5` needs to be executed.
There are several people complaining about missing applications in their
plasma start menu.
This patch adds a activationScript for plasma, that runs
`kbuildsyscoca5` for each user that has `isNormalUser` == `true`.
@GrahamcOfBorg GrahamcOfBorg added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Jul 3, 2018
@peterhoeg

Copy link
Copy Markdown
Member

How about patching startkde instead? Then we don't need to resort to su.

@bkchr

bkchr commented Jul 3, 2018

Copy link
Copy Markdown
Contributor Author

I would like to have an approach where we don't need to restart the display manager.
I personally don't want to restart after each update, just to get my applications back working.

# Update the start menu for each user that has `isNormalUser` set.
system.activationScripts.plasmaSetup = stringAfter [ "users" "groups" ]
(concatStringsSep "\n"
(mapAttrsToList (name: value: "${pkgs.su}/bin/su ${name} -c kbuildsycoca5")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be a direct path via ${kdeWhatever}/bin/kbuildsycoca5? Does this affect users that aren't running kde (which is possible through a custom ~/.xsession file)?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this affect users that aren't running kde (which is possible through a custom ~/.xsession file)?

This only applies if config.services.xserver.desktopManager.plasma5.enable is true so if somebody sets that and then overrides the environment using ~/.xsession it would run even when KDE isn't active.

@worldofpeace

Copy link
Copy Markdown
Contributor

@peterhoeg @bkchr What's holding this up?

@bkchr

bkchr commented Jul 13, 2018

Copy link
Copy Markdown
Contributor Author

Good question, I think we wait for @ttuegel . But I think that he does not have that much time lately? (based on missing feedback on several of my prs)

@worldofpeace

Copy link
Copy Markdown
Contributor

I noticed this also. They ended up getting merged by someone else eventually...

Nudge Nudge @peterhoeg 😄

@ttuegel

ttuegel commented Jul 14, 2018

Copy link
Copy Markdown
Member

How about patching startkde instead? Then we don't need to resort to su.

We already do that, but like @bkchr said, we want this to happen without restarting the display manager if the user runs nixos-rebuild switch.

@ttuegel
ttuegel merged commit 1301973 into NixOS:master Jul 14, 2018
@bjornfor

Copy link
Copy Markdown
Contributor

Great! Planned to backport to release-18.03?

@nand0p

nand0p commented Aug 5, 2018

Copy link
Copy Markdown
Contributor

i am running kde5/plasma, and i am getting this error now on rebuild bash: kbuildsycoca5: command not found. not clear what the fix/workaround is?

@bkchr

bkchr commented Aug 6, 2018

Copy link
Copy Markdown
Contributor Author

@nand0p on which version of nixpkgs are you running? Did you had kde/plasma installed before or is this on a fresh install?

jerith666 added a commit to jerith666/nixpkgs that referenced this pull request Aug 18, 2018
* silence normal output from the command

* avoid running it when the data it wants to update is encrypted

* specify explicit bash in kbuildsycoca5 su command

  when the activation script runs at boot time, the users' default
  shells (typically /run/current-system/sw/bin/bash) will not be
  available.  instead, specify an explicit store path for bash.

follow-on to NixOS#42910 and NixOS#44544
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants