summary refs log tree commit diff
path: root/nixos/modules/services
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2021-11-01 23:56:12 +0100
committerGitHub <noreply@github.com>2021-11-01 23:56:12 +0100
commitc3051ea7c24d15a05d6323d3e07aa42d10f266f2 (patch)
tree1c3cce0c377833a0ed27aaf4b658e06cbdce6483 /nixos/modules/services
parent670af1fba859ae2834325b4e764fb3c3d08b662a (diff)
parentc88d7f42cb144fc7e58f663dff4d8e9258691d87 (diff)
downloadnixpkgs-c3051ea7c24d15a05d6323d3e07aa42d10f266f2.tar
nixpkgs-c3051ea7c24d15a05d6323d3e07aa42d10f266f2.tar.gz
nixpkgs-c3051ea7c24d15a05d6323d3e07aa42d10f266f2.tar.bz2
nixpkgs-c3051ea7c24d15a05d6323d3e07aa42d10f266f2.tar.lz
nixpkgs-c3051ea7c24d15a05d6323d3e07aa42d10f266f2.tar.xz
nixpkgs-c3051ea7c24d15a05d6323d3e07aa42d10f266f2.tar.zst
nixpkgs-c3051ea7c24d15a05d6323d3e07aa42d10f266f2.zip
Merge pull request #144024 from SuperSandro2000/fix-plasma-users
Diffstat (limited to 'nixos/modules/services')
-rw-r--r--nixos/modules/services/x11/desktop-managers/plasma5.nix114
1 files changed, 51 insertions, 63 deletions
diff --git a/nixos/modules/services/x11/desktop-managers/plasma5.nix b/nixos/modules/services/x11/desktop-managers/plasma5.nix
index e8a62ea7576..52b641e23bd 100644
--- a/nixos/modules/services/x11/desktop-managers/plasma5.nix
+++ b/nixos/modules/services/x11/desktop-managers/plasma5.nix
@@ -14,10 +14,6 @@ let
 
   ini = pkgs.formats.ini { };
 
-  pulseaudio = config.hardware.pulseaudio;
-  pactl = "${getBin pulseaudio.package}/bin/pactl";
-  sed = "${getBin pkgs.gnused}/bin/sed";
-
   gtkrc2 = writeText "gtkrc-2.0" ''
     # Default GTK+ 2 config for NixOS Plasma 5
     include "/run/current-system/sw/share/themes/Breeze/gtk-2.0/gtkrc"
@@ -80,7 +76,7 @@ let
     # Qt from doing this wackiness in the first place.
     trolltech_conf="''${XDG_CONFIG_HOME}/Trolltech.conf"
     if [ -e "$trolltech_conf" ]; then
-        ${sed} -i "$trolltech_conf" -e '/nix\\store\|nix\/store/ d'
+      ${getBin pkgs.gnused}/bin/sed -i "$trolltech_conf" -e '/nix\\store\|nix\/store/ d'
     fi
 
     # Remove the kbuildsyscoca5 cache. It will be regenerated
@@ -101,43 +97,36 @@ let
     XDG_CONFIG_HOME=''${XDG_CONFIG_HOME:-$HOME/.config}
   '';
 
