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,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;
};
})