mirror of
https://github.com/Noratrieb/website.git
synced 2026-01-14 08:55:01 +01:00
add cursed hacks
This commit is contained in:
parent
ce8c65aeaf
commit
2da7939965
3 changed files with 14 additions and 4 deletions
|
|
@ -169,7 +169,7 @@ fn build(rng: &mut rand::rngs::StdRng, root: &Path) -> Result<()> {
|
|||
let sub_config =
|
||||
submodule::Submodules::parse(&sub_config).wrap_err("invalid submodules.toml")?;
|
||||
let submodules_path = root.join("submodules");
|
||||
submodule::sync(&submodules_path, &sub_config).wrap_err("syncing subtrees")?;
|
||||
submodule::sync(&submodules_path, &sub_config).wrap_err("syncing submodules")?;
|
||||
|
||||
let dist_path = root.join("dist");
|
||||
build::assemble_website(
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ use color_eyre::{
|
|||
Result,
|
||||
};
|
||||
|
||||
use crate::utils;
|
||||
use crate::utils::{self, cp_r};
|
||||
|
||||
pub struct Submodules {
|
||||
configs: Vec<SyncConfig>,
|
||||
|
|
@ -86,7 +86,14 @@ pub fn sync(path: &Path, config: &Submodules) -> color_eyre::Result<()> {
|
|||
let _span = span.enter();
|
||||
|
||||
let sub_path = path.join(name);
|
||||
if !sub_path.exists() {
|
||||
|
||||
if let Ok(path) = std::env::var(format!("SUBMODULE_DIR_{}", name.to_uppercase())) {
|
||||
info!(?name, ?path, "Taking submodule from hardcoded path");
|
||||
cp_r(Path::new(&path), &sub_path).wrap_err("copying path from SUBMODULE_DIR")?;
|
||||
continue;
|
||||
}
|
||||
|
||||
if !sub_path.exists() {
|
||||
info!(?name, ?url, "Cloning");
|
||||
let mut cmd = process::Command::new("git");
|
||||
cmd.args(["clone", url, sub_path.to_str().unwrap()]);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ pkgs ? import <nixpkgs> { }, ... }:
|
||||
{ pkgs ? import <nixpkgs> { }, slides ? null, blog ? null, ... }:
|
||||
let
|
||||
generator = import ./builder { inherit pkgs; };
|
||||
in
|
||||
|
|
@ -8,6 +8,9 @@ pkgs.stdenv.mkDerivation {
|
|||
src = ./.;
|
||||
unpackSrc = false;
|
||||
|
||||
SUBMODULE_DIR_SLIDES = slides;
|
||||
SUBMODULE_DIR_BLOG = blog;
|
||||
|
||||
WEBSITE_RNG_SEED = "99";
|
||||
|
||||
nativeBuildInputs = with pkgs; [ git hugo ];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue