2022-11-23 09:26:26 -05:00
|
|
|
use std::path::{Path, PathBuf};
|
|
|
|
|
|
|
|
pub struct EspPaths {
|
|
|
|
pub esp: PathBuf,
|
|
|
|
pub nixos: PathBuf,
|
|
|
|
pub kernel: PathBuf,
|
|
|
|
pub initrd: PathBuf,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl EspPaths {
|
|
|
|
pub fn new(esp: &str) -> Self {
|
|
|
|
let esp = Path::new(esp);
|
|
|
|
let esp_nixos = esp.join("EFI/nixos");
|
|
|
|
|
|
|
|
Self {
|
|
|
|
esp: esp.to_owned(),
|
|
|
|
nixos: esp_nixos.clone(),
|
2022-11-23 09:30:24 -05:00
|
|
|
kernel: esp_nixos.join("kernel"),
|
2022-11-23 09:26:26 -05:00
|
|
|
initrd: esp_nixos.join("initrd"),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|