calamares: 3.3.13 -> 3.4.0, qt6-ize, clean up, move to by-name

K900 fb7d7c5f 917eb19a

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