Polkit not working for kate and kwrite

I have setup a minimal KDE Plasma Setup, these are the snippets from my config files

# KDE Plasma 6 and SDDM
    services.displayManager.sddm.enable = true ;
    services.desktopManager.plasma6.enable = true ;

    # KDE Plasma in Wayland
    services.displayManager.defaultSession = "plasma" ;

    # SDDM in Wayland
    services.displayManager.sddm.wayland.enable = true ;

    # KDE Plasma
    environment.plasma6.excludePackages = with pkgs.kdePackages; [
    oxygen
    elisa
    xwaylandvideobridge
    ];
        
    environment.systemPackages = with pkgs; [
 	kate
	kdePackages.polkit-kde-agent-1
	kdePackages.polkit-qt-1
	kdePackages.ktexteditor
    ];

    security.polkit.enable = true;

Rebuilt my system but still, I cannot save config files from kate, no dialog is showing up, it just gives a permission error.

These solutions seem outdated and did not solve the issue.

This seems right, given on unstable:

~/.config/home-manager master +2 !4 ?2                                                            
❯ nix repl --file '<nixpkgs>'
Nix 2.24.14
Type :? for help.
Loading installable ''...
Added 23019 variables.
nix-repl> sources = import ./npins 

nix-repl> unstable = import sources.unstable {}                                 

nix-repl> :b unstable.kate
error:
       … while calling the 'throw' builtin
         at /nix/store/md1n4rwfkvn5wwxyrd2d1a7yf52f1yms-source/pkgs/top-level/aliases.nix:198:5:
          197|     name:
          198|     throw ''
             |     ^
          199|       The top-level ${name} alias has been removed.

       error: The top-level kate alias has been removed.

       Please explicitly use kdePackages.kate for the latest Qt 6-based version,
       or libsForQt5.kate for the deprecated Qt 5 version.

       Note that Qt 5 versions of most KDE software will be removed in NixOS 25.11.

nix-repl> 

Wait so it is kdePackages.kate instead of kate? That is the issue?

@valsan has a working config, other people on that thread also mention the same thing (use kdePackages.kate) as a fix.

2 Likes

Thanks indeed. All I need are these packages and now it works

environment.systemPackages = with pkgs; [
    kdePackages.kate
    kdePackages.ktexteditor
    ];

The rest is already installed

I will try if manually enabling polkit is needed

1 Like

Enabling polkit is also not needed