mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-20 04:19:00 +02:00
Merge pull request #140429 from bobby285271/pantheon-systemd
pantheon: manage user session with systemd
This commit is contained in:
commit
e96d5c13d0
|
@ -174,12 +174,38 @@ in
|
||||||
# https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1443
|
# https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1443
|
||||||
pkgs.pantheon.mutter
|
pkgs.pantheon.mutter
|
||||||
];
|
];
|
||||||
systemd.packages = [
|
systemd.packages = with pkgs; [
|
||||||
pkgs.pantheon.gnome-settings-daemon
|
gnome.gnome-session
|
||||||
|
pantheon.gala
|
||||||
|
pantheon.gnome-settings-daemon
|
||||||
|
pantheon.elementary-session-settings
|
||||||
];
|
];
|
||||||
programs.dconf.enable = true;
|
programs.dconf.enable = true;
|
||||||
networking.networkmanager.enable = mkDefault true;
|
networking.networkmanager.enable = mkDefault true;
|
||||||
|
|
||||||
|
systemd.user.targets."gnome-session-x11-services".wants = [
|
||||||
|
"org.gnome.SettingsDaemon.XSettings.service"
|
||||||
|
];
|
||||||
|
systemd.user.targets."gnome-session-x11-services-ready".wants = [
|
||||||
|
"org.gnome.SettingsDaemon.XSettings.service"
|
||||||
|
];
|
||||||
|
|
||||||
|
# https://github.com/elementary/gala/issues/1826#issuecomment-1890461298
|
||||||
|
systemd.user.services."io.elementary.gala.daemon@" = {
|
||||||
|
unitConfig = {
|
||||||
|
Description = "Gala Daemon";
|
||||||
|
BindsTo = "io.elementary.gala@.service";
|
||||||
|
After = "io.elementary.gala@.service";
|
||||||
|
};
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "dbus";
|
||||||
|
BusName = "org.pantheon.gala.daemon";
|
||||||
|
ExecStart = "${pkgs.pantheon.gala}/bin/gala-daemon";
|
||||||
|
Slice = "session.slice";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# Global environment
|
# Global environment
|
||||||
environment.systemPackages = (with pkgs.pantheon; [
|
environment.systemPackages = (with pkgs.pantheon; [
|
||||||
elementary-session-settings
|
elementary-session-settings
|
||||||
|
|
|
@ -40,7 +40,7 @@ let
|
||||||
IFS=:
|
IFS=:
|
||||||
for i in $XDG_CURRENT_DESKTOP; do
|
for i in $XDG_CURRENT_DESKTOP; do
|
||||||
case $i in
|
case $i in
|
||||||
KDE|GNOME|X-NIXOS-SYSTEMD-AWARE) echo "1"; exit; ;;
|
KDE|GNOME|Pantheon|X-NIXOS-SYSTEMD-AWARE) echo "1"; exit; ;;
|
||||||
*) ;;
|
*) ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
|
@ -50,11 +50,11 @@ import ./make-test-python.nix ({ pkgs, lib, ...} :
|
||||||
machine.wait_until_succeeds(f"pgrep -f {i}")
|
machine.wait_until_succeeds(f"pgrep -f {i}")
|
||||||
for i in ["gala", "io.elementary.wingpanel", "plank"]:
|
for i in ["gala", "io.elementary.wingpanel", "plank"]:
|
||||||
machine.wait_for_window(i)
|
machine.wait_for_window(i)
|
||||||
machine.wait_for_unit("bamfdaemon.service", "${user.name}")
|
for i in ["io.elementary.gala.daemon@x11.service", "bamfdaemon.service", "io.elementary.files.xdg-desktop-portal.service"]:
|
||||||
machine.wait_for_unit("io.elementary.files.xdg-desktop-portal.service", "${user.name}")
|
machine.wait_for_unit(i, "${user.name}")
|
||||||
|
|
||||||
with subtest("Check if various environment variables are set"):
|
with subtest("Check if various environment variables are set"):
|
||||||
cmd = "xargs --null --max-args=1 echo < /proc/$(pgrep -xf /run/current-system/sw/bin/gala)/environ"
|
cmd = "xargs --null --max-args=1 echo < /proc/$(pgrep -xf ${pkgs.pantheon.gala}/bin/gala)/environ"
|
||||||
machine.succeed(f"{cmd} | grep 'XDG_CURRENT_DESKTOP' | grep 'Pantheon'")
|
machine.succeed(f"{cmd} | grep 'XDG_CURRENT_DESKTOP' | grep 'Pantheon'")
|
||||||
# Hopefully from the sessionPath option.
|
# Hopefully from the sessionPath option.
|
||||||
machine.succeed(f"{cmd} | grep 'XDG_DATA_DIRS' | grep 'gsettings-schemas/pantheon-agent-geoclue2'")
|
machine.succeed(f"{cmd} | grep 'XDG_DATA_DIRS' | grep 'gsettings-schemas/pantheon-agent-geoclue2'")
|
||||||
|
|
|
@ -72,7 +72,7 @@ let
|
||||||
export XDG_DATA_DIRS=@out@/share:$XDG_DATA_DIRS
|
export XDG_DATA_DIRS=@out@/share:$XDG_DATA_DIRS
|
||||||
|
|
||||||
# Start pantheon session. Keep in sync with upstream
|
# Start pantheon session. Keep in sync with upstream
|
||||||
exec ${gnome-session}/bin/gnome-session --builtin --session=pantheon "$@"
|
exec ${gnome-session}/bin/gnome-session --session=pantheon "$@"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Absolute path patched version of the upstream xsession
|
# Absolute path patched version of the upstream xsession
|
||||||
|
|
|
@ -70,6 +70,9 @@ stdenv.mkDerivation rec {
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
chmod +x build-aux/meson/post_install.py
|
chmod +x build-aux/meson/post_install.py
|
||||||
patchShebangs build-aux/meson/post_install.py
|
patchShebangs build-aux/meson/post_install.py
|
||||||
|
|
||||||
|
# https://github.com/elementary/gala/issues/1826#issuecomment-1890461298
|
||||||
|
sed '2i Wants=io.elementary.gala.daemon@.service' -i 'data/gala@x11.service.in'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
|
|
Loading…
Reference in a new issue