push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,138 @@
{
lib,
stdenv,
buildPackages,
fetchFromGitHub,
nix-update-script,
replaceVars,
plymouth,
pam,
pkg-config,
autoreconfHook,
gettext,
libtool,
libxcb,
glib,
libXdmcp,
itstool,
intltool,
libxklavier,
libgcrypt,
audit,
busybox,
polkit,
accountsservice,
gtk-doc,
gobject-introspection,
vala,
fetchpatch,
withQt5 ? false,
qtbase,
yelp-tools,
yelp-xsl,
nixosTests,
}:
stdenv.mkDerivation rec {
pname = "lightdm";
version = "1.32.0";
outputs = [
"out"
"dev"
];
src = fetchFromGitHub {
owner = "canonical";
repo = "lightdm";
rev = version;
sha256 = "sha256-ttNlhWD0Ran4d3QvZ+PxbFbSUGMkfrRm+hJdQxIDJvM=";
};
nativeBuildInputs = [
autoreconfHook
gettext
yelp-tools
yelp-xsl
gobject-introspection
gtk-doc
intltool
itstool
libtool
pkg-config
vala
];
buildInputs = [
accountsservice
audit
glib
libXdmcp
libgcrypt
libxcb
libxklavier
pam
polkit
]
++ lib.optional withQt5 qtbase;
patches = [
# Adds option to disable writing dmrc files
(fetchpatch {
url = "https://src.fedoraproject.org/rpms/lightdm/raw/4cf0d2bed8d1c68970b0322ccd5dbbbb7a0b12bc/f/lightdm-1.25.1-disable_dmrc.patch";
sha256 = "06f7iabagrsiws2l75sx2jyljknr9js7ydn151p3qfi104d1541n";
})
# Hardcode plymouth to fix transitions.
# For some reason it can't find `plymouth`
# even when it's in PATH in environment.systemPackages.
(replaceVars ./fix-paths.patch {
plymouth = "${plymouth}/bin/plymouth";
})
# glib gettext is deprecated and broken, so use regular gettext instead
./use-regular-gettext.patch
];
dontWrapQtApps = true;
preConfigure = "NOCONFIGURE=1 ./autogen.sh";
configureFlags = [
"--localstatedir=/var"
"--sysconfdir=/etc"
"--disable-tests"
"--disable-dmrc"
]
++ lib.optional withQt5 "--enable-liblightdm-qt5";
installFlags = [
"sysconfdir=${placeholder "out"}/etc"
"localstatedir=\${TMPDIR}"
];
prePatch = ''
substituteInPlace autogen.sh \
--replace "which" "${buildPackages.busybox}/bin/which"
substituteInPlace src/shared-data-manager.c \
--replace /bin/rm ${busybox}/bin/rm
'';
postInstall = ''
rm -rf $out/etc/apparmor.d $out/etc/init $out/etc/pam.d
'';
passthru = {
updateScript = nix-update-script { };
tests = { inherit (nixosTests) lightdm; };
};
meta = with lib; {
homepage = "https://github.com/canonical/lightdm";
description = "Cross-desktop display manager";
platforms = platforms.linux;
license = licenses.gpl3;
teams = [ teams.pantheon ];
};
}

View File

@@ -0,0 +1,13 @@
diff --git a/src/plymouth.c b/src/plymouth.c
index d1ed91f4..318f9409 100644
--- a/src/plymouth.c
+++ b/src/plymouth.c
@@ -24,7 +24,7 @@ static gboolean has_active_vt = FALSE;
static gboolean
plymouth_run_command (const gchar *command, gint *exit_status)
{
- g_autofree gchar *command_line = g_strdup_printf ("plymouth %s", command);
+ g_autofree gchar *command_line = g_strdup_printf ("@plymouth@ %s", command);
g_autoptr(GError) error = NULL;
gboolean result = g_spawn_command_line_sync (command_line, NULL, NULL, exit_status, &error);

View File

@@ -0,0 +1,83 @@
{
stdenv,
lib,
lightdm-gtk-greeter,
fetchurl,
lightdm,
pkg-config,
intltool,
linkFarm,
wrapGAppsHook3,
gtk3,
xfce4-dev-tools,
at-spi2-core,
librsvg,
hicolor-icon-theme,
}:
stdenv.mkDerivation rec {
pname = "lightdm-gtk-greeter";
version = "2.0.9";
src = fetchurl {
# Release tarball differs from source tarball.
url = "https://github.com/Xubuntu/lightdm-gtk-greeter/releases/download/lightdm-gtk-greeter-${version}/lightdm-gtk-greeter-${version}.tar.gz";
hash = "sha256-yP3xmKqaP50NrQtI3+I8Ine3kQfo/PxillKQ8QgfZF0=";
};
nativeBuildInputs = [
pkg-config
intltool
xfce4-dev-tools
wrapGAppsHook3
];
buildInputs = [
lightdm
librsvg
hicolor-icon-theme
gtk3
];
configureFlags = [
"--localstatedir=/var"
"--sysconfdir=/etc"
"--disable-indicator-services-command"
"--sbindir=${placeholder "out"}/bin" # for wrapGAppsHook3 to wrap automatically
];
postPatch = ''
# https://github.com/Xubuntu/lightdm-gtk-greeter/pull/178
cp data/badges/xfce{,-wayland}_badge-symbolic.svg
'';
preConfigure = ''
configureFlagsArray+=( --enable-at-spi-command="${at-spi2-core}/libexec/at-spi-bus-launcher --launch-immediately" )
'';
installFlags = [
"localstatedir=\${TMPDIR}"
"sysconfdir=${placeholder "out"}/etc"
];
postInstall = ''
substituteInPlace "$out/share/xgreeters/lightdm-gtk-greeter.desktop" \
--replace-fail "Exec=lightdm-gtk-greeter" "Exec=$out/bin/lightdm-gtk-greeter"
'';
passthru.xgreeters = linkFarm "lightdm-gtk-greeter-xgreeters" [
{
path = "${lightdm-gtk-greeter}/share/xgreeters/lightdm-gtk-greeter.desktop";
name = "lightdm-gtk-greeter.desktop";
}
];
meta = with lib; {
homepage = "https://github.com/Xubuntu/lightdm-gtk-greeter";
description = "GTK greeter for LightDM";
mainProgram = "lightdm-gtk-greeter";
platforms = platforms.linux;
license = licenses.gpl3Plus;
maintainers = with maintainers; [ bobby285271 ];
};
}

View File

@@ -0,0 +1,13 @@
diff --git a/configure.ac b/configure.ac
index 6f2e706f..6307dd59 100644
--- a/configure.ac
+++ b/configure.ac
@@ -195,6 +195,8 @@ dnl Internationalization
dnl ###########################################################################
IT_PROG_INTLTOOL(0.35.0)
+AM_GNU_GETTEXT([external])
+AM_GNU_GETTEXT_VERSION([0.21])
AC_SUBST(GETTEXT_PACKAGE, lightdm)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", Gettext package)

View File

@@ -0,0 +1,43 @@
{
lib,
callPackage,
runCommand,
wrapQtAppsHook,
unwrapped ? callPackage ./unwrapped.nix { },
extraPackages ? [ ],
}:
runCommand "sddm-wrapped"
{
inherit (unwrapped) version outputs;
buildInputs = unwrapped.buildInputs ++ extraPackages;
nativeBuildInputs = [ wrapQtAppsHook ];
strictDeps = true;
passthru = {
inherit unwrapped;
inherit (unwrapped.passthru) tests;
};
meta = unwrapped.meta;
}
''
mkdir -p $out/bin
cd ${unwrapped}
for i in *; do
if [ "$i" == "bin" ]; then
continue
fi
ln -s ${unwrapped}/$i $out/$i
done
for i in bin/*; do
makeQtWrapper ${unwrapped}/$i $out/$i --set SDDM_GREETER_DIR $out/bin
done
mkdir -p $man
ln -s ${lib.getMan unwrapped}/* $man/
''

View File

@@ -0,0 +1,14 @@
diff --git a/src/daemon/Greeter.cpp b/src/daemon/Greeter.cpp
index 07fccde..dd22a07 100644
--- a/src/daemon/Greeter.cpp
+++ b/src/daemon/Greeter.cpp
@@ -83,7 +83,8 @@ namespace SDDM {
QString Greeter::greeterPathForQt(int qtVersion)
{
const QString suffix = qtVersion == 5 ? QString() : QStringLiteral("-qt%1").arg(qtVersion);
- return QStringLiteral(BIN_INSTALL_DIR "/sddm-greeter%1").arg(suffix);
+ const QString greeterDir = qEnvironmentVariable("SDDM_GREETER_DIR", QStringLiteral(BIN_INSTALL_DIR));
+ return QStringLiteral("%1/sddm-greeter%2").arg(greeterDir).arg(suffix);
}
bool Greeter::start() {

View File

@@ -0,0 +1,71 @@
diff --git a/src/common/Configuration.h b/src/common/Configuration.h
index 54bcace..49cf5cb 100644
--- a/src/common/Configuration.h
+++ b/src/common/Configuration.h
@@ -48,6 +48,8 @@ namespace SDDM {
Entry(InputMethod, QString, QStringLiteral("qtvirtualkeyboard"), _S("Input method module"));
Entry(Namespaces, QStringList, QStringList(), _S("Comma-separated list of Linux namespaces for user session to enter"));
Entry(GreeterEnvironment, QStringList, QStringList(), _S("Comma-separated list of environment variables to be set"));
+ Entry(DefaultSession, QString, QString(), _S("System-wide default session"));
+
// Name Entries (but it's a regular class again)
Section(Theme,
Entry(ThemeDir, QString, _S(DATA_INSTALL_DIR "/themes"), _S("Theme directory path"));
diff --git a/src/greeter/SessionModel.cpp b/src/greeter/SessionModel.cpp
index d8698b7..df3e3c4 100644
--- a/src/greeter/SessionModel.cpp
+++ b/src/greeter/SessionModel.cpp
@@ -49,6 +49,7 @@ namespace SDDM {
if (dri_active)
populate(Session::WaylandSession, mainConfig.Wayland.SessionDir.get());
populate(Session::X11Session, mainConfig.X11.SessionDir.get());
+ selectDefaultSession();
endResetModel();
// refresh everytime a file is changed, added or removed
@@ -62,6 +63,7 @@ namespace SDDM {
if (dri_active)
populate(Session::WaylandSession, mainConfig.Wayland.SessionDir.get());
populate(Session::X11Session, mainConfig.X11.SessionDir.get());
+ selectDefaultSession();
endResetModel();
});
watcher->addPaths(mainConfig.Wayland.SessionDir.get());
@@ -164,11 +166,25 @@ namespace SDDM {
delete si;
}
}
+ }
+
+ void SessionModel::selectDefaultSession() {
+ d->lastIndex = 0;
+
// find out index of the last session
for (int i = 0; i < d->sessions.size(); ++i) {
if (d->sessions.at(i)->fileName() == stateConfig.Last.Session.get()) {
d->lastIndex = i;
- break;
+ return;
+ }
+ }
+
+ // Otherwise, fallback to system-wide default session.
+ auto defaultSession = mainConfig.DefaultSession.get();
+ for (int i = 0; i < d->sessions.size(); ++i) {
+ if (QFileInfo(d->sessions.at(i)->fileName()).fileName() == defaultSession) {
+ d->lastIndex = i;
+ return;
}
}
}
diff --git a/src/greeter/SessionModel.h b/src/greeter/SessionModel.h
index 8f4d539..02f77ce 100644
--- a/src/greeter/SessionModel.h
+++ b/src/greeter/SessionModel.h
@@ -59,6 +59,7 @@ namespace SDDM {
SessionModelPrivate *d { nullptr };
void populate(Session::Type type, const QStringList &dirPaths);
+ void selectDefaultSession();
};
}

View File

@@ -0,0 +1,45 @@
diff --git a/src/common/ConfigReader.cpp b/src/common/ConfigReader.cpp
index 041e5ed..efb1324 100644
--- a/src/common/ConfigReader.cpp
+++ b/src/common/ConfigReader.cpp
@@ -148,17 +148,14 @@ namespace SDDM {
// * m_path (classic fallback /etc/sddm.conf)
QStringList files;
- QDateTime latestModificationTime = QFileInfo(m_path).lastModified();
if (!m_sysConfigDir.isEmpty()) {
//include the configDir in modification time so we also reload on any files added/removed
QDir dir(m_sysConfigDir);
if (dir.exists()) {
- latestModificationTime = std::max(latestModificationTime, QFileInfo(m_sysConfigDir).lastModified());
const auto dirFiles = dir.entryInfoList(QDir::Files | QDir::NoDotAndDotDot, QDir::LocaleAware);
for (const QFileInfo &file : dirFiles) {
files << (file.absoluteFilePath());
- latestModificationTime = std::max(latestModificationTime, file.lastModified());
}
}
}
@@ -166,22 +163,15 @@ namespace SDDM {
//include the configDir in modification time so we also reload on any files added/removed
QDir dir(m_configDir);
if (dir.exists()) {
- latestModificationTime = std::max(latestModificationTime, QFileInfo(m_configDir).lastModified());
const auto dirFiles = dir.entryInfoList(QDir::Files | QDir::NoDotAndDotDot, QDir::LocaleAware);
for (const QFileInfo &file : dirFiles) {
files << (file.absoluteFilePath());
- latestModificationTime = std::max(latestModificationTime, file.lastModified());
}
}
}
files << m_path;
- if (latestModificationTime <= m_fileModificationTime) {
- return;
- }
- m_fileModificationTime = latestModificationTime;
-
for (const QString &filepath : qAsConst(files)) {
loadInternal(filepath);
}

View File

@@ -0,0 +1,121 @@
{
stdenv,
lib,
fetchFromGitHub,
fetchpatch,
cmake,
pkg-config,
qttools,
libxcb,
libXau,
pam,
qtbase,
qtdeclarative,
qtquickcontrols2 ? null,
systemd,
xkeyboardconfig,
nixosTests,
docutils,
}:
let
isQt6 = lib.versions.major qtbase.version == "6";
in
stdenv.mkDerivation (finalAttrs: {
pname = "sddm-unwrapped";
version = "0.21.0";
src = fetchFromGitHub {
owner = "sddm";
repo = "sddm";
rev = "v${finalAttrs.version}";
hash = "sha256-r5mnEWham2WnoEqRh5tBj/6rn5mN62ENOCmsLv2Ht+w=";
};
outputs = [
"out"
"man"
];
patches = [
./greeter-path.patch
./sddm-ignore-config-mtime.patch
./sddm-default-session.patch
(fetchpatch {
name = "sddm-fix-cmake-4.patch";
url = "https://github.com/sddm/sddm/commit/228778c2b4b7e26db1e1d69fe484ed75c5791c3a.patch";
hash = "sha256-Okt9LeZBhTDhP7NKBexWAZhkK6N6j9dFkAEgpidSnzE=";
})
];
postPatch = ''
substituteInPlace src/greeter/waylandkeyboardbackend.cpp \
--replace "/usr/share/X11/xkb/rules/evdev.xml" "${xkeyboardconfig}/share/X11/xkb/rules/evdev.xml"
'';
nativeBuildInputs = [
cmake
pkg-config
qttools
docutils
];
buildInputs = [
libxcb
libXau
pam
qtbase
qtdeclarative
qtquickcontrols2
systemd
];
# We will wrap manually later
dontWrapQtApps = true;
cmakeFlags = [
(lib.cmakeBool "BUILD_WITH_QT6" isQt6)
(lib.cmakeBool "BUILD_MAN_PAGES" true)
"-DCONFIG_FILE=/etc/sddm.conf"
"-DCONFIG_DIR=/etc/sddm.conf.d"
# Set UID_MIN and UID_MAX so that the build script won't try
# to read them from /etc/login.defs (fails in chroot).
# The values come from NixOS; they may not be appropriate
# for running SDDM outside NixOS, but that configuration is
# not supported anyway.
"-DUID_MIN=1000"
"-DUID_MAX=29999"
"-DSDDM_INITIAL_VT=1"
"-DQT_IMPORTS_DIR=${placeholder "out"}/${qtbase.qtQmlPrefix}"
"-DCMAKE_INSTALL_SYSCONFDIR=${placeholder "out"}/etc"
"-DSYSTEMD_SYSTEM_UNIT_DIR=${placeholder "out"}/lib/systemd/system"
"-DSYSTEMD_SYSUSERS_DIR=${placeholder "out"}/lib/sysusers.d"
"-DSYSTEMD_TMPFILES_DIR=${placeholder "out"}/lib/tmpfiles.d"
"-DDBUS_CONFIG_DIR=${placeholder "out"}/share/dbus-1/system.d"
];
postInstall = ''
# remove empty scripts
rm "$out/share/sddm/scripts/Xsetup" "$out/share/sddm/scripts/Xstop"
for f in $out/share/sddm/themes/**/theme.conf ; do
substituteInPlace $f \
--replace 'background=' "background=$(dirname $f)/"
done
'';
passthru.tests = { inherit (nixosTests) sddm; };
meta = with lib; {
description = "QML based X11 display manager";
homepage = "https://github.com/sddm/sddm";
maintainers = with maintainers; [
ttuegel
k900
];
platforms = platforms.linux;
license = licenses.gpl2Plus;
};
})