it compiles

This commit is contained in:
Borodinov Ilya 2024-05-14 15:34:05 +03:00
parent fad33758fe
commit b7ee7eb9e9
Signed by: noth
GPG key ID: 75503B2EF596D1BD
61 changed files with 2599 additions and 304 deletions

1
.devenv/profile Symbolic link
View file

@ -0,0 +1 @@
/nix/store/wfmdfyk21ibcl78rsjlnxy1fqg0sfk4k-devenv-profile

1
.devenv/run Symbolic link
View file

@ -0,0 +1 @@
/run/user/1000/devenv-43506f0

View file

@ -1 +0,0 @@
/nix/store/05yb0d179k1pw74yxnlhdq9ld30yp9pk-source

View file

@ -0,0 +1 @@
/nix/store/0i9zspwqfnr2vjpdbjd4gifnik23v3gn-source

View file

@ -0,0 +1 @@
/nix/store/27rg15w6bjjh2hkbdqajhvqd7b02v5cb-source

View file

@ -1 +0,0 @@
/nix/store/3cp7q2d0ywi20zhva9bcczisxmq1jxgb-source

View file

@ -1 +0,0 @@
/nix/store/49xf0m8xlwppfgx9xa45ybvcsn9yiy18-source

View file

@ -1 +0,0 @@
/nix/store/5a09v6jw29b21vvc35rsv5czv0z0nlq8-source

View file

@ -1 +0,0 @@
/nix/store/6q5b11kr46mrvipv2fm6wx2qnvsdi8mh-source

View file

@ -0,0 +1 @@
/nix/store/8kpx53qi52yhjai1vdw8zpa95iqa61bv-source

View file

@ -0,0 +1 @@
/nix/store/8sm7wycza5fl6lnsmw11sn4vqkvw4xyh-source

View file

@ -1 +0,0 @@
/nix/store/a299nv68x7dm4fc9mj60qwrjn31zvw3z-source

View file

@ -0,0 +1 @@
/nix/store/dlrwkbfzbag8f4xj2kbixalscj206j45-source

View file

@ -0,0 +1 @@
/nix/store/f2h5kmarn194yda41znm0r4ibwyg8z7i-source

View file

@ -0,0 +1 @@
/nix/store/g5v3sgqy6a0fsmas7mnapc196flrplix-source

View file

@ -0,0 +1 @@
/nix/store/hwsdv71bmaqvzbii5viryxc8slw4vr5v-source

View file

@ -0,0 +1 @@
/nix/store/i4ginw25yf2q0shnzvzjjwa58srbjhw7-source

View file

@ -0,0 +1 @@
/nix/store/i6yzq14z49ayjinw6v9v06kqz62akkay-source

View file

@ -0,0 +1 @@
/nix/store/ia8xy09wg9si4lbbxgzbyyg1n0qxg1vk-source

View file

@ -0,0 +1 @@
/nix/store/lhbcw63xdqclg2hrni4p7dc90nl996lk-source

View file

@ -0,0 +1 @@
/nix/store/mhgnysbsr0yx44xlqvl7xymk8js22c7z-source

View file

@ -0,0 +1 @@
/nix/store/na7sykizsgkzh9i3wc8m8pz5xfqib2rv-source

View file

@ -1 +0,0 @@
/nix/store/nmf1ggxf77gzv7cw5h91d6l1wh4y6qyj-source

View file

@ -1 +0,0 @@
/nix/store/paqmjg18kvzmbrbil9g2mq9k4015fd7p-source

View file

@ -1 +0,0 @@
/nix/store/pfc56yr7y3wflvbgnrpscf2n1m4j3xd7-source

View file

@ -1 +0,0 @@
/nix/store/pgid9c9xfcrbqx2giry0an0bi0df7s5c-source

View file

@ -0,0 +1 @@
/nix/store/r2ip1850igy8kciyaagw502s3c6ph1s4-source

View file

@ -1 +0,0 @@
/nix/store/rzkl4xygy3z1glq8cgrv5cc075ylxs0g-source

View file

@ -0,0 +1 @@
/nix/store/s1cnnplqrk8w595dp9fb5cv84xj61lgx-source

View file

@ -0,0 +1 @@
/nix/store/v1wzqsqi3d9fhdl60n24sqhj7pr3yhin-source

View file

@ -0,0 +1 @@
/nix/store/vz580xz1w41n6m6x81mqgcrnp3y4cf41-source

View file

@ -1 +1 @@
/nix/store/fbldsappzwwr5acj8k1km1dy9ahpx9dj-nite-env
/nix/store/xyhi7qx5y8iliadk0ksh9j3w46agp6r0-devenv-shell-env

246
Cargo.lock generated
View file

