You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jade_gui/lib/classes/install_prefs.dart

103 lines
2.5 KiB
Dart

import 'package:jade_gui/classes/desktop.dart';
import 'package:jade_gui/classes/location.dart';
3 years ago
class InstallPrefs {
final Location locale;
final String keymap;
final String layout;
final String username;
final String password;
final bool enableSudo;
final String rootPass;
final Desktop desktop;
final String disk;
final bool isEfi;
final String bootloader;
final String bootloaderLocation;
final String hostname;
final bool ipv6;
final bool enableTimeshift;
final bool enableFlatpak;
3 years ago
final bool manualPartitioning;
final List<String> partitions;
final bool enableUnakite;
final String unakiteRoot;
final String crystalRoot;
final String unakiteEfiDir;
final String unakiteBootDev;
final String kernel;
3 years ago
InstallPrefs({
this.locale = const Location(),
this.keymap = "",
this.layout = "",
this.username = "",
this.password = "",
this.enableSudo = false,
this.rootPass = "",
this.desktop = const Desktop(),
this.disk = "",
this.isEfi = false,
this.bootloader = "",
this.bootloaderLocation = "",
this.hostname = "",
this.ipv6 = false,
this.enableTimeshift = false,
this.enableFlatpak = false,
3 years ago
this.manualPartitioning = false,
this.partitions = const [],
this.enableUnakite = true,
this.unakiteRoot = "",
this.crystalRoot = "",
this.unakiteEfiDir = "",
this.unakiteBootDev = "",
this.kernel = "linux",
});
Map toJson() => {
"partition": {
"device": disk,
"mode": manualPartitioning ? "Manual" : "Auto",
"efi": isEfi,
3 years ago
"partitions": partitions,
},
"bootloader": {
"type": bootloader,
"location": bootloaderLocation,
},
"locale": {
"locale": [
locale.locale,
],
"keymap": keymap,
"timezone": locale.region,
},
"networking": {
"hostname": hostname,
"ipv6": ipv6,
},
"users": [
{
"name": username,
"password": password,
"hasroot": enableSudo,
}
],
"rootpass": rootPass,
"desktop": desktop.name,
"timeshift": enableTimeshift,
"flatpak": enableFlatpak,
"extra_packages": [
"firefox",
],
"unakite": {
"enable": enableUnakite,
"root": unakiteRoot,
"oldroot": crystalRoot,
"efidir": unakiteEfiDir,
"bootdev": unakiteBootDev,
},
"kernel": kernel,
};
}