Add install base and kernels step
parent
7963bafed9
commit
2b7ffea75e
@ -1,4 +1,64 @@
|
||||
def install_base_packages [] {
|
||||
(
|
||||
run pacstrap /mnt
|
||||
base
|
||||
linux-firmware
|
||||
systemd-sysvcompat
|
||||
networkmanager
|
||||
man-db
|
||||
man-pages
|
||||
texinfo
|
||||
nano
|
||||
sudo
|
||||
curl
|
||||
archlinux-keyring
|
||||
|
||||
# crystal base
|
||||
crystal-core
|
||||
crystal-branding
|
||||
|
||||
# crystal extras
|
||||
crystal-first-setup
|
||||
neofetch
|
||||
btrfs-progs
|
||||
which
|
||||
base-devel
|
||||
|
||||
# fonts
|
||||
noto-fonts
|
||||
noto-fonts-emoji
|
||||
noto-fonts-cjk
|
||||
noto-fonts-extra
|
||||
ttf-nerd-fonts-symbols-common
|
||||
ttf-firacode-nerd
|
||||
ttf-liberation
|
||||
|
||||
# audio
|
||||
pipewire
|
||||
pipewire-pulse
|
||||
pipewire-alsa
|
||||
pipewire-jack
|
||||
wireplumber
|
||||
helvum
|
||||
|
||||
# utils
|
||||
xterm
|
||||
cups
|
||||
cups-pdf
|
||||
bluez
|
||||
bluez-cups
|
||||
ntfs-3g
|
||||
bash-completion
|
||||
zsh-completions
|
||||
)
|
||||
}
|
||||
|
||||
# Applies all system changes of `install-base`
|
||||
def main [cfg] {
|
||||
echo "Executing up task `install-base` with config" $cfg
|
||||
debug $"installing base with config ($cfg)"
|
||||
|
||||
mkdir /mnt/etc
|
||||
install_base_packages
|
||||
cp /etc/pacman.conf /mnt/etc/pacman.conf
|
||||
run bash -c 'genfstab -U /mnt >> /mnt/etc/fstab'
|
||||
}
|
||||
|
@ -1,5 +1,26 @@
|
||||
let RUN_IN_CHROOT = true;
|
||||
let SUPPORTED_KERNELS = ["linux", "linux-zen", "linus-hardened", "linux-lts"];
|
||||
|
||||
# Applies all system changes of `install-kernels`
|
||||
def main [cfg] {
|
||||
echo "Executing up task `install-kernels` with config" $cfg
|
||||
debug $"installing kernels with config ($cfg)"
|
||||
mut kernel = $cfg.default
|
||||
|
||||
if $kernel not-in $SUPPORTED_KERNELS {
|
||||
warn $"Unsupported kernel ($kernel). Defaulting to 'linux' kernel"
|
||||
$kernel = "linux"
|
||||
}
|
||||
|
||||
run pacstrap /mnt $kernel
|
||||
|
||||
debug "Installing additional kernels"
|
||||
|
||||
$cfg.additional | each {|$k|
|
||||
debug $"installing ($k)"
|
||||
|
||||
if $k in $SUPPORTED_KERNELS {
|
||||
run pacstrap /mnt $k
|
||||
} else {
|
||||
warn $"Unsupported kernel ($k)"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,10 @@
|
||||
mod debug;
|
||||
mod info;
|
||||
mod run;
|
||||
mod warn;
|
||||
mod with_cwd;
|
||||
pub use debug::*;
|
||||
pub use info::*;
|
||||
pub use run::*;
|
||||
pub use warn::*;
|
||||
pub use with_cwd::*;
|
||||
|
@ -0,0 +1,36 @@
|
||||
use embed_nu::{
|
||||
nu_protocol::{engine::Command, Signature, SyntaxShape},
|
||||
CallExt, PipelineData,
|
||||
};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct WarnCommand;
|
||||
|
||||
impl Command for WarnCommand {
|
||||
fn name(&self) -> &str {
|
||||
"warn"
|
||||
}
|
||||
|
||||
fn signature(&self) -> embed_nu::nu_protocol::Signature {
|
||||
Signature::new("warn")
|
||||
.rest("rest", SyntaxShape::Any, "the warning to print")
|
||||
.category(embed_nu::nu_protocol::Category::Custom("Tourmaline".into()))
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
"Prints the given message and values with warning severity"
|
||||
}
|
||||
|
||||
fn run(
|
||||
&self,
|
||||
engine_state: &embed_nu::nu_protocol::engine::EngineState,
|
||||
stack: &mut embed_nu::nu_protocol::engine::Stack,
|
||||
call: &embed_nu::nu_protocol::ast::Call,
|
||||
_input: embed_nu::PipelineData,
|
||||
) -> Result<embed_nu::PipelineData, embed_nu::nu_protocol::ShellError> {
|
||||
let args: Vec<String> = call.rest(engine_state, stack, 0)?;
|
||||
tracing::warn!("{}", args.join(" "));
|
||||
|
||||
Ok(PipelineData::empty())
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue