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

83 lines
2.0 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;
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 [],
});
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",
]
};
}