Compare commits
No commits in common. "ffbc2e5e72daea3ece33165bfa1df37d4cabbef7" and "823f4e9c7842c7e70440f57f9b34f72fd39caa38" have entirely different histories.
ffbc2e5e72
...
823f4e9c78
5 changed files with 6 additions and 164 deletions
|
@ -1,53 +0,0 @@
|
||||||
# Desktop Install Template
|
|
||||||
|
|
||||||
# Drive Selection for Install
|
|
||||||
[drive]
|
|
||||||
# Device node for the EFI boot filesystem
|
|
||||||
boot = "/dev/null"
|
|
||||||
|
|
||||||
# Device node for the root filesystem
|
|
||||||
root = "/dev/null"
|
|
||||||
|
|
||||||
# Root filesystem encryption passphrase
|
|
||||||
# If this option is set the root filesystem will be encrypted with LUKS
|
|
||||||
encryption = "password"
|
|
||||||
|
|
||||||
# General configuration
|
|
||||||
[general]
|
|
||||||
# Preset
|
|
||||||
mode = "Desktop"
|
|
||||||
|
|
||||||
# System Locale
|
|
||||||
locale = "de_DE.UTF-8"
|
|
||||||
|
|
||||||
# Keymap
|
|
||||||
keyboard_layout = "de"
|
|
||||||
keyboard_variant = "mac"
|
|
||||||
|
|
||||||
# Timezone
|
|
||||||
timezone = "Europe/Berlin"
|
|
||||||
|
|
||||||
# Hostname
|
|
||||||
hostname = "navos"
|
|
||||||
|
|
||||||
# Root password
|
|
||||||
root_password = "root"
|
|
||||||
|
|
||||||
[pkg]
|
|
||||||
# Additional packages
|
|
||||||
pkg = [
|
|
||||||
"nano",
|
|
||||||
"micro"
|
|
||||||
]
|
|
||||||
|
|
||||||
# User configuration
|
|
||||||
# The `[[user]]` directive can be repeated to create multiple users.
|
|
||||||
[[user]]
|
|
||||||
# Username
|
|
||||||
name = "u"
|
|
||||||
|
|
||||||
# User password
|
|
||||||
password = "pass"
|
|
||||||
|
|
||||||
# Allow user to use `doas` as root
|
|
||||||
doas_root= true
|
|
|
@ -50,10 +50,10 @@ docker = true
|
||||||
# The `[[user]]` directive can be repeated to create multiple users.
|
# The `[[user]]` directive can be repeated to create multiple users.
|
||||||
[[user]]
|
[[user]]
|
||||||
# Username
|
# Username
|
||||||
name = "u"
|
name = "testuser"
|
||||||
|
|
||||||
# User password
|
# User password
|
||||||
password = "pass"
|
password = "testpass"
|
||||||
|
|
||||||
# Allow user to use `doas` as root
|
# Allow user to use `doas` as root
|
||||||
doas_root= true
|
doas_root= true
|
||||||
|
@ -61,9 +61,6 @@ doas_root= true
|
||||||
# Add user to Docker group
|
# Add user to Docker group
|
||||||
docker = true
|
docker = true
|
||||||
|
|
||||||
# Add user to libvirt group
|
|
||||||
virtualization = true
|
|
||||||
|
|
||||||
# SSH Configuration
|
# SSH Configuration
|
||||||
# If `[ssh]` is set, openssh will be installed and enabled.
|
# If `[ssh]` is set, openssh will be installed and enabled.
|
||||||
[ssh]
|
[ssh]
|
||||||
|
@ -79,7 +76,7 @@ sshd_config = "/etc/ssh/sshd_config"
|
||||||
key = "ssh-rsa ... user@host"
|
key = "ssh-rsa ... user@host"
|
||||||
|
|
||||||
# The users allowed to login with this key
|
# The users allowed to login with this key
|
||||||
users = ["u", "root"]
|
users = ["testuser", "root"]
|
||||||
|
|
||||||
# Ollama Configuration
|
# Ollama Configuration
|
||||||
# If `[ai]` is set, ollama will be installed and enabled.
|
# If `[ai]` is set, ollama will be installed and enabled.
|
||||||
|
|
|
@ -1,79 +0,0 @@
|
||||||
# Server Install Template
|
|
||||||
|
|
||||||
# Drive Selection for Install
|
|
||||||
[drive]
|
|
||||||
# Device node for the EFI boot filesystem
|
|
||||||
boot = "/dev/null"
|
|
||||||
|
|
||||||
# Device node for the root filesystem
|
|
||||||
root = "/dev/null"
|
|
||||||
|
|
||||||
# Root filesystem encryption passphrase
|
|
||||||
# If this option is set the root filesystem will be encrypted with LUKS
|
|
||||||
encryption = "password"
|
|
||||||
|
|
||||||
# General configuration
|
|
||||||
[general]
|
|
||||||
# Preset
|
|
||||||
mode = "Server"
|
|
||||||
|
|
||||||
# System Locale
|
|
||||||
locale = "de_DE.UTF-8"
|
|
||||||
|
|
||||||
# Keymap
|
|
||||||
keyboard_layout = "de"
|
|
||||||
keyboard_variant = "mac"
|
|
||||||
|
|
||||||
# Timezone
|
|
||||||
timezone = "Europe/Berlin"
|
|
||||||
|
|
||||||
# Hostname
|
|
||||||
hostname = "navos"
|
|
||||||
|
|
||||||
# Root password
|
|
||||||
root_password = "root"
|
|
||||||
|
|
||||||
[pkg]
|
|
||||||
# Additional packages
|
|
||||||
pkg = []
|
|
||||||
|
|
||||||
# Enable virtualization
|
|
||||||
virtualization = true
|
|
||||||
|
|
||||||
# Enable docker
|
|
||||||
docker = true
|
|
||||||
|
|
||||||
# User configuration
|
|
||||||
# The `[[user]]` directive can be repeated to create multiple users.
|
|
||||||
[[user]]
|
|
||||||
# Username
|
|
||||||
name = "u"
|
|
||||||
|
|
||||||
# User password
|
|
||||||
password = "pass"
|
|
||||||
|
|
||||||
# Allow user to use `doas` as root
|
|
||||||
doas_root= true
|
|
||||||
|
|
||||||
# Add user to Docker group
|
|
||||||
docker = true
|
|
||||||
|
|
||||||
# Add user to libvirt group
|
|
||||||
virtualization = true
|
|
||||||
|
|
||||||
# SSH Configuration
|
|
||||||
# If `[ssh]` is set, openssh will be installed and enabled.
|
|
||||||
[ssh]
|
|
||||||
# Config file for sshd
|
|
||||||
# This file will be copied to the new system
|
|
||||||
sshd_config = "/etc/ssh/sshd_config"
|
|
||||||
|
|
||||||
# Install a SSH keys
|
|
||||||
# To set multiple keys, repeat the `[[ssh.key]]` directive.
|
|
||||||
# Every key will be installed in the users respective `authorized_keys` file.
|
|
||||||
[[ssh.key]]
|
|
||||||
# The SSH Key
|
|
||||||
key = "ssh-rsa ... user@host"
|
|
||||||
|
|
||||||
# The users allowed to login with this key
|
|
||||||
users = ["u", "root"]
|
|
|
@ -43,7 +43,6 @@ pub struct UserConfig {
|
||||||
pub password: String,
|
pub password: String,
|
||||||
pub doas_root: Option<bool>,
|
pub doas_root: Option<bool>,
|
||||||
pub docker: Option<bool>,
|
pub docker: Option<bool>,
|
||||||
pub virtualization: Option<bool>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Deserialize)]
|
#[derive(Debug, Clone, Deserialize)]
|
||||||
|
|
|
@ -31,8 +31,8 @@ pub mod user;
|
||||||
pub mod zram;
|
pub mod zram;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
config::{InstallConfig, InstallMode},
|
config::InstallConfig,
|
||||||
linux::{arch_chroot, install_file, systemd_service_enable},
|
linux::install_file,
|
||||||
pkg::{self, install_pkgs, pacstrap},
|
pkg::{self, install_pkgs, pacstrap},
|
||||||
print_status,
|
print_status,
|
||||||
};
|
};
|
||||||
|
@ -126,29 +126,7 @@ pub fn install(conf: InstallConfig) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if conf.pkg.virtualization.unwrap_or_default() {
|
if conf.pkg.virtualization.unwrap_or_default() {
|
||||||
let user_conf = if let Some(user_conf) = &conf.user {
|
// TODO : Enable virtualization
|
||||||
user_conf.clone()
|
|
||||||
} else {
|
|
||||||
Vec::new()
|
|
||||||
};
|
|
||||||
|
|
||||||
install_pkgs(&["libvirt"]);
|
|
||||||
|
|
||||||
if matches!(conf.general.mode, InstallMode::Desktop) {
|
|
||||||
install_pkgs(&["virt-manager"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
systemd_service_enable("libvirtd.service");
|
|
||||||
|
|
||||||
for user in user_conf {
|
|
||||||
if user.virtualization.unwrap_or_default() {
|
|
||||||
arch_chroot(
|
|
||||||
&vec!["usermod", "-a", "-G", "libvirt", user.name.as_str()],
|
|
||||||
None,
|
|
||||||
false,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if conf.pkg.docker.unwrap_or_default() {
|
if conf.pkg.docker.unwrap_or_default() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue