commit
ee7e3f30f3
@ -0,0 +1,59 @@ |
||||
# This module defines a NixOS installation CD that contains GNOME. |
||||
|
||||
{ pkgs, ... }: |
||||
|
||||
{ |
||||
imports = [ ./installation-cd-graphical-calamares.nix ]; |
||||
|
||||
isoImage.edition = "gnome"; |
||||
|
||||
services.xserver.desktopManager.gnome = { |
||||
# 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' ] |
||||
''; |
||||
|
||||
# Override GNOME defaults to disable GNOME tour and disable suspend |
||||
extraGSettingsOverrides = '' |
||||
[org.gnome.shell] |
||||
welcome-dialog-last-shown-version='9999999999' |
||||
|
||||
[org.gnome.settings-daemon.plugins.power] |
||||
sleep-inactive-ac-type='nothing' |
||||
sleep-inactive-battery-type='nothing' |
||||
''; |
||||
|
||||
extraGSettingsOverridePackages = [ pkgs.gnome.gnome-settings-daemon ]; |
||||
|
||||
enable = true; |
||||
}; |
||||
|
||||
# Theme calamares with GNOME theme |
||||
qt5 = { |
||||
enable = true; |
||||
platformTheme = "gnome"; |
||||
}; |
||||
|
||||
# Fix scaling for calamares on wayland |
||||
environment.variables = { |
||||
QT_QPA_PLATFORM = "$([[ $XDG_SESSION_TYPE = \"wayland\" ]] && echo \"wayland\")"; |
||||
}; |
||||
|
||||
services.xserver.displayManager = { |
||||
gdm = { |
||||
enable = true; |
||||
# autoSuspend makes the machine automatically suspend after inactivity. |
||||
# It's possible someone could/try to ssh'd into the machine and obviously |
||||
# have issues because it's inactive. |
||||
# See: |
||||
# * https://github.com/NixOS/nixpkgs/pull/63790 |
||||
# * https://gitlab.gnome.org/GNOME/gnome-control-center/issues/22 |
||||
autoSuspend = false; |
||||
}; |
||||
autoLogin = { |
||||
enable = true; |
||||
user = "nixos"; |
||||
}; |
||||
}; |
||||
} |
@ -0,0 +1,49 @@ |
||||
# This module defines a NixOS installation CD that contains X11 and |
||||
# Plasma 5. |
||||
|
||||
{ pkgs, ... }: |
||||
|
||||
{ |
||||
imports = [ ./installation-cd-graphical-calamares.nix ]; |
||||
|
||||
isoImage.edition = "plasma5"; |
||||
|
||||
services.xserver = { |
||||
desktopManager.plasma5 = { |
||||
enable = true; |
||||
}; |
||||
|
||||
# Automatically login as nixos. |
||||
displayManager = { |
||||
sddm.enable = true; |
||||
autoLogin = { |
||||
enable = true; |
||||
user = "nixos"; |
||||
}; |
||||
}; |
||||
}; |
||||
|
||||
environment.systemPackages = with pkgs; [ |
||||
# Graphical text editor |
||||
kate |
||||
]; |
||||
|
||||
system.activationScripts.installerDesktop = let |
||||
|
||||
# Comes from documentation.nix when xserver and nixos.enable are true. |
||||
manualDesktopFile = "/run/current-system/sw/share/applications/nixos-manual.desktop"; |
||||
|
||||
homeDir = "/home/nixos/"; |
||||
desktopDir = homeDir + "Desktop/"; |
||||
|
||||
in '' |
||||
mkdir -p ${desktopDir} |
||||
chown nixos ${homeDir} ${desktopDir} |
||||
|
||||
ln -sfT ${manualDesktopFile} ${desktopDir + "nixos-manual.desktop"} |
||||
ln -sfT ${pkgs.gparted}/share/applications/gparted.desktop ${desktopDir + "gparted.desktop"} |
||||
ln -sfT ${pkgs.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"} |
||||
''; |
||||
|
||||
} |
@ -0,0 +1,20 @@ |
||||
# This module adds the calamares installer to the basic graphical NixOS |
||||
# installation CD. |
||||
|
||||
{ pkgs, ... }: |
||||
let |
||||
calamares-nixos-autostart = pkgs.makeAutostartItem { name = "io.calamares.calamares"; package = pkgs.calamares-nixos; }; |
||||
in |
||||
{ |
||||
imports = [ ./installation-cd-graphical-base.nix ]; |
||||
|
||||
environment.systemPackages = with pkgs; [ |
||||
# Calamares for graphical installation |
||||
libsForQt5.kpmcore |
||||
calamares-nixos |
||||
calamares-nixos-autostart |
||||
calamares-nixos-extensions |
||||
# Needed for calamares QML module packagechooserq |
||||
libsForQt5.full |
||||
]; |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,57 @@ |
||||
# This hook automatically finds Sphinx documentation, builds it in html format |
||||
# and installs it. |
||||
# |
||||
# This hook knows about several popular locations in which subdirectory |
||||
# documentation may be, but in very unusual cases $sphinxRoot directory can be |
||||
# set explicitly. |
||||
# |
||||
# Name of the directory relative to ${doc:-$out}/share/doc is normally also |
||||
# deduced automatically, but can be overridden with $sphinxOutdir variable. |
||||
# |
||||
# Sphinx build system can depend on arbitrary amount of python modules, client |
||||
# code is responsible for ensuring that all dependencies are present. |
||||
|
||||
buildSphinxPhase() { |
||||
local __sphinxRoot="" o |
||||
|
||||
runHook preBuildSphinx |
||||
if [[ -n "${sphinxRoot:-}" ]] ; then # explicit root |
||||
if ! [[ -f "${sphinxRoot}/conf.py" ]] ; then |
||||
echo 2>&1 "$sphinxRoot/conf.py: no such file" |
||||
exit 1 |
||||
fi |
||||
__sphinxRoot=$sphinxRoot |
||||
else |
||||
for o in doc docs doc/source docs/source ; do |
||||
if [[ -f "$o/conf.py" ]] ; then |
||||
echo "Sphinx documentation found in $o" |
||||
__sphinxRoot=$o |
||||
break |
||||
fi |
||||
done |
||||
fi |
||||
|
||||
if [[ -z "${__sphinxRoot}" ]] ; then |
||||
echo 2>&1 "Sphinx documentation not found, use 'sphinxRoot' variable" |
||||
exit 1 |
||||
fi |
||||
sphinx-build -M html "${__sphinxRoot}" ".sphinx/html" -v |
||||
|
||||
runHook postBuildSphinx |
||||
} |
||||
|
||||
installSphinxPhase() { |
||||
local docdir="" |
||||
runHook preInstallSphinx |
||||
|
||||
docdir="${doc:-$out}/share/doc/${sphinxOutdir:-$name}" |
||||
mkdir -p "$docdir" |
||||
|
||||
cp -r .sphinx/html/html "$docdir/" |
||||
rm -fr "${docdir}/html/_sources" "${docdir}/html/.buildinfo" |
||||
|
||||
runHook postInstallSphinx |
||||
} |
||||
|
||||
preBuildPhases+=" buildSphinxPhase" |
||||
postPhases+=" installSphinxPhase" |
@ -1,25 +0,0 @@ |
||||
# Generated by bower2nix v3.2.0 (https://github.com/rvl/bower2nix) |
||||
{ fetchbower, buildEnv }: |
||||
buildEnv { name = "bower-env"; ignoreCollisions = true; paths = [ |
||||
(fetchbower "uchiwa-web" "1.7.0" "1.7.0" "1qn09j3a1ngqn36rhz7a2dj00szr0r6fjb40lfbmq3drkzppgbm1") |
||||
(fetchbower "angular" "1.6.10" "~1.6.3" "0ag8xddsgxx5yka4wjq4ala4y6z3x2g1vc3x7a1n291fzz26p7ws") |
||||
(fetchbower "angular-bootstrap" "2.2.0" "~2.2.0" "11r2nlwp6xrim2y6lnrr8v064mx3bmlxchqpg1i803v9zxz3q53d") |
||||
(fetchbower "angular-cookies" "1.6.10" "~1.6.3" "0bjgmz5jnw06dfxhq9sajj62fk0b3v4j9p7nb45x8bl8rzkf25pn") |
||||
(fetchbower "angular-gravatar" "0.4.2" "~0.4.2" "14jrzvjwx64awh9z95054manp8qd57fvinqhmakipz5x12i7qrwi") |
||||
(fetchbower "angular-moment" "1.0.1" "~1.0.1" "0zkn52s9l15d6b5zfx52g5jpib23rpb637m0p1hzc429w5bbl0rj") |
||||
(fetchbower "angular-resource" "1.6.10" "~1.6.3" "1gplq8kd49qakk7ardg5xr5amwvspaz9n71kf8x49xfllda61rm0") |
||||
(fetchbower "angular-route" "1.6.10" "~1.6.3" "0vwbn7i45yvsn8c469nj141ahrn7iw85j7hy3vvhh2r373j94mai") |
||||
(fetchbower "angular-sanitize" "1.6.10" "~1.6.3" "066gsdl19s27w00wafg2skf5abdsdrlzhkcagkk1ma39dyqyl4i3") |
||||
(fetchbower "angular-toastr" "1.6.0" "1.6.0" "1szigf1m28bgpfyg8hbm5rffr5zi7wr9n73nc1fqhk0yqh7gzysh") |
||||
(fetchbower "angular-tools/ng-jsoneditor" "ea138469f157d8f2b54ec5b8dcf4b08a55b61459" "ea138469f157d8f2b54ec5b8dcf4b08a55b61459" "1j3vysr01niabc9fxcpixhcq1lyx2fr4q4wpmxhmiqki431h9hq8") |
||||
(fetchbower "angular-ua-parser" "0.0.2" "0.0.2" "0gb0vmwksnydlm6hklfq1n4ak2967wcmnx3cx9cgiv7v7vk3w2m9") |
||||
(fetchbower "bootstrap" "3.1.1" "3.1.1" "1a06mx1rw5h4wq89kqpa8g2pbiddm3p21dxq50jyi29sywd01ny4") |
||||
(fetchbower "bootstrap-sass-official" "3.1.1" "3.1.1" "1k6hhvsd75hdfrz8qcjzmb12c17fdn0h3l3l5k9wgd0rfhhfkyvd") |
||||
(fetchbower "fontawesome" "4.4.0" "~4.4.0" "09mrbik8i3skjwchn7ns2020bqmb51kbd3mqi59vh444s4az2sc7") |
||||
(fetchbower "highlightjs" "9.1.0" "~9.1.0" "0ld1da3h416a5j8v3v50rrpm4xwvvq8k8y2vwncvaqm9cqddz4s3") |
||||
(fetchbower "moment" "2.16.0" "~2.16.0" "1mji892i60f2aw3vhl6878acrcgh0ycn3r4af0ivnjf8az2b9n71") |
||||
(fetchbower "moment-picker" "0.9.11" "~0.9.7" "0p2g6rp2kcixydrga9lfihg4bxb598rvpi8n8l59mp549diy7vsb") |
||||
(fetchbower "ua-parser-js" "0.7.20" "~0.7.12" "18r0islba6cwkvx4s2gna7skhsn2vqjcf1xyap5pcmycjnq93j8s") |
||||
(fetchbower "jsoneditor" "5.5.11" "~5.5.10" "1gfsf8jqnd3hb3r9s9246mg40iqxk2ix8k4bjnrsbfmg6cd3xw6x") |
||||
(fetchbower "jquery" "3.4.1" ">= 1.9.0" "1vk25pbc55m2c82mqf26rfhxhnliq18isi4vbm4p98a1b9vp8fq7") |
||||
]; } |
@ -1,53 +0,0 @@ |
||||
{ lib, stdenv, fetchFromGitHub, buildBowerComponents, buildGoPackage, makeWrapper }: |
||||
|
||||
let |
||||
inherit (import ./src.nix) version sha256; |
||||
owner = "sensu"; |
||||
repo = "uchiwa"; |
||||
|
||||
src = fetchFromGitHub { |
||||
inherit owner repo sha256; |
||||
rev = version; |
||||
}; |
||||
|
||||
backend = buildGoPackage { |
||||
pname = "uchiwa-backend"; |
||||
inherit version; |
||||
goPackagePath = "github.com/${owner}/${repo}"; |
||||
inherit src; |
||||
postInstall = '' |
||||
mkdir -p $out |
||||
cp go/src/github.com/sensu/uchiwa/public/index.html $out/ |
||||
''; |
||||
}; |
||||
|
||||
frontend = buildBowerComponents { |
||||
name = "uchiwa-frontend-${version}"; |
||||
generated = ./bower-packages.nix; |
||||
inherit src; |
||||
}; |
||||
|
||||
in stdenv.mkDerivation { |
||||
pname = "uchiwa"; |
||||
inherit version; |
||||
|
||||
inherit src; |
||||
|
||||
nativeBuildInputs = [ makeWrapper ]; |
||||
|
||||
buildCommand = '' |
||||
mkdir -p $out/bin $out/public |
||||
makeWrapper ${backend}/bin/uchiwa $out/bin/uchiwa \ |
||||
--add-flags "-p $out/public" |
||||
ln -s ${backend.out}/index.html $out/public/index.html |
||||
ln -s ${frontend.out}/bower_components $out/public/bower_components |
||||
''; |
||||
|
||||
meta = with lib; { |
||||
description = "A Dashboard for the sensu monitoring framework"; |
||||
homepage = "http://sensuapp.org/"; |
||||
license = licenses.mit; |
||||
maintainers = with maintainers; [ peterhoeg ]; |
||||
platforms = platforms.unix; |
||||
}; |
||||
} |
@ -1,4 +0,0 @@ |
||||
{ |
||||
version = "1.7.0-1"; |
||||
sha256 = "0fa3zzh6d8v1lfn828s0x65pcknycwyv0d1mndi0gvdfbfg463nf"; |
||||
} |
@ -1,42 +0,0 @@ |
||||
#!/usr/bin/env nix-shell |
||||
#!nix-shell -i bash -p curl.bin git.out nix jq.out nodePackages.bower2nix |
||||
|
||||
set -euo pipefail |
||||
IFS=$'\n\t' |
||||
|
||||
# set -x |
||||
|
||||
REPO=sensu/uchiwa |
||||
VERSION=0.0.1 |
||||
SHA="1111111111111111111111111111111111111111111111111111" |
||||
DIR=$(pwd) |
||||
|
||||
write_src() { |
||||
cat <<_EOF > $DIR/src.nix |
||||
{ |
||||
version = "${VERSION}"; |
||||
sha256 = "${SHA}"; |
||||
} |
||||
_EOF |
||||
} |
||||
|
||||
LATEST_VERSION=$(curl https://api.github.com/repos/${REPO}/tags -s | jq '.[0]' -r | jq .name -r) |
||||
echo "Latest version: ${LATEST_VERSION}" |
||||
|
||||
VERSION=${1:-${LATEST_VERSION}} |
||||
echo "Updating to: ${VERSION}" |
||||
|
||||
TOP=$(git rev-parse --show-toplevel) |
||||
|
||||
cd $(dirname $0) |
||||
|
||||
write_src |
||||
pushd $TOP >/dev/null |
||||
SHA=$(nix-prefetch-url -A uchiwa.src) |
||||
popd >/dev/null |
||||
write_src |
||||
|
||||
curl https://raw.githubusercontent.com/${REPO}/${VERSION}/bower.json -s > bower.json |
||||
rm -f bower-packages.nix |
||||
bower2nix bower.json $DIR/bower-packages.nix |
||||
rm -f bower.json |
@ -0,0 +1,10 @@ |
||||
[Desktop Entry] |
||||
Categories=Utility; |
||||
Comment=Tool to create bootable USB drive for ISO/WIM/IMG/VHD(x)/EFI files |
||||
Exec=ventoy-gui |
||||
Hidden=false |
||||
Icon=VentoyLogo |
||||
Name=Ventoy |
||||
StartupNotify=true |
||||
Terminal=false |
||||
Type=Application |
@ -0,0 +1,30 @@ |
||||
{ stdenv, fetchFromGitHub, lib }: |
||||
|
||||
stdenv.mkDerivation rec { |
||||
pname = "calamares-nixos-extensions"; |
||||
version = "0.3.8"; |
||||
|
||||
src = fetchFromGitHub { |
||||
owner = "NixOS"; |
||||
repo = "calamares-nixos-extensions"; |
||||
rev = version; |
||||
sha256 = "MtqAOwlY5euVNAGRl2pRkbg/OolJPNOSQcR4DS5gFz4="; |
||||
}; |
||||
|
||||
installPhase = '' |
||||
runHook preInstall |
||||
mkdir -p $out/{lib,share}/calamares |
||||
cp -r modules $out/lib/calamares/ |
||||
cp -r config/* $out/share/calamares/ |
||||
cp -r branding $out/share/calamares/ |
||||
runHook postInstall |
||||
''; |
||||
|
||||
meta = with lib; { |
||||
description = "Calamares modules for NixOS"; |
||||
homepage = "https://github.com/NixOS/calamares-nixos-extensions"; |
||||
license = with licenses; [ gpl3Plus bsd2 cc-by-40 cc-by-sa-40 cc0 ]; |
||||
maintainers = with maintainers; [ vlinkz ]; |
||||
platforms = platforms.linux; |
||||
}; |
||||
} |
@ -0,0 +1,46 @@ |
||||
diff --git a/src/calamares/main.cpp b/src/calamares/main.cpp
|
||||
index de709156f..a0b6c5faf 100644
|
||||
--- a/src/calamares/main.cpp
|
||||
+++ b/src/calamares/main.cpp
|
||||
@@ -131,6 +132,8 @@ main( int argc, char* argv[] )
|
||||
// TODO: umount anything in /tmp/calamares-... as an emergency save function
|
||||
#endif
|
||||
|
||||
+ CalamaresUtils::setNixosDirs();
|
||||
+
|
||||
bool is_debug = handle_args( a );
|
||||
|
||||
#ifdef WITH_KF5DBus
|
||||
diff --git a/src/libcalamares/utils/Dirs.cpp b/src/libcalamares/utils/Dirs.cpp
|
||||
index f333d6e64..6118fb412 100644
|
||||
--- a/src/libcalamares/utils/Dirs.cpp
|
||||
+++ b/src/libcalamares/utils/Dirs.cpp
|
||||
@@ -115,6 +116,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 445cbe1f1..da869d446 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 / */
|
@ -0,0 +1,105 @@ |
||||
diff --git a/src/libcalamares/utils/Runner.cpp b/src/libcalamares/utils/Runner.cpp
|
||||
index c7146c2d7..e165d9a8f 100644
|
||||
--- a/src/libcalamares/utils/Runner.cpp
|
||||
+++ b/src/libcalamares/utils/Runner.cpp
|
||||
@@ -140,13 +140,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 a3318d1a0..5fbe202fd 100644
|
||||
--- a/src/modules/mount/main.py
|
||||
+++ b/src/modules/mount/main.py
|
||||
@@ -152,7 +152,8 @@ def mount_partition(root_mount_point, partition, partitions):
|
||||
|
||||
# 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])
|
||||
except FileNotFoundError as e:
|
||||
@@ -193,13 +194,13 @@ def mount_partition(root_mount_point, partition, partitions):
|
||||
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 ca7219ca4..6ac682ba4 100644
|
||||
--- a/src/modules/welcome/checker/GeneralRequirements.cpp
|
||||
+++ b/src/modules/welcome/checker/GeneralRequirements.cpp
|
||||
@@ -371,10 +371,34 @@ 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;
|
@ -0,0 +1,136 @@ |
||||
diff --git a/src/modules/packagechooser/Config.cpp b/src/modules/packagechooser/Config.cpp
|
||||
index 491fe5c25..667621597 100644
|
||||
--- a/src/modules/packagechooser/Config.cpp
|
||||
+++ b/src/modules/packagechooser/Config.cpp
|
||||
@@ -237,6 +237,12 @@ Config::setPackageChoice( const QString& packageChoice )
|
||||
emit packageChoiceChanged( m_packageChoice.value_or( QString() ) );
|
||||
}
|
||||
|
||||
+QString
|
||||
+Config::prettyName() const
|
||||
+{
|
||||
+ return m_stepName ? m_stepName->get() : tr( "Packages" );
|
||||
+}
|
||||
+
|
||||
QString
|
||||
Config::prettyStatus() const
|
||||
{
|
||||
@@ -343,4 +349,14 @@ Config::setConfigurationMap( const QVariantMap& configurationMap )
|
||||
cWarning() << "Single-selection QML module must use 'Legacy' method.";
|
||||
}
|
||||
}
|
||||
+
|
||||
+ bool labels_ok = false;
|
||||
+ auto labels = CalamaresUtils::getSubMap( configurationMap, "labels", labels_ok );
|
||||
+ if ( labels_ok )
|
||||
+ {
|
||||
+ if ( labels.contains( "step" ) )
|
||||
+ {
|
||||
+ m_stepName = new CalamaresUtils::Locale::TranslatedString( labels, "step" );
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
diff --git a/src/modules/packagechooser/Config.h b/src/modules/packagechooser/Config.h
|
||||
index b04b1c30b..d1b783a8d 100644
|
||||
--- a/src/modules/packagechooser/Config.h
|
||||
+++ b/src/modules/packagechooser/Config.h
|
||||
@@ -98,6 +98,7 @@ public:
|
||||
QString packageChoice() const { return m_packageChoice.value_or( QString() ); }
|
||||
void setPackageChoice( const QString& packageChoice );
|
||||
|
||||
+ QString prettyName() const;
|
||||
QString prettyStatus() const;
|
||||
|
||||
signals:
|
||||
@@ -120,6 +121,7 @@ private:
|
||||
* Reading the property will return an empty QString.
|
||||
*/
|
||||
std::optional< QString > m_packageChoice;
|
||||
+ CalamaresUtils::Locale::TranslatedString* m_stepName; // As it appears in the sidebar
|
||||
};
|
||||
|
||||
|
||||
diff --git a/src/modules/packagechooser/PackageChooserViewStep.cpp b/src/modules/packagechooser/PackageChooserViewStep.cpp
|
||||
index 9057004de..8eacf82ec 100644
|
||||
--- a/src/modules/packagechooser/PackageChooserViewStep.cpp
|
||||
+++ b/src/modules/packagechooser/PackageChooserViewStep.cpp
|
||||
@@ -29,7 +29,6 @@ PackageChooserViewStep::PackageChooserViewStep( QObject* parent )
|
||||
: Calamares::ViewStep( parent )
|
||||
, m_config( new Config( this ) )
|
||||
, m_widget( nullptr )
|
||||
- , m_stepName( nullptr )
|
||||
{
|
||||
emit nextStatusChanged( false );
|
||||
}
|
||||
@@ -41,14 +40,12 @@ PackageChooserViewStep::~PackageChooserViewStep()
|
||||
{
|
||||
m_widget->deleteLater();
|
||||
}
|
||||
- delete m_stepName;
|
||||
}
|
||||
|
||||
-
|
||||
QString
|
||||
PackageChooserViewStep::prettyName() const
|
||||
{
|
||||
- return m_stepName ? m_stepName->get() : tr( "Packages" );
|
||||
+ return m_config->prettyName();
|
||||
}
|
||||
|
||||
|
||||
@@ -139,16 +136,6 @@ PackageChooserViewStep::setConfigurationMap( const QVariantMap& configurationMap
|
||||
m_config->setDefaultId( moduleInstanceKey() );
|
||||
m_config->setConfigurationMap( configurationMap );
|
||||
|
||||
- bool labels_ok = false;
|
||||
- auto labels = CalamaresUtils::getSubMap( configurationMap, "labels", labels_ok );
|
||||
- if ( labels_ok )
|
||||
- {
|
||||
- if ( labels.contains( "step" ) )
|
||||
- {
|
||||
- m_stepName = new CalamaresUtils::Locale::TranslatedString( labels, "step" );
|
||||
- }
|
||||
- }
|
||||
-
|
||||
if ( m_widget )
|
||||
{
|
||||
hookupModel();
|
||||
diff --git a/src/modules/packagechooser/PackageChooserViewStep.h b/src/modules/packagechooser/PackageChooserViewStep.h
|
||||
index 7561f2bd7..76b35aed8 100644
|
||||
--- a/src/modules/packagechooser/PackageChooserViewStep.h
|
||||
+++ b/src/modules/packagechooser/PackageChooserViewStep.h
|
||||
@@ -50,7 +50,6 @@ private:
|
||||
|
||||
Config* m_config;
|
||||
PackageChooserPage* m_widget;
|
||||
- CalamaresUtils::Locale::TranslatedString* m_stepName; // As it appears in the sidebar
|
||||
};
|
||||
|
||||
CALAMARES_PLUGIN_FACTORY_DECLARATION( PackageChooserViewStepFactory )
|
||||
diff --git a/src/modules/packagechooserq/PackageChooserQmlViewStep.cpp b/src/modules/packagechooserq/PackageChooserQmlViewStep.cpp
|
||||
index 543c9771d..7c4d5fda7 100644
|
||||
--- a/src/modules/packagechooserq/PackageChooserQmlViewStep.cpp
|
||||
+++ b/src/modules/packagechooserq/PackageChooserQmlViewStep.cpp
|
||||
@@ -29,7 +29,7 @@ PackageChooserQmlViewStep::PackageChooserQmlViewStep( QObject* parent )
|
||||
QString
|
||||
PackageChooserQmlViewStep::prettyName() const
|
||||
{
|
||||
- return tr( "Packages" );
|
||||
+ return m_config->prettyName();
|
||||
}
|
||||
|
||||
QString
|
||||
@@ -83,4 +83,13 @@ PackageChooserQmlViewStep::setConfigurationMap( const QVariantMap& configuration
|
||||
m_config->setDefaultId( moduleInstanceKey() );
|
||||
m_config->setConfigurationMap( configurationMap );
|
||||
Calamares::QmlViewStep::setConfigurationMap( configurationMap ); // call parent implementation last
|
||||
+ /*bool labels_ok = false;
|
||||
+ auto labels = CalamaresUtils::getSubMap( configurationMap, "labels", labels_ok );
|
||||
+ if ( labels_ok )
|
||||
+ {
|
||||
+ if ( labels.contains( "step" ) )
|
||||
+ {
|
||||
+ m_stepName = new CalamaresUtils::Locale::TranslatedString( labels, "step" );
|
||||
+ }
|
||||
+ }*/
|
||||
}
|
@ -0,0 +1,28 @@ |
||||
diff --git a/src/modules/partition/gui/CreatePartitionDialog.cpp b/src/modules/partition/gui/CreatePartitionDialog.cpp
|
||||
index c5b17c69e..353b6f964 100644
|
||||
--- a/src/modules/partition/gui/CreatePartitionDialog.cpp
|
||||
+++ b/src/modules/partition/gui/CreatePartitionDialog.cpp
|
||||
@@ -107,7 +107,8 @@ CreatePartitionDialog::CreatePartitionDialog( Device* device,
|
||||
{
|
||||
// We need to ensure zfs is added to the list if the zfs module is enabled
|
||||
if ( ( fs->type() == FileSystem::Type::Zfs && Calamares::Settings::instance()->isModuleEnabled( "zfs" ) )
|
||||
- || ( fs->supportCreate() != FileSystem::cmdSupportNone && fs->type() != FileSystem::Extended ) )
|
||||
+ || ( fs->supportCreate() != FileSystem::cmdSupportNone && fs->type() != FileSystem::Extended
|
||||
+ && fs->type() != FileSystem::Luks && fs->type() != FileSystem::Luks2 && fs->type() != FileSystem::Minix ) )
|
||||
{
|
||||
fsNames << userVisibleFS( fs ); // This is put into the combobox
|
||||
if ( fs->type() == defaultFSType )
|
||||
diff --git a/src/modules/partition/gui/EditExistingPartitionDialog.cpp b/src/modules/partition/gui/EditExistingPartitionDialog.cpp
|
||||
index 0bc35cabe..3cf8a7fa2 100644
|
||||
--- a/src/modules/partition/gui/EditExistingPartitionDialog.cpp
|
||||
+++ b/src/modules/partition/gui/EditExistingPartitionDialog.cpp
|
||||
@@ -95,7 +95,8 @@ EditExistingPartitionDialog::EditExistingPartitionDialog( Device* device,
|
||||
{
|
||||
// We need to ensure zfs is added to the list if the zfs module is enabled
|
||||
if ( ( fs->type() == FileSystem::Type::Zfs && Calamares::Settings::instance()->isModuleEnabled( "zfs" ) )
|
||||
- || ( fs->supportCreate() != FileSystem::cmdSupportNone && fs->type() != FileSystem::Extended ) )
|
||||
+ || ( fs->supportCreate() != FileSystem::cmdSupportNone && fs->type() != FileSystem::Extended
|
||||
+ && fs->type() != FileSystem::Luks && fs->type() != FileSystem::Luks2 && fs->type() != FileSystem::Minix) )
|
||||
{
|
||||
fsNames << userVisibleFS( fs ); // For the combo box
|
||||
}
|
@ -0,0 +1,85 @@ |
||||
diff --git a/src/modules/finished/FinishedPage.cpp b/src/modules/finished/FinishedPage.cpp
|
||||
index 6c5f9ad16..24d75e07b 100644
|
||||
--- a/src/modules/finished/FinishedPage.cpp
|
||||
+++ b/src/modules/finished/FinishedPage.cpp
|
||||
@@ -71,7 +71,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." )
|
||||
+ "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>")
|
||||
.arg( branding->versionedName() ) );
|
||||
ui->restartCheckBox->setToolTip( tr( "<html><head/><body>"
|
||||
"<p>When this box is checked, your system will "
|
||||
@@ -84,7 +87,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." )
|
||||
+ "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>")
|
||||
.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 721329c1b..164b9945e 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 d021b08b3..fecfa3060 100644
|
||||
--- a/src/modules/packagechooser/page_package.ui
|
||||
+++ b/src/modules/packagechooser/page_package.ui
|
||||
@@ -38,19 +38,6 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
</item>
|
||||
<item>
|
||||
- <layout class="QVBoxLayout" name="verticalLayout" stretch="1,30,1">
|
||||
+ <layout class="QVBoxLayout" name="verticalLayout" stretch="30,1,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>
|
||||
<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">
|
@ -0,0 +1,109 @@ |
||||
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..cb87d864a
|
||||
--- /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: 200
|
||||
+ color: palette.base
|
||||
+ radius: 10
|
||||
+ border.width: 0
|
||||
+ Text {
|
||||
+ color: palette.text
|
||||
+ width: 600
|
||||
+ height: 150
|
||||
+ anchors.centerIn: parent
|
||||
+ text: qsTr("NixOS is fully open source, but it also provides software packages with unfree licenses. By default unfree packages are not allowed, but you can enable it here. If you check this box, software installed might have additional End User License Agreements (EULAs) attached. If not enabled, some hardware might not work fully when no suitable open source drivers are available.<br/>")
|
||||
+ font.pointSize: 12
|
||||
+ wrapMode: Text.WordWrap
|
||||
+ }
|
||||
+
|
||||
+ CheckBox {
|
||||
+ id: element2
|
||||
+ anchors.horizontalCenter: parent.horizontalCenter
|
||||
+ y: 145
|
||||
+ 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
|
@ -0,0 +1,31 @@ |
||||
diff --git a/src/modules/users/Config.cpp b/src/modules/users/Config.cpp
|
||||
index eedfd274d..0f3e78848 100644
|
||||
--- a/src/modules/users/Config.cpp
|
||||
+++ b/src/modules/users/Config.cpp
|
||||
@@ -972,26 +972,11 @@ Config::createJobs() const
|
||||
|
||||
Calamares::Job* j;
|
||||
|
||||
- if ( !m_sudoersGroup.isEmpty() )
|
||||
- {
|
||||
- j = new SetupSudoJob( m_sudoersGroup, m_sudoStyle );
|
||||
- jobs.append( Calamares::job_ptr( j ) );
|
||||
- }
|
||||
-
|
||||
- j = new SetupGroupsJob( this );
|
||||
- jobs.append( Calamares::job_ptr( j ) );
|
||||
-
|
||||
- j = new CreateUserJob( this );
|
||||
- jobs.append( Calamares::job_ptr( j ) );
|
||||
-
|
||||
j = new SetPasswordJob( loginName(), userPassword() );
|
||||
jobs.append( Calamares::job_ptr( j ) );
|
||||
|
||||
j = new SetPasswordJob( "root", rootPassword() );
|
||||
jobs.append( Calamares::job_ptr( j ) );
|
||||
|
||||
- j = new SetHostNameJob( this );
|
||||
- jobs.append( Calamares::job_ptr( j ) );
|
||||
-
|
||||
return jobs;
|
||||
}
|
Loading…
Reference in new issue