-  startplasma =
-    ''
-      ${set_XDG_CONFIG_HOME}
-      mkdir -p "''${XDG_CONFIG_HOME}"
-
-    ''
-    + optionalString pulseaudio.enable ''
-      # Load PulseAudio module for routing support.
-      # See also: http://colin.guthr.ie/2009/10/so-how-does-the-kde-pulseaudio-support-work-anyway/
-        ${pactl} load-module module-device-manager "do_routing=1"
-
-    ''
-    + ''
-      ${activationScript}
-
-      # Create default configurations if Plasma has never been started.
-      kdeglobals="''${XDG_CONFIG_HOME}/kdeglobals"
-      if ! [ -f "$kdeglobals" ]
-      then
-          kcminputrc="''${XDG_CONFIG_HOME}/kcminputrc"
-          if ! [ -f "$kcminputrc" ]; then
-              cat ${kcminputrc} >"$kcminputrc"
-          fi
-
-          gtkrc2="$HOME/.gtkrc-2.0"
-          if ! [ -f "$gtkrc2" ]; then
-              cat ${gtkrc2} >"$gtkrc2"
-          fi
-
-          gtk3_settings="''${XDG_CONFIG_HOME}/gtk-3.0/settings.ini"
-          if ! [ -f "$gtk3_settings" ]; then
-              mkdir -p "$(dirname "$gtk3_settings")"
-              cat ${gtk3_settings} >"$gtk3_settings"
-          fi
+  startplasma = ''
+    ${set_XDG_CONFIG_HOME}
+    mkdir -p "''${XDG_CONFIG_HOME}"
+  '' + optionalString config.hardware.pulseaudio.enable ''
+    # Load PulseAudio module for routing support.
+    # See also: http://colin.guthr.ie/2009/10/so-how-does-the-kde-pulseaudio-support-work-anyway/
+      ${getBin config.hardware.pulseaudio.package}/bin/pactl load-module module-device-manager "do_routing=1"
+  '' + ''
+    ${activationScript}
+
+    # Create default configurations if Plasma has never been started.
+    kdeglobals="''${XDG_CONFIG_HOME}/kdeglobals"
+    if ! [ -f "$kdeglobals" ]; then
+      kcminputrc="''${XDG_CONFIG_HOME}/kcminputrc"
+      if ! [ -f "$kcminputrc" ]; then
+          cat ${kcminputrc} >"$kcminputrc"
       fi
 
-    '';
+      gtkrc2="$HOME/.gtkrc-2.0"
+      if ! [ -f "$gtkrc2" ]; then
+          cat ${gtkrc2} >"$gtkrc2"
+      fi
+
+      gtk3_settings="''${XDG_CONFIG_HOME}/gtk-3.0/settings.ini"
+      if ! [ -f "$gtk3_settings" ]; then
+          mkdir -p "$(dirname "$gtk3_settings")"
+          cat ${gtk3_settings} >"$gtk3_settings"
+      fi
+    fi
+  '';
 
 in
 
@@ -202,27 +191,24 @@ in
       services.xserver.displayManager.sessionPackages = [ pkgs.libsForQt5.plasma5.plasma-workspace ];
 
       security.wrappers = {
-        kcheckpass =
-          {
-            setuid = true;
-            owner = "root";
-            group = "root";
-            source = "${getBin libsForQt5.kscreenlocker}/libexec/kcheckpass";
-          };
-        start_kdeinit =
-          {
-            setuid = true;
-            owner = "root";
-            group = "root";
-            source = "${getBin libsForQt5.kinit}/libexec/kf5/start_kdeinit";
-          };
-        kwin_wayland =
-          {
-            owner = "root";
-            group = "root";
-            capabilities = "cap_sys_nice+ep";
-            source = "${getBin plasma5.kwin}/bin/kwin_wayland";
-          };
+        kcheckpass = {
+          setuid = true;
+          owner = "root";
+          group = "root";
+          source = "${getBin libsForQt5.kscreenlocker}/libexec/kcheckpass";
+        };
+        start_kdeinit = {
+          setuid = true;
+          owner = "root";
+          group = "root";
+          source = "${getBin libsForQt5.kinit}/libexec/kf5/start_kdeinit";
+        };
+        kwin_wayland = {
+          owner = "root";
+          group = "root";
+          capabilities = "cap_sys_nice+ep";
+          source = "${getBin plasma5.kwin}/bin/kwin_wayland";
+        };
       };
 
       # DDC support
@@ -372,9 +358,12 @@ in
       programs.ssh.askPassword = mkDefault "${plasma5.ksshaskpass.out}/bin/ksshaskpass";
 
       # Enable helpful DBus services.
+      services.accounts-daemon.enable = true;
+      # when changing an account picture the accounts-daemon reads a temporary file containing the image which systemsettings5 may place under /tmp
+      systemd.services.accounts-daemon.serviceConfig.PrivateTmp = false;
       services.udisks2.enable = true;
       services.upower.enable = config.powerManagement.enable;
-      services.system-config-printer.enable = (mkIf config.services.printing.enable (mkDefault true));
+      services.system-config-printer.enable = mkIf config.services.printing.enable (mkDefault true);
       services.xserver.libinput.enable = mkDefault true;
 
       # Extra UDEV rules used by Solid
@@ -427,5 +416,4 @@ in
       nixpkgs.config.firefox.enablePlasmaBrowserIntegration = true;
     })
   ];
-
 }