diff --git a/apps/koffice/.envrc b/apps/koffice/.envrc new file mode 100644 index 00000000000..051d09d292a --- /dev/null +++ b/apps/koffice/.envrc @@ -0,0 +1 @@ +eval "$(lorri direnv)" diff --git a/apps/koffice/.projectile b/apps/koffice/.projectile new file mode 100644 index 00000000000..e69de29bb2d diff --git a/apps/koffice/libko/src/log_util.rs b/apps/koffice/libko/src/log_util.rs new file mode 100644 index 00000000000..b87dbe83df4 --- /dev/null +++ b/apps/koffice/libko/src/log_util.rs @@ -0,0 +1,36 @@ +#[macro_export] +macro_rules! fatal { + () => { + error!("Unknown failure!"); + std::process::exit(2) + }; + ($($arg:tt)*) => ({ + error!($($arg)*); + std::process::exit(2) + }) +} + +use colored::*; +use env_logger::Builder; +use log::Level; +use std::io::Write; + +pub fn initialise() { + let mut b = Builder::from_default_env(); + b.format(|buf, record| { + let lvl = record.level().to_string(); + write!( + buf, + "[{}]: {}\n", + match record.level() { + Level::Error => lvl.red(), + Level::Warn => lvl.yellow(), + Level::Info => lvl.green(), + Level::Debug => lvl.purple(), + Level::Trace => lvl.cyan(), + }, + record.args() + ) + }) + .init(); +} diff --git a/apps/koffice/rustfmt.toml b/apps/koffice/rustfmt.toml new file mode 100644 index 00000000000..f25acec201e --- /dev/null +++ b/apps/koffice/rustfmt.toml @@ -0,0 +1 @@ +inline_attribute_width = 50 \ No newline at end of file diff --git a/apps/koffice/shell.nix b/apps/koffice/shell.nix new file mode 100644 index 00000000000..eb45853d461 --- /dev/null +++ b/apps/koffice/shell.nix @@ -0,0 +1,8 @@ +with import {}; + +stdenv.mkDerivation { + name = "koffice"; + buildInputs = with pkgs; [ + rustc cargo rust-analyzer rustfmt clangStdenv + ]; +}