fix
This commit is contained in:
parent
4ad01219db
commit
7f0fd2c45b
4 changed files with 29 additions and 11 deletions
|
@ -14,7 +14,8 @@ mode = "Desktop"
|
||||||
locale = "de_DE.UTF-8"
|
locale = "de_DE.UTF-8"
|
||||||
|
|
||||||
# Keymap
|
# Keymap
|
||||||
keymap = "de-latin1"
|
keyboard_layout = "de"
|
||||||
|
keyboard_variant = "mac"
|
||||||
|
|
||||||
# Timezone
|
# Timezone
|
||||||
timezone = "Europe/Berlin"
|
timezone = "Europe/Berlin"
|
||||||
|
|
|
@ -68,8 +68,10 @@ pub struct GeneralConfig {
|
||||||
pub mode: InstallMode,
|
pub mode: InstallMode,
|
||||||
/// System locale
|
/// System locale
|
||||||
pub locale: String,
|
pub locale: String,
|
||||||
/// Keymap
|
/// Keyboard Layout
|
||||||
pub keymap: String,
|
pub keyboard_layout: String,
|
||||||
|
/// Keyboard Variant
|
||||||
|
pub keyboard_variant: Option<String>,
|
||||||
/// Timezone
|
/// Timezone
|
||||||
pub timezone: String,
|
pub timezone: String,
|
||||||
/// Hostname
|
/// Hostname
|
||||||
|
|
|
@ -38,11 +38,7 @@ pub fn first_boot_values(conf: &GeneralConfig) {
|
||||||
|
|
||||||
// Keymap
|
// Keymap
|
||||||
print_status("Writing /etc/vconsole.conf");
|
print_status("Writing /etc/vconsole.conf");
|
||||||
std::fs::write(
|
std::fs::write("/mnt/etc/vconsole.conf", build_vconsole_conf(conf)).unwrap();
|
||||||
"/mnt/etc/vconsole.conf",
|
|
||||||
format!("KEYMAP=\"{}\"", conf.keymap),
|
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
// Hostname
|
// Hostname
|
||||||
print_status("Writing /etc/hostname");
|
print_status("Writing /etc/hostname");
|
||||||
|
@ -57,3 +53,14 @@ pub fn first_boot_values(conf: &GeneralConfig) {
|
||||||
|
|
||||||
systemd_service_enable("NetworkManager.service");
|
systemd_service_enable("NetworkManager.service");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn build_vconsole_conf(conf: &GeneralConfig) -> String {
|
||||||
|
let mut ret = format!("KEYMAP={}\n", conf.keyboard_layout);
|
||||||
|
ret.push_str(&format!("XBKLAYOUT={}\n", conf.keyboard_layout));
|
||||||
|
|
||||||
|
if let Some(variant) = &conf.keyboard_variant {
|
||||||
|
ret.push_str(&format!("XKBMODEL={variant}\n"));
|
||||||
|
}
|
||||||
|
|
||||||
|
ret
|
||||||
|
}
|
||||||
|
|
|
@ -1,6 +1,14 @@
|
||||||
use crate::config::GeneralConfig;
|
use crate::{config::GeneralConfig, create_iso::build_kxkbrc, linux::install_file, print_status};
|
||||||
|
|
||||||
pub fn setup_skel(conf: &GeneralConfig) {
|
pub fn setup_skel(conf: &GeneralConfig) {
|
||||||
// TODO : Implement
|
print_status("Setting user config");
|
||||||
unimplemented!()
|
std::fs::create_dir_all("/mnt/etc/skel/.config").unwrap();
|
||||||
|
install_file(
|
||||||
|
"/mnt/etc/skel/.config/kxkbrc",
|
||||||
|
&build_kxkbrc(
|
||||||
|
conf.keyboard_layout.as_str(),
|
||||||
|
conf.keyboard_variant.as_ref().map(|x| x.as_str()),
|
||||||
|
),
|
||||||
|
0o644,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue