Compare commits

...

5 commits

Author SHA1 Message Date
4e2d3d51c9
why is rustfmt so silly ;w; 2026-04-14 15:18:00 +10:00
6ae76c571d
remove unused exports 2026-04-14 15:16:33 +10:00
28a9dc6e80
do not export inner_ref/store_ref fns 2026-04-14 15:16:17 +10:00
b0d1f5ae82
add feature "all" 2026-04-14 14:45:16 +10:00
938a8662d4
update upstream to github 2026-04-14 14:45:05 +10:00
9 changed files with 33 additions and 35 deletions

View file

@ -1,9 +1,10 @@
# REF: https://github.com/rust-lang/rustfmt/blob/main/Configurations.md # REF: https://github.com/rust-lang/rustfmt/blob/main/Configurations.md
unstable_features = true
array_width = 60 array_width = 60
attr_fn_like_width = 70 attr_fn_like_width = 70
binop_separator = "Front" # Front|Back binop_separator = "Front" # Front|Back
blank_lines_lower_bound = 1 blank_lines_lower_bound = 1
black_lines_upper_bound = 1 blank_lines_upper_bound = 1
brace_style = "SameLineWhere" # AlwaysNextLine|PreferSameLine|SameLineWhere brace_style = "SameLineWhere" # AlwaysNextLine|PreferSameLine|SameLineWhere
chain_width = 60 chain_width = 60
color = "Auto" # Auto|Always|Never color = "Auto" # Auto|Always|Never
@ -15,8 +16,8 @@ disable_all_formatting = false # hell no
edition = "2024" # 2015|2018|2021|2024 edition = "2024" # 2015|2018|2021|2024
empty_item_single_line = true empty_item_single_line = true
enum_discrim_align_threshold = 20 enum_discrim_align_threshold = 20
error_on_line_overflow = false error_on_line_overflow = false # DEBUG
error_on_unformatted = true error_on_unformatted = false # DEBUG
fn_call_width = 60 fn_call_width = 60
fn_params_layout = "Tall" # Compressed|Tall|Vertical fn_params_layout = "Tall" # Compressed|Tall|Vertical
fn_single_line = true fn_single_line = true
@ -26,13 +27,13 @@ format_code_in_doc_comments = true
doc_comment_code_block_width = 100 doc_comment_code_block_width = 100
format_generated_files = true format_generated_files = true
generated_marker_line_search_limit = 5 generated_marker_line_search_limit = 5
format_macro_matches = true # format_macro_matches = true
format_macro_bodies = true format_macro_bodies = true
skip_macro_invocations = [] skip_macro_invocations = []
format_strings = true format_strings = true
hard_tabs = false # fuck tabs hard_tabs = false # fuck tabs
hex_literal_case = "Lower" # Preserve|Upper|Lower hex_literal_case = "Lower" # Preserve|Upper|Lower
float_literal_trailing_zero = "Never" # Preserve|Always|IfNoPostfix|Never # float_literal_trailing_zero = "Never" # Preserve|Always|IfNoPostfix|Never
show_parse_errors = true show_parse_errors = true
# ignore = [] # same format as .gitignore # ignore = [] # same format as .gitignore
imports_indent = "Block" # Block|Visual imports_indent = "Block" # Block|Visual
@ -41,7 +42,7 @@ indent_style = "Block" # Block|Visual
inline_attribute_width = 0 inline_attribute_width = 0
match_arm_blocks = true match_arm_blocks = true
match_arm_leading_pipes = "Never" # Preserve|Always|Never match_arm_leading_pipes = "Never" # Preserve|Always|Never
match_arm_indent = true # match_arm_indent = true
match_block_trailing_comma = true match_block_trailing_comma = true
max_width = 100 max_width = 100
merge_derives = true merge_derives = true
@ -72,7 +73,6 @@ tab_spaces = 4
trailing_comma = "Always" # Vertical|Always|Never trailing_comma = "Always" # Vertical|Always|Never
trailing_semicolon = true trailing_semicolon = true
type_punctuation_density = "Wide" # Compressed|Wide type_punctuation_density = "Wide" # Compressed|Wide
unstable_features = true
use_field_init_shorthand = true use_field_init_shorthand = true
use_small_heuristics = "Default" # Default|Off|Max use_small_heuristics = "Default" # Default|Off|Max
use_try_shorthand = true use_try_shorthand = true

View file

