calamares: 3.3.13 -> 3.4.0, qt6-ize, clean up, move to by-name
This commit is contained in:
parent
917eb19a79
commit
fb7d7c5fe0
@ -11,7 +11,7 @@
|
||||
# Add Firefox and other tools useful for installation to the launcher
|
||||
favoriteAppsOverride = ''
|
||||
[org.gnome.shell]
|
||||
favorite-apps=[ 'firefox.desktop', 'nixos-manual.desktop', 'org.gnome.Console.desktop', 'org.gnome.Nautilus.desktop', 'gparted.desktop', 'io.calamares.calamares.desktop' ]
|
||||
favorite-apps=[ 'firefox.desktop', 'nixos-manual.desktop', 'org.gnome.Console.desktop', 'org.gnome.Nautilus.desktop', 'gparted.desktop', 'calamares.desktop' ]
|
||||
'';
|
||||
|
||||
# Override GNOME defaults to disable GNOME tour and disable suspend
|
||||
|
@ -45,8 +45,8 @@
|
||||
ln -sfT ${pkgs.plasma5Packages.konsole}/share/applications/org.kde.konsole.desktop ${
|
||||
desktopDir + "org.kde.konsole.desktop"
|
||||
}
|
||||
ln -sfT ${pkgs.calamares-nixos}/share/applications/io.calamares.calamares.desktop ${
|
||||
desktopDir + "io.calamares.calamares.desktop"
|
||||
ln -sfT ${pkgs.calamares-nixos}/share/applications/calamares.desktop ${
|
||||
desktopDir + "calamares.desktop"
|
||||
}
|
||||
'';
|
||||
|
||||
|
@ -50,8 +50,8 @@
|
||||
|
||||
ln -sfT ${manualDesktopFile} ${desktopDir + "nixos-manual.desktop"}
|
||||
ln -sfT ${pkgs.gparted}/share/applications/gparted.desktop ${desktopDir + "gparted.desktop"}
|
||||
ln -sfT ${pkgs.calamares-nixos}/share/applications/io.calamares.calamares.desktop ${
|
||||
desktopDir + "io.calamares.calamares.desktop"
|
||||
ln -sfT ${pkgs.calamares-nixos}/share/applications/calamares.desktop ${
|
||||
desktopDir + "calamares.desktop"
|
||||
}
|
||||
'';
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
calamares-nixos-autostart = pkgs.makeAutostartItem {
|
||||
name = "io.calamares.calamares";
|
||||
name = "calamares";
|
||||
package = pkgs.calamares-nixos;
|
||||
};
|
||||
in
|
||||
|
@ -1,20 +1,8 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Victor Fuentes <vmfuentes64@gmail.com>
|
||||
Date: Thu, 1 Aug 2024 15:53:16 -0400
|
||||
Subject: [PATCH] Modifies the users module to only set passwords of user and
|
||||
root
|
||||
|
||||
as the users will have already been created in the configuration.nix
|
||||
file
|
||||
---
|
||||
src/modules/users/Config.cpp | 15 ---------------
|
||||
1 file changed, 15 deletions(-)
|
||||
|
||||
diff --git a/src/modules/users/Config.cpp b/src/modules/users/Config.cpp
|
||||
index cd56bc3e2..9b09b36cd 100644
|
||||
index be754774b..4b0513df0 100644
|
||||
--- a/src/modules/users/Config.cpp
|
||||
+++ b/src/modules/users/Config.cpp
|
||||
@@ -1028,12 +1028,6 @@ Config::createJobs() const
|
||||
@@ -1069,12 +1069,6 @@ Config::createJobs() const
|
||||
|
||||
Calamares::Job* j;
|
||||
|
||||
@ -27,7 +15,7 @@ index cd56bc3e2..9b09b36cd 100644
|
||||
if ( getActiveDirectoryUsed() )
|
||||
{
|
||||
j = new ActiveDirectoryJob( m_activeDirectoryAdminUsername,
|
||||
@@ -1043,20 +1037,11 @@ Config::createJobs() const
|
||||
@@ -1084,20 +1078,11 @@ Config::createJobs() const
|
||||
jobs.append( Calamares::job_ptr( j ) );
|
||||
}
|
||||
|
@ -0,0 +1,33 @@
|
||||
diff --git a/src/libcalamares/GlobalStorage.h b/src/libcalamares/GlobalStorage.h
|
||||
index 37ea332d2..b9e629350 100644
|
||||
--- a/src/libcalamares/GlobalStorage.h
|
||||
+++ b/src/libcalamares/GlobalStorage.h
|
||||
@@ -56,13 +56,6 @@ public:
|
||||
*/
|
||||
explicit GlobalStorage( QObject* parent = nullptr );
|
||||
|
||||
- /** @brief Insert a key and value into the store
|
||||
- *
|
||||
- * The @p value is added to the store with key @p key. If @p key
|
||||
- * already exists in the store, its existing value is overwritten.
|
||||
- * The changed() signal is emitted regardless.
|
||||
- */
|
||||
- void insert( const QString& key, const QVariant& value );
|
||||
/** @brief Removes a key and its value
|
||||
*
|
||||
* The @p key is removed from the store. If the @p key does not
|
||||
@@ -123,6 +116,14 @@ public:
|
||||
QVariantMap data() const { return m; }
|
||||
|
||||
public Q_SLOTS:
|
||||
+ /** @brief Insert a key and value into the store
|
||||
+ *
|
||||
+ * The @p value is added to the store with key @p key. If @p key
|
||||
+ * already exists in the store, its existing value is overwritten.
|
||||
+ * The changed() signal is emitted regardless.
|
||||
+ */
|
||||
+ void insert( const QString& key, const QVariant& value );
|
||||
+
|
||||
/** @brief Does the store contain the given key?
|
||||
*
|
||||
* This can distinguish an explicitly-inserted QVariant() from
|
130
pkgs/by-name/ca/calamares/package.nix
Normal file
130
pkgs/by-name/ca/calamares/package.nix
Normal file
@ -0,0 +1,130 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitea,
|
||||
|
||||
cmake,
|
||||
ninja,
|
||||
kdePackages,
|
||||
qt6,
|
||||
|
||||
libpwquality,
|
||||
libxcrypt,
|
||||
parted,
|
||||
yaml-cpp,
|
||||
|
||||
tzdata,
|
||||
ckbcomp,
|
||||
util-linux,
|
||||
os-prober,
|
||||
xkeyboard_config,
|
||||
|
||||
nixos-extensions ? false,
|
||||
# passthru.tests
|
||||
calamares-nixos,
|
||||
calamares-nixos-extensions,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "calamares";
|
||||
version = "3.4.0";
|
||||
|
||||
src = fetchFromGitea {
|
||||
domain = "codeberg.org";
|
||||
owner = "Calamares";
|
||||
repo = "calamares";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-Qk+GnonuEWK3hXjmwxf9awgxr6dGunShJgwmkT78qKM=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Don't allow LUKS in manual partitioning
|
||||
# FIXME: this really needs to be fixed on the module end
|
||||
./dont-allow-manual-luks.patch
|
||||
|
||||
# Don't create users - they're already created by the installer
|
||||
# FIXME: upstream this?
|
||||
./dont-create-users.patch
|
||||
|
||||
# Allow QML to write to GlobalStorage
|
||||
# FIXME: upstream this
|
||||
./let-qml-write-to-global-storage.patch
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
ninja
|
||||
kdePackages.extra-cmake-modules
|
||||
qt6.wrapQtAppsHook
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
kdePackages.kcoreaddons
|
||||
kdePackages.kcrash
|
||||
kdePackages.kpackage
|
||||
kdePackages.kparts
|
||||
kdePackages.kpmcore
|
||||
kdePackages.kservice
|
||||
kdePackages.libplasma
|
||||
libpwquality
|
||||
libxcrypt
|
||||
parted
|
||||
kdePackages.polkit-qt-1
|
||||
qt6.qtbase
|
||||
qt6.qttools
|
||||
yaml-cpp
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
# this is called via pkexec, which does not resolve symlinks, so the policy
|
||||
# needs to point at the symlinked path
|
||||
substituteInPlace io.calamares.calamares.policy \
|
||||
--replace-fail /usr/bin/calamares /run/current-system/sw/bin/calamares
|
||||
|
||||
substituteInPlace src/modules/locale/SetTimezoneJob.cpp src/libcalamares/locale/TimeZone.cpp \
|
||||
--replace-fail /usr/share/zoneinfo ${tzdata}/share/zoneinfo
|
||||
|
||||
substituteInPlace src/modules/keyboard/keyboardwidget/keyboardglobal.cpp \
|
||||
--replace-fail /usr/share/X11/xkb/rules/base.lst ${xkeyboard_config}/share/X11/xkb/rules/base.lst
|
||||
|
||||
substituteInPlace CMakeLists.txt \
|
||||
--replace-fail "\''${POLKITQT-1_POLICY_FILES_INSTALL_DIR}" "$out/share/polkit-1/actions"
|
||||
'';
|
||||
|
||||
separateDebugInfo = true;
|
||||
|
||||
qtWrapperArgs = [
|
||||
"--prefix PATH : ${
|
||||
lib.makeBinPath [
|
||||
ckbcomp
|
||||
os-prober
|
||||
util-linux
|
||||
]
|
||||
}"
|
||||
]
|
||||
++ lib.optionals nixos-extensions [
|
||||
"--prefix XDG_DATA_DIRS : ${calamares-nixos-extensions}/share"
|
||||
"--prefix XDG_CONFIG_DIRS : ${calamares-nixos-extensions}/etc"
|
||||
"--add-flag --xdg-config"
|
||||
];
|
||||
|
||||
passthru.tests = {
|
||||
inherit calamares-nixos;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Distribution-independent installer framework";
|
||||
homepage = "https://calamares.io/";
|
||||
license = with licenses; [
|
||||
gpl3Plus
|
||||
bsd2
|
||||
cc0
|
||||
];
|
||||
maintainers = with maintainers; [
|
||||
manveru
|
||||
vlinkz
|
||||
];
|
||||
platforms = platforms.linux;
|
||||
mainProgram = "calamares";
|
||||
};
|
||||
})
|
@ -1,60 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Victor Fuentes <vmfuentes64@gmail.com>
|
||||
Date: Thu, 1 Aug 2024 15:57:55 -0400
|
||||
Subject: [PATCH] Makes calamares search
|
||||
/run/current-system/sw/share/calamares/ for extra configuration files as by
|
||||
default it only searches /usr/share/calamares/ and
|
||||
/nix/store/<hash>-calamares-<version>/share/calamares/ but
|
||||
calamares-nixos-extensions is not in either of these locations
|
||||
|
||||
---
|
||||
src/calamares/main.cpp | 1 +
|
||||
src/libcalamares/utils/Dirs.cpp | 8 ++++++++
|
||||
src/libcalamares/utils/Dirs.h | 3 +++
|
||||
3 files changed, 12 insertions(+)
|
||||
|
||||
diff --git a/src/calamares/main.cpp b/src/calamares/main.cpp
|
||||
index e0491e5f9..faf272016 100644
|
||||
--- a/src/calamares/main.cpp
|
||||
+++ b/src/calamares/main.cpp
|
||||
@@ -132,6 +132,7 @@ main( int argc, char* argv[] )
|
||||
#endif
|
||||
|
||||
std::unique_ptr< KDSingleApplication > possiblyUnique;
|
||||
+ Calamares::setNixosDirs();
|
||||
const bool is_debug = handle_args( a );
|
||||
if ( !is_debug )
|
||||
{
|
||||
diff --git a/src/libcalamares/utils/Dirs.cpp b/src/libcalamares/utils/Dirs.cpp
|
||||
index c42768a08..dfce7eb5d 100644
|
||||
--- a/src/libcalamares/utils/Dirs.cpp
|
||||
+++ b/src/libcalamares/utils/Dirs.cpp
|
||||
@@ -114,6 +114,14 @@ setXdgDirs()
|
||||
s_haveExtraDirs = !( s_extraConfigDirs.isEmpty() && s_extraDataDirs.isEmpty() );
|
||||
}
|
||||
|
||||
+void
|
||||
+setNixosDirs()
|
||||
+{
|
||||
+ s_extraConfigDirs << "/run/current-system/sw/share/calamares/";
|
||||
+ s_extraDataDirs << "/run/current-system/sw/share/calamares/";
|
||||
+ s_haveExtraDirs = !( s_extraConfigDirs.isEmpty() && s_extraDataDirs.isEmpty() );
|
||||
+}
|
||||
+
|
||||
QStringList
|
||||
extraConfigDirs()
|
||||
{
|
||||
diff --git a/src/libcalamares/utils/Dirs.h b/src/libcalamares/utils/Dirs.h
|
||||
index d0edd7a4f..26bd16b4e 100644
|
||||
--- a/src/libcalamares/utils/Dirs.h
|
||||
+++ b/src/libcalamares/utils/Dirs.h
|
||||
@@ -50,6 +50,9 @@ DLLEXPORT bool isAppDataDirOverridden();
|
||||
/** @brief Setup extra config and data dirs from the XDG variables.
|
||||
*/
|
||||
DLLEXPORT void setXdgDirs();
|
||||
+/** @brief Setup extra config and data dirs fir NixOS.
|
||||
+ */
|
||||
+DLLEXPORT void setNixosDirs();
|
||||
/** @brief Are any extra directories configured? */
|
||||
DLLEXPORT bool haveExtraDirs();
|
||||
/** @brief XDG_CONFIG_DIRS, each guaranteed to end with / */
|
@ -1,119 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Victor Fuentes <vmfuentes64@gmail.com>
|
||||
Date: Thu, 1 Aug 2024 15:59:54 -0400
|
||||
Subject: [PATCH] Uses pkexec within modules in order to run calamares without
|
||||
root permissions as a whole.
|
||||
|
||||
Also fixes storage check in the welcome module
|
||||
---
|
||||
src/libcalamares/utils/Runner.cpp | 8 +++---
|
||||
src/modules/mount/main.py | 8 +++---
|
||||
.../welcome/checker/GeneralRequirements.cpp | 27 ++++++++++++++++++-
|
||||
.../welcome/checker/GeneralRequirements.h | 1 +
|
||||
4 files changed, 35 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/src/libcalamares/utils/Runner.cpp b/src/libcalamares/utils/Runner.cpp
|
||||
index f7872a7d0..a246ca110 100644
|
||||
--- a/src/libcalamares/utils/Runner.cpp
|
||||
+++ b/src/libcalamares/utils/Runner.cpp
|
||||
@@ -145,13 +145,13 @@ Calamares::Utils::Runner::run()
|
||||
}
|
||||
if ( m_location == RunLocation::RunInTarget )
|
||||
{
|
||||
- process.setProgram( "chroot" );
|
||||
- process.setArguments( QStringList { workingDirectory.absolutePath() } << m_command );
|
||||
+ process.setProgram( "pkexec" );
|
||||
+ process.setArguments( QStringList { "chroot" } + QStringList { workingDirectory.absolutePath() } << m_command );
|
||||
}
|
||||
else
|
||||
{
|
||||
- process.setProgram( "env" );
|
||||
- process.setArguments( m_command );
|
||||
+ process.setProgram( "pkexec" );
|
||||
+ process.setArguments( QStringList { "env" } + m_command );
|
||||
}
|
||||
|
||||
if ( m_output )
|
||||
diff --git a/src/modules/mount/main.py b/src/modules/mount/main.py
|
||||
index 4a16f8872..6d32916a5 100644
|
||||
--- a/src/modules/mount/main.py
|
||||
+++ b/src/modules/mount/main.py
|
||||
@@ -244,7 +244,7 @@ def mount_partition(root_mount_point, partition, partitions, mount_options, moun
|
||||
# Ensure that the created directory has the correct SELinux context on
|
||||
# SELinux-enabled systems.
|
||||
|
||||
- os.makedirs(mount_point, exist_ok=True)
|
||||
+ subprocess.check_call(["pkexec", "mkdir", "-p", mount_point])
|
||||
|
||||
try:
|
||||
subprocess.call(['chcon', '--reference=' + raw_mount_point, mount_point])
|
||||
@@ -288,13 +288,13 @@ def mount_partition(root_mount_point, partition, partitions, mount_options, moun
|
||||
for s in btrfs_subvolumes:
|
||||
if not s["subvolume"]:
|
||||
continue
|
||||
- os.makedirs(root_mount_point + os.path.dirname(s["subvolume"]), exist_ok=True)
|
||||
- subprocess.check_call(["btrfs", "subvolume", "create",
|
||||
+ subprocess.check_call(["pkexec", "mkdir", "-p", root_mount_point + os.path.dirname(s["subvolume"])])
|
||||
+ subprocess.check_call(["pkexec", "btrfs", "subvolume", "create",
|
||||
root_mount_point + s["subvolume"]])
|
||||
if s["mountPoint"] == "/":
|
||||
# insert the root subvolume into global storage
|
||||
libcalamares.globalstorage.insert("btrfsRootSubvolume", s["subvolume"])
|
||||
- subprocess.check_call(["umount", "-v", root_mount_point])
|
||||
+ subprocess.check_call(["pkexec", "umount", "-v", root_mount_point])
|
||||
|
||||
device = partition["device"]
|
||||
|
||||
diff --git a/src/modules/welcome/checker/GeneralRequirements.cpp b/src/modules/welcome/checker/GeneralRequirements.cpp
|
||||
index a58f3df83..b66576b09 100644
|
||||
--- a/src/modules/welcome/checker/GeneralRequirements.cpp
|
||||
+++ b/src/modules/welcome/checker/GeneralRequirements.cpp
|
||||
@@ -431,10 +431,35 @@ GeneralRequirements::checkEnoughStorage( qint64 requiredSpace )
|
||||
cWarning() << "GeneralRequirements is configured without libparted.";
|
||||
return false;
|
||||
#else
|
||||
- return check_big_enough( requiredSpace );
|
||||
+ return big_enough( requiredSpace );
|
||||
#endif
|
||||
}
|
||||
|
||||
+bool
|
||||
+GeneralRequirements::big_enough( qint64 requiredSpace )
|
||||
+{
|
||||
+ FILE *fpipe;
|
||||
+ char command[128];
|
||||
+ snprintf(command, sizeof(command), "lsblk --bytes -no SIZE,TYPE | grep disk | awk '$1 > %llu {print $1}'", requiredSpace);
|
||||
+ char c = 0;
|
||||
+
|
||||
+ if (0 == (fpipe = (FILE*)popen(command, "r")))
|
||||
+ {
|
||||
+ cWarning() << "Failed to check storage size.";
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ while (fread(&c, sizeof c, 1, fpipe))
|
||||
+ {
|
||||
+ pclose(fpipe);
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ pclose(fpipe);
|
||||
+
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
bool
|
||||
GeneralRequirements::checkEnoughRam( qint64 requiredRam )
|
||||
{
|
||||
diff --git a/src/modules/welcome/checker/GeneralRequirements.h b/src/modules/welcome/checker/GeneralRequirements.h
|
||||
index b6646da11..ea27324fa 100644
|
||||
--- a/src/modules/welcome/checker/GeneralRequirements.h
|
||||
+++ b/src/modules/welcome/checker/GeneralRequirements.h
|
||||
@@ -36,6 +36,7 @@ private:
|
||||
bool checkHasPower();
|
||||
bool checkHasInternet();
|
||||
bool checkIsRoot();
|
||||
+ bool big_enough( qint64 requiredSpace );
|
||||
|
||||
qreal m_requiredStorageGiB;
|
||||
qreal m_requiredRamGiB;
|
@ -1,122 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Victor Fuentes <vmfuentes64@gmail.com>
|
||||
Date: Thu, 1 Aug 2024 16:00:43 -0400
|
||||
Subject: [PATCH] Adds unfree qml to packagechooserq
|
||||
|
||||
---
|
||||
.../packagechooserq/packagechooserq.qrc | 1 +
|
||||
.../packagechooserq@unfree.qml | 75 +++++++++++++++++++
|
||||
src/modules/packagechooserq/unfree.conf | 11 +++
|
||||
3 files changed, 87 insertions(+)
|
||||
create mode 100644 src/modules/packagechooserq/packagechooserq@unfree.qml
|
||||
create mode 100644 src/modules/packagechooserq/unfree.conf
|
||||
|
||||
diff --git a/src/modules/packagechooserq/packagechooserq.qrc b/src/modules/packagechooserq/packagechooserq.qrc
|
||||
index 1b892dce1..ee80a934b 100644
|
||||
--- a/src/modules/packagechooserq/packagechooserq.qrc
|
||||
+++ b/src/modules/packagechooserq/packagechooserq.qrc
|
||||
@@ -4,5 +4,6 @@
|
||||
<file>images/libreoffice.jpg</file>
|
||||
<file>images/no-selection.png</file>
|
||||
<file>images/plasma.png</file>
|
||||
+ <file>packagechooserq@unfree.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
diff --git a/src/modules/packagechooserq/packagechooserq@unfree.qml b/src/modules/packagechooserq/packagechooserq@unfree.qml
|
||||
new file mode 100644
|
||||
index 000000000..5e36d77d9
|
||||
--- /dev/null
|
||||
+++ b/src/modules/packagechooserq/packagechooserq@unfree.qml
|
||||
@@ -0,0 +1,75 @@
|
||||
+/* === This file is part of Calamares - <https://calamares.io> ===
|
||||
+ *
|
||||
+ * SPDX-FileCopyrightText: 2021 Anke Boersma <demm@kaosx.us>
|
||||
+ * SPDX-License-Identifier: GPL-3.0-or-later
|
||||
+ *
|
||||
+ * Calamares is Free Software: see the License-Identifier above.
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+import io.calamares.core 1.0
|
||||
+import io.calamares.ui 1.0
|
||||
+
|
||||
+import QtQuick 2.15
|
||||
+import QtQuick.Controls 2.15
|
||||
+import QtQuick.Layouts 1.3
|
||||
+
|
||||
+Item {
|
||||
+
|
||||
+ SystemPalette {
|
||||
+ id: palette
|
||||
+ colorGroup: SystemPalette.Active
|
||||
+ }
|
||||
+
|
||||
+ width: parent.width
|
||||
+ height: parent.height
|
||||
+
|
||||
+ Rectangle {
|
||||
+ anchors.fill: parent
|
||||
+ color: palette.window
|
||||
+
|
||||
+ ButtonGroup {
|
||||
+ id: switchGroup
|
||||
+ }
|
||||
+
|
||||
+ Column {
|
||||
+ id: column
|
||||
+ anchors.centerIn: parent
|
||||
+ spacing: 5
|
||||
+
|
||||
+ Rectangle {
|
||||
+ width: 700
|
||||
+ height: 250
|
||||
+ color: palette.base
|
||||
+ radius: 10
|
||||
+ border.width: 0
|
||||
+ Text {
|
||||
+ color: palette.text
|
||||
+ width: 600
|
||||
+ height: 200
|
||||
+ anchors.centerIn: parent
|
||||
+ text: qsTr("NixOS is fully open source, but it also provides optional software packages that do not respect users' freedom to run, copy, distribute, study, change and improve the software, and are commonly not open source. By default such \"unfree\" packages are not allowed, but you can enable it here. If you check this box, you agree that unfree software may be installed which might have additional End User License Agreements (EULAs) that you need to agree to. If not enabled, some hardware (notably Nvidia GPUs and some WiFi chips) might not work or not work optimally.<br/>")
|
||||
+ font.pointSize: 12
|
||||
+ wrapMode: Text.WordWrap
|
||||
+ }
|
||||
+
|
||||
+ CheckBox {
|
||||
+ id: element2
|
||||
+ anchors.horizontalCenter: parent.horizontalCenter
|
||||
+ y: 190
|
||||
+ text: qsTr("Allow unfree software")
|
||||
+ checked: false
|
||||
+
|
||||
+ onCheckedChanged: {
|
||||
+ if ( checked ) {
|
||||
+ config.packageChoice = "unfree"
|
||||
+ } else {
|
||||
+ config.packageChoice = "free"
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+}
|
||||
diff --git a/src/modules/packagechooserq/unfree.conf b/src/modules/packagechooserq/unfree.conf
|
||||
new file mode 100644
|
||||
index 000000000..da79a8eac
|
||||
--- /dev/null
|
||||
+++ b/src/modules/packagechooserq/unfree.conf
|
||||
@@ -0,0 +1,11 @@
|
||||
+# SPDX-FileCopyrightText: no
|
||||
+# SPDX-License-Identifier: CC0-1.0
|
||||
+#
|
||||
+---
|
||||
+qmlLabel:
|
||||
+ label: "Unfree Software"
|
||||
+method: legacy
|
||||
+mode: required
|
||||
+labels:
|
||||
+ step: "Unfree Software"
|
||||
+packageChoice: free
|
@ -1,100 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Victor Fuentes <vmfuentes64@gmail.com>
|
||||
Date: Thu, 1 Aug 2024 16:01:53 -0400
|
||||
Subject: [PATCH] Modifies finished module to add some NixOS resources.
|
||||
|
||||
Modifies packagechooser module to change the UI.
|
||||
---
|
||||
src/modules/finished/FinishedPage.cpp | 12 +++++---
|
||||
.../packagechooser/PackageChooserPage.cpp | 1 +
|
||||
src/modules/packagechooser/page_package.ui | 28 +++++++++----------
|
||||
3 files changed, 23 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/src/modules/finished/FinishedPage.cpp b/src/modules/finished/FinishedPage.cpp
|
||||
index 51be52678..307607232 100644
|
||||
--- a/src/modules/finished/FinishedPage.cpp
|
||||
+++ b/src/modules/finished/FinishedPage.cpp
|
||||
@@ -74,8 +74,10 @@ FinishedPage::retranslate()
|
||||
{
|
||||
ui->mainText->setText( tr( "<h1>All done.</h1><br/>"
|
||||
"%1 has been set up on your computer.<br/>"
|
||||
- "You may now start using your new system.",
|
||||
- "@info" )
|
||||
+ "You may now start using your new system.<br/>"
|
||||
+ "You can change every setting later except the bootloader.<br/>"
|
||||
+ "Check the <a href=\"https://nixos.org/manual/nixos/stable/\">manual</a> for instructions on how to install software, upgrade the system or enable services.<br/>"
|
||||
+ "You can find ways to get in touch with the <a href=\"https://nixos.org/community/\">community on the website!</a>", "@info" )
|
||||
.arg( branding->versionedName() ) );
|
||||
ui->restartCheckBox->setToolTip( tr( "<html><head/><body>"
|
||||
"<p>When this box is checked, your system will "
|
||||
@@ -89,8 +91,10 @@ FinishedPage::retranslate()
|
||||
ui->mainText->setText( tr( "<h1>All done.</h1><br/>"
|
||||
"%1 has been installed on your computer.<br/>"
|
||||
"You may now restart into your new system, or continue "
|
||||
- "using the %2 Live environment.",
|
||||
- "@info" )
|
||||
+ "using the %2 Live environment.<br/>"
|
||||
+ "You can change every setting later except the bootloader.<br/>"
|
||||
+ "Check the <a href=\"https://nixos.org/manual/nixos/stable/\">manual</a> for instructions on how to install software, upgrade the system or enable services.<br/>"
|
||||
+ "You can find ways to get in touch with the <a href=\"https://nixos.org/community/\">community on the website!</a>", "@info" )
|
||||
.arg( branding->versionedName(), branding->productName() ) );
|
||||
ui->restartCheckBox->setToolTip( tr( "<html><head/><body>"
|
||||
"<p>When this box is checked, your system will "
|
||||
diff --git a/src/modules/packagechooser/PackageChooserPage.cpp b/src/modules/packagechooser/PackageChooserPage.cpp
|
||||
index 44a570d2f..4dc931bf3 100644
|
||||
--- a/src/modules/packagechooser/PackageChooserPage.cpp
|
||||
+++ b/src/modules/packagechooser/PackageChooserPage.cpp
|
||||
@@ -52,6 +52,7 @@ PackageChooserPage::currentChanged( const QModelIndex& index )
|
||||
if ( !index.isValid() || !ui->products->selectionModel()->hasSelection() )
|
||||
{
|
||||
ui->productName->setText( m_introduction.name.get() );
|
||||
+ ui->productName->setStyleSheet("font-weight: bold");
|
||||
ui->productScreenshot->setPixmap( m_introduction.screenshot );
|
||||
ui->productDescription->setText( m_introduction.description.get() );
|
||||
}
|
||||
diff --git a/src/modules/packagechooser/page_package.ui b/src/modules/packagechooser/page_package.ui
|
||||
index 2ab5b7f13..bed462069 100644
|
||||
--- a/src/modules/packagechooser/page_package.ui
|
||||
+++ b/src/modules/packagechooser/page_package.ui
|
||||
@@ -37,20 +37,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
- <layout class="QVBoxLayout" name="verticalLayout" stretch="1,30,1">
|
||||
- <item>
|
||||
- <widget class="QLabel" name="productName">
|
||||
- <property name="sizePolicy">
|
||||
- <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
|
||||
- <horstretch>0</horstretch>
|
||||
- <verstretch>0</verstretch>
|
||||
- </sizepolicy>
|
||||
- </property>
|
||||
- <property name="text">
|
||||
- <string>Product Name</string>
|
||||
- </property>
|
||||
- </widget>
|
||||
- </item>
|
||||
+ <layout class="QVBoxLayout" name="verticalLayout" stretch="30,1,1">
|
||||
<item>
|
||||
<widget class="FixedAspectRatioLabel" name="productScreenshot">
|
||||
<property name="sizePolicy">
|
||||
@@ -67,6 +54,19 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
+ <item>
|
||||
+ <widget class="QLabel" name="productName">
|
||||
+ <property name="sizePolicy">
|
||||
+ <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
|
||||
+ <horstretch>0</horstretch>
|
||||
+ <verstretch>0</verstretch>
|
||||
+ </sizepolicy>
|
||||
+ </property>
|
||||
+ <property name="text">
|
||||
+ <string>Product Name</string>
|
||||
+ </property>
|
||||
+ </widget>
|
||||
+ </item>
|
||||
<item>
|
||||
<widget class="QLabel" name="productDescription">
|
||||
<property name="sizePolicy">
|
@ -1,35 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Victor Fuentes <vmfuentes64@gmail.com>
|
||||
Date: Thu, 31 Oct 2024 10:34:25 -0700
|
||||
Subject: [PATCH] Fix setting the kayboard layout on GNOME wayland.
|
||||
|
||||
By default the module uses the setxkbmap, which will not change the
|
||||
keyboard
|
||||
---
|
||||
src/modules/keyboard/Config.cpp | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/src/modules/keyboard/Config.cpp b/src/modules/keyboard/Config.cpp
|
||||
index 54ee7649c..60fe2d7d0 100644
|
||||
--- a/src/modules/keyboard/Config.cpp
|
||||
+++ b/src/modules/keyboard/Config.cpp
|
||||
@@ -306,6 +306,10 @@ Config::applyXkb()
|
||||
m_additionalLayoutInfo.groupSwitcher ) );
|
||||
QProcess::execute( "setxkbmap", basicArguments );
|
||||
|
||||
+ QString xkbmap = QString( "[('xkb','%1\%2'),('xkb','%3\%4')]").arg(
|
||||
+ m_selectedLayout, ((!m_selectedVariant.isEmpty()) ? "+" + m_selectedVariant : ""),
|
||||
+ m_additionalLayoutInfo.additionalLayout, ((!m_additionalLayoutInfo.additionalVariant.isEmpty()) ? "+" + m_additionalLayoutInfo.additionalVariant : ""));
|
||||
+ QProcess::execute( "sh", { "-c", "if command -v gsettings; then gsettings set org.gnome.desktop.input-sources sources \"$0\"; fi", xkbmap });
|
||||
cDebug() << "xkbmap selection changed to: " << m_selectedLayout << '-' << m_selectedVariant << "(added "
|
||||
<< m_additionalLayoutInfo.additionalLayout << "-" << m_additionalLayoutInfo.additionalVariant
|
||||
<< " since current layout is not ASCII-capable)";
|
||||
@@ -314,6 +318,8 @@ Config::applyXkb()
|
||||
{
|
||||
basicArguments.append( xkbmap_layout_args( m_selectedLayout, m_selectedVariant ) );
|
||||
QProcess::execute( "setxkbmap", basicArguments );
|
||||
+ QString xkbmap = QString( "[('xkb','%1\%2')]").arg( m_selectedLayout, ((!m_selectedVariant.isEmpty()) ? "+" + m_selectedVariant : "") );
|
||||
+ QProcess::execute( "sh", { "-c", "if command -v gsettings; then gsettings set org.gnome.desktop.input-sources sources \"$0\"; fi", xkbmap });
|
||||
cDebug() << "xkbmap selection changed to: " << m_selectedLayout << '-' << m_selectedVariant;
|
||||
}
|
||||
m_applyTimer.stop();
|
@ -1,22 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Victor Fuentes <vmfuentes64@gmail.com>
|
||||
Date: Thu, 1 Aug 2024 16:03:53 -0400
|
||||
Subject: [PATCH] Change default location where calamares searches for locales
|
||||
|
||||
---
|
||||
src/modules/locale/Config.cpp | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/modules/locale/Config.cpp b/src/modules/locale/Config.cpp
|
||||
index 8fa17a768..79b5419b6 100644
|
||||
--- a/src/modules/locale/Config.cpp
|
||||
+++ b/src/modules/locale/Config.cpp
|
||||
@@ -48,7 +48,7 @@ loadLocales( const QString& localeGenPath )
|
||||
// supported locales. We first try that one, and if it doesn't exist, we fall back
|
||||
// to parsing the lines from locale.gen
|
||||
localeGenLines.clear();
|
||||
- QFile supported( "/usr/share/i18n/SUPPORTED" );
|
||||
+ QFile supported( "/run/current-system/sw/share/i18n/SUPPORTED" );
|
||||
QByteArray ba;
|
||||
|
||||
if ( supported.exists() && supported.open( QIODevice::ReadOnly | QIODevice::Text ) )
|
@ -1,144 +0,0 @@
|
||||
{
|
||||
lib,
|
||||
fetchurl,
|
||||
boost,
|
||||
cmake,
|
||||
extra-cmake-modules,
|
||||
kparts,
|
||||
kpmcore,
|
||||
kirigami2,
|
||||
kservice,
|
||||
libatasmart,
|
||||
libxcb,
|
||||
yaml-cpp,
|
||||
libpwquality,
|
||||
parted,
|
||||
polkit-qt,
|
||||
python3,
|
||||
qtbase,
|
||||
qtquickcontrols,
|
||||
qtsvg,
|
||||
qttools,
|
||||
qtwebengine,
|
||||
util-linux,
|
||||
tzdata,
|
||||
ckbcomp,
|
||||
xkeyboard_config,
|
||||
mkDerivation,
|
||||
nixos-extensions ? false,
|
||||
# passthru.tests
|
||||
calamares-nixos,
|
||||
}:
|
||||
|
||||
mkDerivation rec {
|
||||
pname = "calamares";
|
||||
version = "3.3.13";
|
||||
|
||||
# release including submodule
|
||||
src = fetchurl {
|
||||
url = "https://github.com/calamares/calamares/releases/download/v${version}/calamares-${version}.tar.gz";
|
||||
sha256 = "sha256-5Jz32JTgK6BImM0HcMtXi04k39CAirdmC/lbskVmSNQ=";
|
||||
};
|
||||
|
||||
# On major changes, or when otherwise required, you *must* :
|
||||
# 1. reformat the patches,
|
||||
# 2. `git am path/to/00*.patch` them into a calamares worktree,
|
||||
# 3. rebase to the more recent calamares version,
|
||||
# 4. and export the patches again via
|
||||
# `git -c format.signoff=false format-patch v${version} --no-numbered --zero-commit --no-signature`.
|
||||
patches = lib.optionals nixos-extensions [
|
||||
./0001-Modifies-the-users-module-to-only-set-passwords-of-u.patch
|
||||
./0002-Makes-calamares-search-run-current-system-sw-share-c.patch
|
||||
./0003-Uses-pkexec-within-modules-in-order-to-run-calamares.patch
|
||||
./0004-Adds-unfree-qml-to-packagechooserq.patch
|
||||
./0005-Modifies-finished-module-to-add-some-NixOS-resources.patch
|
||||
./0006-Remove-options-for-unsupported-partition-types.patch
|
||||
./0007-Fix-setting-the-kayboard-layout-on-GNOME-wayland.patch
|
||||
./0008-Change-default-location-where-calamares-searches-for.patch
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
extra-cmake-modules
|
||||
];
|
||||
buildInputs = [
|
||||
boost
|
||||
kparts.dev
|
||||
kpmcore.out
|
||||
kservice.dev
|
||||
kirigami2
|
||||
libatasmart
|
||||
libxcb
|
||||
yaml-cpp
|
||||
libpwquality
|
||||
parted
|
||||
polkit-qt
|
||||
python3
|
||||
qtbase
|
||||
qtquickcontrols
|
||||
qtsvg
|
||||
qttools
|
||||
qtwebengine.dev
|
||||
util-linux
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DPYTHON_LIBRARY=${python3}/lib/lib${python3.libPrefix}.so"
|
||||
"-DPYTHON_INCLUDE_DIR=${python3}/include/${python3.libPrefix}"
|
||||
"-DCMAKE_VERBOSE_MAKEFILE=True"
|
||||
"-DWITH_PYTHONQT:BOOL=ON"
|
||||
];
|
||||
|
||||
POLKITQT-1_POLICY_FILES_INSTALL_DIR = "$(out)/share/polkit-1/actions";
|
||||
|
||||
postPatch = ''
|
||||
# Run calamares without root. Other patches make it functional as a normal user
|
||||
sed -e "s,pkexec calamares,calamares -D6," \
|
||||
-i calamares.desktop
|
||||
|
||||
sed -e "s,X-AppStream-Ignore=true,&\nStartupWMClass=calamares," \
|
||||
-i calamares.desktop
|
||||
|
||||
# Fix desktop reference with wayland
|
||||
mv calamares.desktop io.calamares.calamares.desktop
|
||||
|
||||
sed -e "s,calamares.desktop,io.calamares.calamares.desktop," \
|
||||
-i CMakeLists.txt
|
||||
|
||||
sed -e "s,/usr/bin/calamares,$out/bin/calamares," \
|
||||
-i com.github.calamares.calamares.policy
|
||||
|
||||
sed -e 's,/usr/share/zoneinfo,${tzdata}/share/zoneinfo,' \
|
||||
-i src/modules/locale/SetTimezoneJob.cpp \
|
||||
-i src/libcalamares/locale/TimeZone.cpp
|
||||
|
||||
sed -e 's,/usr/share/X11/xkb/rules/base.lst,${xkeyboard_config}/share/X11/xkb/rules/base.lst,' \
|
||||
-i src/modules/keyboard/keyboardwidget/keyboardglobal.cpp
|
||||
|
||||
sed -e 's,"ckbcomp","${ckbcomp}/bin/ckbcomp",' \
|
||||
-i src/modules/keyboard/keyboardwidget/keyboardpreview.cpp
|
||||
|
||||
sed "s,\''${POLKITQT-1_POLICY_FILES_INSTALL_DIR},''${out}/share/polkit-1/actions," \
|
||||
-i CMakeLists.txt
|
||||
'';
|
||||
|
||||
passthru.tests = {
|
||||
inherit calamares-nixos;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Distribution-independent installer framework";
|
||||
homepage = "https://calamares.io/";
|
||||
license = with licenses; [
|
||||
gpl3Plus
|
||||
bsd2
|
||||
cc0
|
||||
];
|
||||
maintainers = with maintainers; [
|
||||
manveru
|
||||
vlinkz
|
||||
];
|
||||
platforms = platforms.linux;
|
||||
mainProgram = "calamares";
|
||||
};
|
||||
}
|
@ -1904,12 +1904,6 @@ with pkgs;
|
||||
'';
|
||||
});
|
||||
|
||||
calamares = libsForQt5.callPackage ../tools/misc/calamares {
|
||||
boost = boost.override {
|
||||
enablePython = true;
|
||||
python = python3;
|
||||
};
|
||||
};
|
||||
calamares-nixos = lowPrio (calamares.override { nixos-extensions = true; });
|
||||
candle = libsForQt5.callPackage ../applications/misc/candle { };
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user