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.
75 lines
1.7 KiB
Dart
75 lines
1.7 KiB
Dart
3 years ago
|
import 'package:jade_gui/classes/desktop.dart';
|
||
|
import 'package:jade_gui/classes/location.dart';
|
||
|
|
||
3 years ago
|
class InstallPrefs {
|
||
3 years ago
|
final Location locale;
|
||
|
final String keymap;
|
||
|
final String layout;
|
||
|
final String username;
|
||
3 years ago
|
final String password;
|
||
3 years ago
|
final bool enableSudo;
|
||
3 years ago
|
final String rootPass;
|
||
3 years ago
|
final Desktop desktop;
|
||
|
final String disk;
|
||
3 years ago
|
final bool isEfi;
|
||
|
final String bootloader;
|
||
3 years ago
|
final String bootloaderLocation;
|
||
3 years ago
|
final String hostname;
|
||
|
final bool ipv6;
|
||
|
final bool enableTimeshift;
|
||
3 years ago
|
|
||
3 years ago
|
InstallPrefs({
|
||
3 years ago
|
this.locale = const Location(),
|
||
|
this.keymap = "",
|
||
|
this.layout = "",
|
||
|
this.username = "",
|
||
3 years ago
|
this.password = "",
|
||
3 years ago
|
this.enableSudo = false,
|
||
3 years ago
|
this.rootPass = "",
|
||
3 years ago
|
this.desktop = const Desktop(),
|
||
|
this.disk = "",
|
||
3 years ago
|
this.isEfi = false,
|
||
|
this.bootloader = "",
|
||
3 years ago
|
this.bootloaderLocation = "",
|
||
3 years ago
|
this.hostname = "",
|
||
|
this.ipv6 = false,
|
||
|
this.enableTimeshift = false,
|
||
3 years ago
|
});
|
||
|
|
||
3 years ago
|
Map toJson() => {
|
||
|
"partition": {
|
||
|
"device": disk,
|
||
|
"mode": "auto",
|
||
|
"efi": isEfi,
|
||
|
},
|
||
|
"bootloader": {
|
||
|
"type": bootloader,
|
||
3 years ago
|
"location": bootloaderLocation,
|
||
3 years ago
|
},
|
||
|
"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,
|
||
3 years ago
|
"extra_packages": [
|
||
3 years ago
|
"firefox",
|
||
|
]
|
||
|
};
|
||
3 years ago
|
}
|