@ -1,18 +1,15 @@
[package] [package]
name = "nixide-sys" name = "nixide-sys"
description = "Unsafe direct FFI bindings to libnix C API" description = "Unsafe direct FFI bindings to the libnix C API"
version = "0.1.0" version = "0.1.0"
readme = "../README.md" readme = "../README.md"
license = "GPL-3.0" license = "GPL-3.0"
repository = "https://codeberg.org/luminary/nixide" repository = "https://github.com/cry128/nixide"
authors = [ "_cry64 <them@dobutterfliescry.net>" ] authors = [ "_cry64 <them@dobutterfliescry.net>" ]
edition = "2024" edition = "2024"
build = "build.rs" build = "build.rs"
[package.metadata.docs.rs]
targets = [ "x86_64-unknown-linux-gnu" ]
[lib] [lib]
path = "src/lib.rs" path = "src/lib.rs"
@ -20,6 +17,7 @@ path = "src/lib.rs"
# NOTE: shared libraries produced by the Nix C API. # NOTE: shared libraries produced by the Nix C API.
[features] [features]
default = [ "nix-util-c" ] default = [ "nix-util-c" ]
all = [ "nix-util-c", "nix-store-c", "nix-expr-c", "nix-fetchers-c", "nix-flake-c", "nix-main-c" ]
nix-util-c = [] nix-util-c = []
nix-store-c = [] nix-store-c = []
nix-expr-c = [] nix-expr-c = []

View file

@ -4,7 +4,7 @@ description = "Safe & oxidized bindings to the Nix API"
version = "0.1.0" version = "0.1.0"
readme = "../README.md" readme = "../README.md"
license = "GPL-3.0" license = "GPL-3.0"
repository = "https://codeberg.org/luminary/nixide" repository = "https://github.com/cry128/nixide"
authors = [ "_cry64 <them@dobutterfliescry.net>" ] authors = [ "_cry64 <them@dobutterfliescry.net>" ]
edition = "2024" edition = "2024"
build = "build.rs" build = "build.rs"
@ -14,6 +14,7 @@ path = "src/lib.rs"
[features] [features]
default = ["nix"] default = ["nix"]
all = ["nix", "store", "exprs", "flakes"]
nix = ["nixide-sys/nix-util-c", "nixide-sys/nix-main-c"] nix = ["nixide-sys/nix-util-c", "nixide-sys/nix-main-c"]
store = ["nix", "nixide-sys/nix-store-c"] store = ["nix", "nixide-sys/nix-store-c"]
exprs = ["store", "nixide-sys/nix-expr-c"] exprs = ["store", "nixide-sys/nix-expr-c"]

View file

@ -23,7 +23,6 @@
use std::ffi::CString; use std::ffi::CString;
use std::ffi::c_uint; use std::ffi::c_uint;
use std::ffi::c_void;
use std::ptr::NonNull; use std::ptr::NonNull;
use super::{NixError, NixideResult}; use super::{NixError, NixideResult};

View file

@ -49,12 +49,12 @@ impl EvalState {
} }
#[inline] #[inline]
pub fn inner_ref(&self) -> &Rc<RefCell<NonNull<sys::EvalState>>> { pub(crate) fn inner_ref(&self) -> &Rc<RefCell<NonNull<sys::EvalState>>> {
&self.inner &self.inner
} }
#[inline] #[inline]
pub fn store_ref(&self) -> &Rc<RefCell<Store>> { pub(crate) fn store_ref(&self) -> &Rc<RefCell<Store>> {
&self.store &self.store
} }

View file

@ -1,4 +1,4 @@
use std::ffi::{CString, c_char}; use std::ffi::CString;
use std::ptr::NonNull; use std::ptr::NonNull;
use crate::NixideResult; use crate::NixideResult;

View file

@ -1,4 +1,4 @@
use std::ffi::{CString, c_char}; use std::ffi::CString;
use std::ptr::{self, NonNull}; use std::ptr::{self, NonNull};
use super::FlakeRef; use super::FlakeRef;

View file

@ -1,4 +1,4 @@
use std::ffi::{CString, c_void}; use std::ffi::CString;
use std::path::Path; use std::path::Path;
use std::ptr::{self, NonNull, null_mut}; use std::ptr::{self, NonNull, null_mut};

View file

@ -1,4 +1,4 @@
use std::ffi::{CString, c_void}; use std::ffi::CString;
use crate::NixideResult; use crate::NixideResult;
use crate::errors::{ErrorContext, ToNixideResult as _}; use crate::errors::{ErrorContext, ToNixideResult as _};