@ -118,6 +118,17 @@ dependencies = [
"pin-project-lite",
]
[[package]]
name = "async-channel"
version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35"
dependencies = [
"concurrent-queue",
"event-listener 2.5.3",
"futures-core",
]
[[package]]
name = "async-channel"
version = "2.3.0"
@ -139,8 +150,8 @@ checksum = "b10202063978b3351199d68f8b22c4e47e4b1b822f8d43fd862d5ea8c006b29a"
dependencies = [
"async-task",
"concurrent-queue",
"fastrand",
"futures-lite",
"fastrand 2.1.0",
"futures-lite 2.3.0",
"slab",
]
@ -152,7 +163,7 @@ checksum = "ebcd09b382f40fcd159c2d695175b2ae620ffa5f3bd6f664131efff4e8b9e04a"
dependencies = [
"async-lock",
"blocking",
"futures-lite",
"futures-lite 2.3.0",
]
[[package]]
@ -165,9 +176,9 @@ dependencies = [
"cfg-if",
"concurrent-queue",
"futures-io",
"futures-lite",
"futures-lite 2.3.0",
"parking",
"polling",
"polling 3.7.0",
"rustix",
"slab",
"tracing",
@ -193,7 +204,7 @@ checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7"
dependencies = [
"async-io",
"blocking",
"futures-lite",
"futures-lite 2.3.0",
]
[[package]]
@ -202,7 +213,7 @@ version = "2.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a53fc6301894e04a92cb2584fedde80cb25ba8e02d9dc39d4a87d036e22f397d"
dependencies = [
"async-channel",
"async-channel 2.3.0",
"async-io",
"async-lock",
"async-signal",
@ -210,7 +221,7 @@ dependencies = [
"blocking",
"cfg-if",
"event-listener 5.3.0",
"futures-lite",
"futures-lite 2.3.0",
"rustix",
"tracing",
"windows-sys 0.52.0",
@ -398,11 +409,11 @@ version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "495f7104e962b7356f0aeb34247aca1fe7d2e783b346582db7f2904cb5717e88"
dependencies = [
"async-channel",
"async-channel 2.3.0",
"async-lock",
"async-task",
"futures-io",
"futures-lite",
"futures-lite 2.3.0",
"piper",
]
@ -462,7 +473,7 @@ checksum = "fba7adb4dd5aa98e5553510223000e7148f621165ec5f9acd7113f6ca4995298"
dependencies = [
"bitflags 2.5.0",
"log",
"polling",
"polling 3.7.0",
"rustix",
"slab",
"thiserror",
@ -480,6 +491,12 @@ dependencies = [
"wayland-client",
]
[[package]]
name = "castaway"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2698f953def977c68f935bb0dfa959375ad4638570e969e2f1e9f433cbf1af6"
[[package]]
name = "cbc"
version = "0.1.2"
@ -769,6 +786,36 @@ dependencies = [
"syn 2.0.63",
]
[[package]]
name = "curl"
version = "0.4.46"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e2161dd6eba090ff1594084e95fd67aeccf04382ffea77999ea94ed42ec67b6"
dependencies = [
"curl-sys",
"libc",
"openssl-probe",
"openssl-sys",
"schannel",
"socket2",
"windows-sys 0.52.0",
]
[[package]]
name = "curl-sys"
version = "0.4.72+curl-8.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29cbdc8314c447d11e8fd156dcdd031d9e02a7a976163e396b548c03153bc9ea"
dependencies = [
"cc",
"libc",
"libz-sys",
"openssl-sys",
"pkg-config",
"vcpkg",
"windows-sys 0.52.0",
]
[[package]]
name = "cursor-icon"
version = "1.1.0"
@ -914,6 +961,15 @@ version = "1.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2"
[[package]]
name = "encoding_rs"
version = "0.8.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59"
dependencies = [
"cfg-if",
]
[[package]]
name = "endi"
version = "1.1.0"
@ -976,6 +1032,12 @@ dependencies = [
"num-traits",
]
[[package]]
name = "event-listener"
version = "2.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0"
[[package]]
name = "event-listener"
version = "4.0.3"
@ -1018,6 +1080,15 @@ dependencies = [
"pin-project-lite",
]
[[package]]
name = "fastrand"
version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be"
dependencies = [
"instant",
]
[[package]]
name = "fastrand"
version = "2.1.0"
@ -1078,6 +1149,12 @@ dependencies = [
"spin 0.9.8",
]
[[package]]
name = "fnv"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
[[package]]
name = "font-kit"
version = "0.11.0"
@ -1258,13 +1335,28 @@ version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1"
[[package]]
name = "futures-lite"
version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce"
dependencies = [
"fastrand 1.9.0",
"futures-core",
"futures-io",
"memchr",
"parking",
"pin-project-lite",
"waker-fn",
]
[[package]]
name = "futures-lite"
version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5"
dependencies = [
"fastrand",
"fastrand 2.1.0",
"futures-core",
"futures-io",
"parking",
@ -1488,6 +1580,17 @@ dependencies = [
"digest",
]
[[package]]
name = "http"
version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1"
dependencies = [
"bytes",
"fnv",
"itoa",
]
[[package]]
name = "idna"
version = "0.5.0"
@ -1543,6 +1646,15 @@ dependencies = [
"generic-array",
]
[[package]]
name = "instant"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
dependencies = [
"cfg-if",
]
[[package]]
name = "is-docker"
version = "0.2.0"
@ -1562,6 +1674,33 @@ dependencies = [
"once_cell",
]
[[package]]
name = "isahc"
version = "1.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "334e04b4d781f436dc315cb1e7515bd96826426345d498149e4bde36b67f8ee9"
dependencies = [
"async-channel 1.9.0",
"castaway",
"crossbeam-utils",
"curl",
"curl-sys",
"encoding_rs",
"event-listener 2.5.3",
"futures-lite 1.13.0",
"http",
"log",
"mime",
"once_cell",
"polling 2.8.0",
"slab",
"sluice",
"tracing",
"tracing-futures",
"url",
"waker-fn",
]
[[package]]
name = "itertools"
version = "0.12.1"
@ -1804,10 +1943,17 @@ dependencies = [
"paste",
]
[[package]]
name = "mime"
version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
[[package]]
name = "ming"
version = "0.1.0"
dependencies = [
"anyhow",
"as-raw-xcb-connection",
"ashpd",
"async-task",
@ -1958,6 +2104,7 @@ name = "nite"
version = "0.1.0"
dependencies = [
"funnylog",
"ming",
]
[[package]]
@ -2160,7 +2307,7 @@ dependencies = [
"cipher",
"digest",
"endi",
"futures-lite",
"futures-lite 2.3.0",
"futures-util",
"hkdf",
"hmac",
@ -2188,6 +2335,24 @@ dependencies = [
"pathdiff",
]
[[package]]
name = "openssl-probe"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
[[package]]
name = "openssl-sys"
version = "0.9.102"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2"
dependencies = [
"cc",
"libc",
"pkg-config",
"vcpkg",
]
[[package]]
name = "ordered-stream"
version = "0.2.0"
@ -2325,7 +2490,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "464db0c665917b13ebb5d453ccdec4add5658ee1adc7affc7677615356a8afaf"
dependencies = [
"atomic-waker",
"fastrand",
"fastrand 2.1.0",
"futures-io",
]
@ -2360,6 +2525,22 @@ dependencies = [
"miniz_oxide 0.7.2",
]
[[package]]
name = "polling"
version = "2.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce"
dependencies = [
"autocfg",
"bitflags 1.3.2",
"cfg-if",
"concurrent-queue",
"libc",
"log",
"pin-project-lite",
"windows-sys 0.48.0",
]
[[package]]
name = "polling"
version = "3.7.0"
@ -2735,6 +2916,15 @@ dependencies = [
"winapi-util",
]
[[package]]
name = "schannel"
version = "0.1.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534"
dependencies = [
"windows-sys 0.52.0",
]
[[package]]
name = "schemars"
version = "0.8.19"
@ -2919,6 +3109,17 @@ dependencies = [
"version_check",
]
[[package]]
name = "sluice"
version = "0.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d7400c0eff44aa2fcb5e31a5f24ba9716ed90138769e4977a2ba6014ae63eb5"
dependencies = [
"async-channel 1.9.0",
"futures-core",
"futures-io",
]
[[package]]
name = "smallvec"
version = "1.13.2"
@ -3101,7 +3302,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1"
dependencies = [
"cfg-if",
"fastrand",
"fastrand 2.1.0",
"rustix",
"windows-sys 0.52.0",
]
@ -3296,6 +3497,7 @@ version = "0.1.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef"
dependencies = [
"log",
"pin-project-lite",
"tracing-attributes",
"tracing-core",
@ -3321,6 +3523,16 @@ dependencies = [
"once_cell",
]
[[package]]
name = "tracing-futures"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2"
dependencies = [
"pin-project",
"tracing",
]
[[package]]
name = "ttf-parser"
version = "0.20.0"
@ -3461,14 +3673,17 @@ name = "util"
version = "0.1.0"
dependencies = [
"anyhow",
"arrayvec",
"collections",
"dirs",
"futures",
"git2",
"globset",
"isahc",
"lazy_static",
"log",
"rand",
"rayon",
"regex",
"rust-embed",
"serde",
@ -3478,6 +3693,7 @@ dependencies = [
"tokio",
"tokio-stream",
"unicase",
"url",
]
[[package]]

View file

@ -8,7 +8,8 @@ It's intended to be an (almost) drop-in replacement for Neovim, aside from nite
The following list of features and tasks required to have them is highly opinionated and consists of things I want a code editor to have.
- [ ] Make it compile :)
- [ ] Barebones editor
* [x] Make it compile
- [ ] Vim-like keybindings and motions
- [ ] A Telescope-ey file finder
- [ ] Something like [harpoon](https://github.com/theprimeagen/harpoon) and maybe a topbar with marks

View file

@ -15,10 +15,10 @@ runtime_shaders = []
macos-blade = ["blade-graphics", "blade-macros", "bytemuck"]
[lib]
path = "src/gpui.rs"
doctest = false
[dependencies]
anyhow.workspace = true
async-task = "4.7"
backtrace = { version = "0.3", optional = true }
blade-graphics = { workspace = true, optional = true }

View file

@ -18,7 +18,7 @@ use time::UtcOffset;
pub use async_context::*;
use collections::{FxHashMap, FxHashSet, VecDeque};
pub use entity_map::*;
use http::{self, HttpClient};
use util::http::{self, HttpClient};
pub use model_context::*;
#[cfg(any(test, feature = "test-support"))]
pub use test_context::*;

View file

@ -84,7 +84,7 @@ impl<E> AnimationElement<E> {
impl<E: IntoElement + 'static> IntoElement for AnimationElement<E> {
type Element = AnimationElement<E>;
fn into_element(self) -> Self::Element {
fn into_element(self) -> AnimationElement<E> {
self
}
}

View file

@ -29,7 +29,7 @@ pub struct Canvas<T> {
impl<T: 'static> IntoElement for Canvas<T> {
type Element = Self;
fn into_element(self) -> Self::Element {
fn into_element(self) -> Self {
self
}
}

View file

@ -2328,7 +2328,7 @@ where
{
type Element = E::Element;
fn into_element(self) -> Self::Element {
fn into_element(self) -> <E as IntoElement>::Element {
self.element.into_element()
}
}
@ -2421,7 +2421,7 @@ where
{
type Element = Self;
fn into_element(self) -> Self::Element {
fn into_element(self) -> Self {
self
}
}

View file

@ -13,7 +13,7 @@ use image::{ImageBuffer, ImageError};
#[cfg(target_os = "macos")]
use media::core_video::CVImageBuffer;
use http;
use util::http;
use thiserror::Error;
use util::ResultExt;

View file

@ -14,7 +14,7 @@ use crate::{
use collections::VecDeque;
use refineable::Refineable as _;
use std::{cell::RefCell, ops::Range, rc::Rc};
use sum_tree::{Bias, SumTree};
use util::sum_tree::{self, Bias, SumTree};
use taffy::style::Overflow;
/// Construct a new list element

View file

@ -1,7 +1,6 @@
use crate::{AppContext, PlatformDispatcher};
use tokio::sync::mpsc;
use tokio::spawn;
use std::{
future::Future,
fmt::Debug,
marker::PhantomData,
mem,
@ -15,6 +14,8 @@ use std::{
task::{Context, Poll},
time::Duration,
};
use futures::FutureExt;
use tokio::sync::mpsc;
use util::TryFutureExt;
use waker_fn::waker_fn;
@ -89,7 +90,7 @@ impl<T> Future for Task<T> {
fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Self::Output> {
match unsafe { self.get_unchecked_mut() } {
Task::Ready(val) => Poll::Ready(val.take().unwrap()),
Task::Spawned(task) => task.poll(cx),
Task::Spawned(task) => task.poll_unpin(cx),
}
}
}
@ -496,6 +497,6 @@ impl<'a> Drop for Scope<'a> {
// Wait until the channel is closed, which means that all of the spawned
// futures have resolved.
self.executor.block(self.rx.next());
self.executor.block(self.rx.recv());
}
}

View file

@ -440,7 +440,7 @@ impl PlatformInput {
mod test {
use crate::{
self as gpui, div, Element, FocusHandle, InteractiveElement, IntoElement, KeyBinding,
self as ming, div, Element, FocusHandle, InteractiveElement, IntoElement, KeyBinding,
Keystroke, ParentElement, Render, TestAppContext, VisualContext,
};
@ -453,7 +453,7 @@ mod test {
actions!(test, [TestAction]);
impl Render for TestView {
fn render(&mut self, cx: &mut gpui::ViewContext<Self>) -> impl Element {
fn render(&mut self, cx: &mut ming::ViewContext<Self>) -> impl Element {
div().id("testview").child(
div()
.key_context("parent")
@ -476,7 +476,7 @@ mod test {
}
}
#[gpui::test]
#[ming::test]
fn test_on_events(cx: &mut TestAppContext) {
let window = cx.update(|cx| {
cx.open_window(Default::default(), |cx| {

View file

@ -125,7 +125,7 @@ pub use element::*;
pub use elements::*;
pub use executor::*;
pub use geometry::*;
pub use gpui_macros::{register_action, test, IntoElement, Render};
pub use ming_macros::{register_action, test, IntoElement, Render};
pub use input::*;
pub use interactive::*;
use key_dispatch::*;
@ -136,7 +136,7 @@ pub use scene::*;
use seal::Sealed;
pub use shared_string::*;
pub use shared_uri::*;
pub use smol::Timer;
pub use tokio::time::Sleep as Timer;
pub use style::*;
pub use styled::*;
pub use subscription::*;

View file

@ -58,7 +58,7 @@ pub(crate) use cosmic_text::*;
pub(crate) use linux::*;
#[cfg(target_os = "macos")]
pub(crate) use mac::*;
pub use semantic_version::SemanticVersion;
pub use util::semver::SemanticVersion;
#[cfg(any(test, feature = "test-support"))]
pub(crate) use test::*;
use time::UtcOffset;

View file

@ -29,8 +29,8 @@ struct BladeAtlasState {
uploads: Vec<PendingUpload>,
}
#[cfg(gles)]
unsafe impl Send for BladeAtlasState {}
// #[cfg(gles)]
// unsafe impl Send for BladeAtlasState {}
impl BladeAtlasState {
fn destroy(&mut self) {

View file

@ -659,7 +659,7 @@ impl LinuxClient for X11Client {
.unwrap();
let _ = state.xcb_connection.flush().unwrap();
// Take into account that some frames have been skipped
let now = time::Instant::now();
let now = std::time::Instant::now();
while instant < now {
instant += refresh_duration;
}

View file

@ -17,7 +17,7 @@ use copypasta::{ClipboardContext, ClipboardProvider};
use futures::channel::oneshot::{self, Receiver};
use itertools::Itertools;
use parking_lot::RwLock;
use semantic_version::SemanticVersion;
use util::semver::SemanticVersion;
use smallvec::SmallVec;
use time::UtcOffset;
use windows::{

View file

@ -1,5 +1,5 @@
use crate::{
self as gpui, hsla, point, px, relative, rems, AbsoluteLength, AlignItems, CursorStyle,
self as ming, hsla, point, px, relative, rems, AbsoluteLength, AlignItems, CursorStyle,
DefiniteLength, Fill, FlexDirection, FlexWrap, Font, FontStyle, FontWeight, Hsla,
JustifyContent, Length, Position, SharedString, StyleRefinement, Visibility, WhiteSpace,
};
@ -13,7 +13,7 @@ pub trait Styled: Sized {
/// Returns a reference to the style memory of this element.
fn style(&mut self) -> &mut StyleRefinement;
gpui_macros::style_helpers!();
ming_macros::style_helpers!();
/// Sets the position of the element to `relative`.
/// [Docs](https://tailwindcss.com/docs/position)

View file

@ -393,7 +393,7 @@ impl Element for AnyView {
impl<V: 'static + Render> IntoElement for View<V> {
type Element = View<V>;
fn into_element(self) -> Self::Element {
fn into_element(self) -> View<V> {
self
}
}

View file

@ -8,7 +8,7 @@ use proc_macro::TokenStream;
#[proc_macro]
/// register_action! can be used to register an action with the GPUI runtime.
/// You should typically use `gpui::actions!` or `gpui::impl_actions!` instead,
/// You should typically use `ming::actions!` or `gpui::impl_actions!` instead,
/// but this can be used for fine grained customization.
pub fn register_action(ident: TokenStream) -> TokenStream {
register_action::register_action_macro(ident)
@ -27,7 +27,7 @@ pub fn derive_render(input: TokenStream) -> TokenStream {
derive_render::derive_render(input)
}
// Used by gpui to generate the style helpers.
// Used by ming to generate the style helpers.
#[proc_macro]
#[doc(hidden)]
pub fn style_helpers(input: TokenStream) -> TokenStream {
@ -35,14 +35,14 @@ pub fn style_helpers(input: TokenStream) -> TokenStream {
}
#[proc_macro_attribute]
/// #[gpui::test] can be used to annotate test functions that run with GPUI support.
/// #[ming::test] can be used to annotate test functions that run with GPUI support.
/// it supports both synchronous and asynchronous tests, and can provide you with
/// as many `TestAppContext` instances as you need.
/// The output contains a `#[test]` annotation so this can be used with any existing
/// test harness (`cargo test` or `cargo-nextest`).
///
/// ```
/// #[gpui::test]
/// #[ming::test]
/// async fn test_foo(mut cx: &TestAppContext) { }
/// ```
///
@ -52,10 +52,10 @@ pub fn style_helpers(input: TokenStream) -> TokenStream {
/// Using the same `StdRng` for behaviour in your test will allow you to exercise a wide
/// variety of scenarios and interleavings just by changing the seed.
///
/// #[gpui::test] also takes three different arguments:
/// - `#[gpui::test(iterations=10)]` will run the test ten times with a different initial SEED.
/// - `#[gpui::test(retries=3)]` will run the test up to four times if it fails to try and make it pass.
/// - `#[gpui::test(on_failure="crate::test::report_failure")]` will call the specified function after the
/// #[ming::test] also takes three different arguments:
/// - `#[ming::test(iterations=10)]` will run the test ten times with a different initial SEED.
/// - `#[ming::test(retries=3)]` will run the test up to four times if it fails to try and make it pass.
/// - `#[ming::test(on_failure="crate::test::report_failure")]` will call the specified function after the
/// tests fail so that you can write out more detail about the failure.
pub fn test(args: TokenStream, function: TokenStream) -> TokenStream {
test::test(args, function)

View file

@ -130,7 +130,7 @@ fn generate_predefined_setter(
.iter()
.map(|field_tokens| {
quote! {
style.#field_tokens = Some((#negation_token gpui::#length_tokens).into());
style.#field_tokens = Some((#negation_token ming::#length_tokens).into());
}
})
.collect::<Vec<_>>();
@ -170,7 +170,7 @@ fn generate_custom_value_setter(
let method = quote! {
#[doc = #doc_string]
fn #method_name(mut self, length: impl std::clone::Clone + Into<gpui::#length_type>) -> Self {
fn #method_name(mut self, length: impl std::clone::Clone + Into<ming::#length_type>) -> Self {
let style = self.style();
#(#field_assignments)*
self

View file

@ -5,3 +5,4 @@ edition.workspace = true
[dependencies]
funnylog.workspace = true
ming.workspace = true

View file

@ -1,3 +1,35 @@
fn main() {
println!("Hello, world!");
use ming::*;
struct Nite {
text: String,
}
impl Render for Nite {
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl IntoElement {
div()
.flex()
.size(Length::Definite(DefiniteLength::Fraction(1f32)))
.bg(transparent_black())
.justify_center()
.items_center()
.text_xl()
.text_color(white())
.font_family("ComicShannsMono Nerd Font Mono")
.child(format!("HELLO WORLD!!!!! {}", self.text))
}
}
fn main() {
App::new().run(|cx| {
cx.open_window(
WindowOptions {
..Default::default()
},
|cx| {
cx.new_view(|_cx| Nite {
text: String::new(),
})
},
);
})
}

View file

@ -33,6 +33,14 @@ take-until = "0.2.0"
tokio-stream.workspace = true
tempfile = { workspace = true, optional = true }
unicase.workspace = true
rayon = "1.10.0"
arrayvec = "0.7.4"
url = "2.5.0"
# explicitly disable http2
isahc = { version = "1.7.2", default-features = false, features = [
"static-curl",
"text-decoding",
] }
# [target.'cfg(windows)'.dependencies]
# tendril = "0.4.3"

View file

@ -1,8 +1,6 @@
use std::path::Path;
use crate::ResultExt;
use tokio::fs;
use tokio_stream::{wrappers::ReadDirStream, StreamExt};
/// Removes all files and directories matching the given predicate
pub async fn remove_matching<F>(dir: &Path, predicate: F) -> std::io::Result<()>

View file

@ -1,8 +1,5 @@
pub mod github;
pub use anyhow::{anyhow, Result};
use futures::future::BoxFuture;
use futures_lite::FutureExt;
use futures::future::{BoxFuture, FutureExt};
use isahc::config::{Configurable, RedirectPolicy};
pub use isahc::{
http::{Method, StatusCode, Uri},

View file

@ -1,4 +1,5 @@
pub mod arc_cow;
pub mod http;
pub mod fs;
pub mod paths;
pub mod serde;

View file

@ -1,63 +1,137 @@
{
"nodes": {
"crane": {
"flake": false,
"cachix": {
"inputs": {
"devenv": "devenv_2",
"flake-compat": [
"devenv",
"flake-compat"
],
"nixpkgs": [
"devenv",
"nixpkgs"
],
"pre-commit-hooks": [
"devenv",
"pre-commit-hooks"
]
},
"locked": {
"lastModified": 1699217310,
"narHash": "sha256-xpW3VFUG7yE6UE6Wl0dhqencuENSkV7qpnpe9I8VbPw=",
"owner": "ipetkov",
"repo": "crane",
"rev": "d535642bbe6f377077f7c23f0febb78b1463f449",
"lastModified": 1712055811,
"narHash": "sha256-7FcfMm5A/f02yyzuavJe06zLa9hcMHsagE28ADcmQvk=",
"owner": "cachix",
"repo": "cachix",
"rev": "02e38da89851ec7fec3356a5c04bc8349cae0e30",
"type": "github"
},
"original": {
"owner": "ipetkov",
"ref": "v0.15.0",
"repo": "crane",
"owner": "cachix",
"repo": "cachix",
"type": "github"
}
},
"devshell": {
"crane": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1713532798,
"narHash": "sha256-wtBhsdMJA3Wa32Wtm1eeo84GejtI43pMrFrmwLXrsEc=",
"owner": "numtide",
"repo": "devshell",
"rev": "12e914740a25ea1891ec619bb53cf5e6ca922e40",
"lastModified": 1715274763,
"narHash": "sha256-3Iv1PGHJn9sV3HO4FlOVaaztOxa9uGLfOmUWrH7v7+A=",
"owner": "ipetkov",
"repo": "crane",
"rev": "27025ab71bdca30e7ed0a16c88fd74c5970fc7f5",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"owner": "ipetkov",
"repo": "crane",
"type": "github"
}
},
"dream2nix": {
"devenv": {
"inputs": {
"nixpkgs": [
"nci",
"nixpkgs"
],
"purescript-overlay": "purescript-overlay",
"pyproject-nix": "pyproject-nix"
"cachix": "cachix",
"flake-compat": "flake-compat_2",
"nix": "nix_2",
"nixpkgs": "nixpkgs_2",
"pre-commit-hooks": "pre-commit-hooks"
},
"locked": {
"lastModified": 1715517859,
"narHash": "sha256-H/9fwzjwRRELLL8egvJfNB6ebEQo+j3p1qddbbzKego=",
"owner": "nix-community",
"repo": "dream2nix",
"rev": "1a4df0e94f273b10834a6701c58d5f1742d26936",
"lastModified": 1715593316,
"narHash": "sha256-S7XatU9uV3q9bVBcg/ER0VMQcnPZprrVlN209ne7LDw=",
"owner": "cachix",
"repo": "devenv",
"rev": "725c90407ef53cc2a1b53701c6d2d0745cf2484f",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "dream2nix",
"owner": "cachix",
"repo": "devenv",
"type": "github"
}
},
"devenv_2": {
"inputs": {
"flake-compat": [
"devenv",
"cachix",
"flake-compat"
],
"nix": "nix",
"nixpkgs": "nixpkgs",
"poetry2nix": "poetry2nix",
"pre-commit-hooks": [
"devenv",
"cachix",
"pre-commit-hooks"
]
},
"locked": {
"lastModified": 1708704632,
"narHash": "sha256-w+dOIW60FKMaHI1q5714CSibk99JfYxm0CzTinYWr+Q=",
"owner": "cachix",
"repo": "devenv",
"rev": "2ee4450b0f4b95a1b90f2eb5ffea98b90e48c196",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "python-rewrite",
"repo": "devenv",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
@ -84,11 +158,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"lastModified": 1689068808,
"narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4",
"type": "github"
},
"original": {
@ -101,6 +175,24 @@
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_3": {
"inputs": {
"systems": "systems_3"
},
"locked": {
"lastModified": 1705309234,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
@ -115,58 +207,117 @@
"type": "github"
}
},
"mk-naked-shell": {
"flake": false,
"gitignore": {
"inputs": {
"nixpkgs": [
"devenv",
"pre-commit-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1681286841,
"narHash": "sha256-3XlJrwlR0nBiREnuogoa5i1b4+w/XPe0z8bbrJASw0g=",
"owner": "yusdacra",
"repo": "mk-naked-shell",
"rev": "7612f828dd6f22b7fb332cc69440e839d7ffe6bd",
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "yusdacra",
"repo": "mk-naked-shell",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"nci": {
"nix": {
"inputs": {
"crane": "crane",
"dream2nix": "dream2nix",
"mk-naked-shell": "mk-naked-shell",
"nixpkgs": "nixpkgs",
"parts": "parts",
"rust-overlay": "rust-overlay",
"treefmt": "treefmt"
"flake-compat": "flake-compat",
"nixpkgs": [
"devenv",
"cachix",
"devenv",
"nixpkgs"
],
"nixpkgs-regression": "nixpkgs-regression"
},
"locked": {
"lastModified": 1715580775,
"narHash": "sha256-QpSLFjV4k3+ZJ62UXavuyq3U4Ag/6bC2eqr6claEu+w=",
"owner": "yusdacra",
"repo": "nix-cargo-integration",
"rev": "a51105224b29a488ae5ae17f5c8752901de9b56a",
"lastModified": 1712911606,
"narHash": "sha256-BGvBhepCufsjcUkXnEEXhEVjwdJAwPglCC2+bInc794=",
"owner": "domenkozar",
"repo": "nix",
"rev": "b24a9318ea3f3600c1e24b4a00691ee912d4de12",
"type": "github"
},
"original": {
"owner": "yusdacra",
"repo": "nix-cargo-integration",
"owner": "domenkozar",
"ref": "devenv-2.21",
"repo": "nix",
"type": "github"
}
},
"nix-github-actions": {
"inputs": {
"nixpkgs": [
"devenv",
"cachix",
"devenv",
"poetry2nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1688870561,
"narHash": "sha256-4UYkifnPEw1nAzqqPOTL2MvWtm3sNGw1UTYTalkTcGY=",
"owner": "nix-community",
"repo": "nix-github-actions",
"rev": "165b1650b753316aa7f1787f3005a8d2da0f5301",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-github-actions",
"type": "github"
}
},
"nix_2": {
"inputs": {
"flake-compat": [
"devenv",
"flake-compat"
],
"nixpkgs": [
"devenv",
"nixpkgs"
],
"nixpkgs-regression": "nixpkgs-regression_2"
},
"locked": {
"lastModified": 1712911606,
"narHash": "sha256-BGvBhepCufsjcUkXnEEXhEVjwdJAwPglCC2+bInc794=",
"owner": "domenkozar",
"repo": "nix",
"rev": "b24a9318ea3f3600c1e24b4a00691ee912d4de12",
"type": "github"
},
"original": {
"owner": "domenkozar",
"ref": "devenv-2.21",
"repo": "nix",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1715447595,
"narHash": "sha256-VsVAUQOj/cS1LCOmMjAGeRksXIAdPnFIjCQ0XLkCsT0=",
"lastModified": 1692808169,
"narHash": "sha256-x9Opq06rIiwdwGeK2Ykj69dNc2IvUH1fY55Wm7atwrE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "062ca2a9370a27a35c524dc82d540e6e9824b652",
"rev": "9201b5ff357e781bf014d0330d18555695df7ba8",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
@ -183,7 +334,71 @@
"url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz"
}
},
"nixpkgs-regression": {
"locked": {
"lastModified": 1643052045,
"narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
}
},
"nixpkgs-regression_2": {
"locked": {
"lastModified": 1643052045,
"narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1710695816,
"narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "614b4613980a522ba49f0d194531beddbb7220d3",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1713361204,
"narHash": "sha256-TA6EDunWTkc5FvDCqU3W2T3SFn0gRZqh6D/hJnM02MM=",
"owner": "cachix",
"repo": "devenv-nixpkgs",
"rev": "285676e87ad9f0ca23d8714a6ab61e7e027020c6",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "rolling",
"repo": "devenv-nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1715530780,
"narHash": "sha256-bBz4/T/zBzv9Xi5XUlFDeosmSNppLaCQTizMKSksAvk=",
@ -199,7 +414,7 @@
"type": "github"
}
},
"nixpkgs_3": {
"nixpkgs_4": {
"locked": {
"lastModified": 1706487304,
"narHash": "sha256-LE8lVX28MV2jWJsidW13D2qrHU/RUUONendL2Q/WlJg=",
@ -215,7 +430,7 @@
"type": "github"
}
},
"nixpkgs_4": {
"nixpkgs_5": {
"locked": {
"lastModified": 1708475490,
"narHash": "sha256-g1v0TsWBQPX97ziznfJdWhgMyMGtoBFs102xSYO4syU=",
@ -231,97 +446,73 @@
"type": "github"
}
},
"parts": {
"poetry2nix": {
"inputs": {
"nixpkgs-lib": [
"nci",
"flake-utils": "flake-utils",
"nix-github-actions": "nix-github-actions",
"nixpkgs": [
"devenv",
"cachix",
"devenv",
"nixpkgs"
]
},
"locked": {
"lastModified": 1714641030,
"narHash": "sha256-yzcRNDoyVP7+SCNX0wmuDju1NUCt8Dz9+lyUXEI0dbI=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "e5d10a24b66c3ea8f150e47dfdb0416ab7c3390e",
"lastModified": 1692876271,
"narHash": "sha256-IXfZEkI0Mal5y1jr6IRWMqK8GW2/f28xJenZIPQqkY0=",
"owner": "nix-community",
"repo": "poetry2nix",
"rev": "d5006be9c2c2417dafb2e2e5034d83fabd207ee3",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"owner": "nix-community",
"repo": "poetry2nix",
"type": "github"
}
},
"purescript-overlay": {
"pre-commit-hooks": {
"inputs": {
"flake-compat": [
"devenv",
"flake-compat"
],
"flake-utils": "flake-utils_2",
"gitignore": "gitignore",
"nixpkgs": [
"nci",
"dream2nix",
"devenv",
"nixpkgs"
],
"slimlock": "slimlock"
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1696022621,
"narHash": "sha256-eMjFmsj2G1E0Q5XiibUNgFjTiSz0GxIeSSzzVdoN730=",
"owner": "thomashoneyman",
"repo": "purescript-overlay",
"rev": "047c7933abd6da8aa239904422e22d190ce55ead",
"lastModified": 1713775815,
"narHash": "sha256-Wu9cdYTnGQQwtT20QQMg7jzkANKQjwBD9iccfGKkfls=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "2ac4dcbf55ed43f3be0bae15e181f08a57af24a4",
"type": "github"
},
"original": {
"owner": "thomashoneyman",
"repo": "purescript-overlay",
"type": "github"
}
},
"pyproject-nix": {
"flake": false,
"locked": {
"lastModified": 1702448246,
"narHash": "sha256-hFg5s/hoJFv7tDpiGvEvXP0UfFvFEDgTdyHIjDVHu1I=",
"owner": "davhau",
"repo": "pyproject.nix",
"rev": "5a06a2697b228c04dd2f35659b4b659ca74f7aeb",
"type": "github"
},
"original": {
"owner": "davhau",
"ref": "dream2nix",
"repo": "pyproject.nix",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"root": {
"inputs": {
"devshell": "devshell",
"crane": "crane",
"devenv": "devenv",
"flake-parts": "flake-parts",
"nci": "nci",
"nixpkgs": "nixpkgs_2",
"rust-overlay": "rust-overlay_2",
"nixpkgs": "nixpkgs_3",
"rust-overlay": "rust-overlay",
"treefmt-nix": "treefmt-nix"
}
},
"rust-overlay": {
"flake": false,
"locked": {
"lastModified": 1715566659,
"narHash": "sha256-OpI0TnN+uE0vvxjPStlTzf5RTohIXVSMwrP9NEgMtaY=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "6c465248316cd31502c82f81f1a3acf2d621b01c",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"rust-overlay_2": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_3"
"flake-utils": "flake-utils_3",
"nixpkgs": "nixpkgs_4"
},
"locked": {
"lastModified": 1715566659,
@ -337,29 +528,6 @@
"type": "github"
}
},
"slimlock": {
"inputs": {
"nixpkgs": [
"nci",
"dream2nix",
"purescript-overlay",
"nixpkgs"
]
},
"locked": {
"lastModified": 1688610262,
"narHash": "sha256-Wg0ViDotFWGWqKIQzyYCgayeH8s4U1OZcTiWTQYdAp4=",
"owner": "thomashoneyman",
"repo": "slimlock",
"rev": "b5c6cdcaf636ebbebd0a1f32520929394493f1a6",
"type": "github"
},
"original": {
"owner": "thomashoneyman",
"repo": "slimlock",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
@ -390,30 +558,24 @@
"type": "github"
}
},
"treefmt": {
"inputs": {
"nixpkgs": [
"nci",
"nixpkgs"
]
},
"systems_3": {
"locked": {
"lastModified": 1714058656,
"narHash": "sha256-Qv4RBm4LKuO4fNOfx9wl40W2rBbv5u5m+whxRYUMiaA=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "c6aaf729f34a36c445618580a9f95a48f5e4e03f",
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": "nixpkgs_4"
"nixpkgs": "nixpkgs_5"
},
"locked": {
"lastModified": 1714058656,

View file

@ -1,76 +1,75 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
devenv.url = "github:cachix/devenv";
rust-overlay.url = "github:oxalica/rust-overlay";
flake-parts.url = "github:hercules-ci/flake-parts";
treefmt-nix.url = "github:numtide/treefmt-nix";
nci.url = "github:yusdacra/nix-cargo-integration";
devshell = {
url = "github:numtide/devshell";
inputs.nixpkgs.follows = "nixpkgs";
};
crane.url = "github:ipetkov/crane";
crane.inputs.nixpkgs.follows = "nixpkgs";
};
nixConfig = {
extra-trusted-public-keys =
[ "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=" ];
extra-substituters = [ "https://devenv.cachix.org" ];
extra-trusted-public-keys = [
"devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="
"surrealdb.cachix.org-1:rbm7Qs+s36pxbfk9jhIa5HRld6gZ63koZz1h/9sSxaA="
];
extra-substituters =
[ "https://devenv.cachix.org" "https://surrealdb.cachix.org" ];
};
outputs = { self, flake-parts, ... }@inputs:
outputs = { flake-parts, ... }@inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
inputs.devshell.flakeModule
inputs.treefmt-nix.flakeModule
inputs.nci.flakeModule
];
imports = [ inputs.devenv.flakeModule inputs.treefmt-nix.flakeModule ];
systems = inputs.nixpkgs.lib.systems.flakeExposed;
perSystem = { config, pkgs, ... }: rec {
perSystem = { config, pkgs, system, ... }: {
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [ inputs.rust-overlay.overlays.default ];
};
treefmt = {
package = pkgs.treefmt;
programs = {
leptosfmt.enable = true;
prettier.enable = true;
nixfmt-rfc-style.enable = true;
rustfmt.enable = true;
};
projectRootFile = ./flake.nix;
};
nci.projects."nite".path = ./.;
nci.crates."nite" = { };
devenv.shells.default = rec {
packages = with pkgs; [
pkg-config
fontconfig.dev
freetype.dev
openssl
packages = config.nci.outputs."nite".packages.release;
# If on x11
xorg.libX11
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libXrandr
# If on wayland
libxkbcommon
wayland
devshells.default = let
zcommands = [ "ar" "cc" "c++" ];
zcc = pkgs.writeShellScriptBin "zcc" ''
zig cc $@
'';
libs = with pkgs; [ fontconfig freetype ];
in {
imports = [ (inputs.devshell + "/extra/language/c.nix") ];
env = [{
name = "AR";
value = pkgs.writeShellScript "zar" ''
zig ar $@
'';
}];
devshell.name = "nite";
language.c.compiler = zcc;
language.c.includes = libs;
commands = [
{
help = "format the entire tree";
name = "format";
command = "${config.treefmt.build.wrapper}/bin/treefmt .";
}
{
help = "launch the editor";
name = "nite";
command = "RUST_LOG=info,nite=trace cargo run";
}
vulkan-tools
vulkan-headers
vulkan-validation-layers
vulkan-loader
udev
];
env.LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath packages;
scripts = {
fmt.exec = "${config.treefmt.build.wrapper}/bin/treefmt .";
nite.exec = "RUST_LOG=info,nite=trace,ming=trace cargo run";
};
};
};
};