{"id":13440005,"url":"https://github.com/nix-rust/nix","last_synced_at":"2025-05-12T05:13:22.105Z","repository":{"id":19488898,"uuid":"22734848","full_name":"nix-rust/nix","owner":"nix-rust","description":"Rust friendly bindings to *nix APIs","archived":false,"fork":false,"pushed_at":"2025-05-04T04:20:13.000Z","size":6234,"stargazers_count":2814,"open_issues_count":277,"forks_count":689,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-05-09T02:47:53.746Z","etag":null,"topics":["libc","rust","rust-bindings","unix"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nix-rust.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-08-07T20:03:36.000Z","updated_at":"2025-05-09T02:42:58.000Z","dependencies_parsed_at":"2023-01-16T21:45:36.186Z","dependency_job_id":"8818f675-f7d1-4aed-bc45-5bd757b6be66","html_url":"https://github.com/nix-rust/nix","commit_stats":{"total_commits":2322,"total_committers":431,"mean_commits":5.387470997679815,"dds":0.8023255813953488,"last_synced_commit":"33efb1a51f532c8b015d2ce78e062d16368edf78"},"previous_names":["carllerche/nix-rust"],"tags_count":57,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nix-rust%2Fnix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nix-rust%2Fnix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nix-rust%2Fnix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nix-rust%2Fnix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nix-rust","download_url":"https://codeload.github.com/nix-rust/nix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253497500,"owners_count":21917697,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["libc","rust","rust-bindings","unix"],"created_at":"2024-07-31T03:01:18.917Z","updated_at":"2025-05-11T02:49:14.646Z","avatar_url":"https://github.com/nix-rust.png","language":"Rust","readme":"# Rust bindings to *nix APIs\n\n[![Cirrus Build Status](https://api.cirrus-ci.com/github/nix-rust/nix.svg)](https://cirrus-ci.com/github/nix-rust/nix)\n[![crates.io](https://img.shields.io/crates/v/nix.svg)](https://crates.io/crates/nix)\n[![docs.rs](https://img.shields.io/badge/docs.rs-nix-blue?style=flat-square\u0026logo=docs.rs)](https://docs.rs/nix)\n![maintenance-status](https://img.shields.io/badge/maintenance-actively--developed-brightgreen.svg)\n[![msrv](https://img.shields.io/badge/msrv-1.69-blue?style=flat-square\u0026logo=rust)](https://www.rust-lang.org)\n\nNix seeks to provide friendly bindings to various *nix platform APIs (Linux, Darwin,\n...). The goal is to not provide a 100% unified interface, but to unify\nwhat can be while still providing platform specific APIs.\n\nFor many system APIs, Nix provides a safe alternative to the unsafe APIs\nexposed by the [libc crate](https://github.com/rust-lang/libc).  This is done by\nwrapping the libc functionality with types/abstractions that enforce legal/safe\nusage.\n\n\nAs an example of what Nix provides, examine the differences between what is\nexposed by libc and nix for the\n[gethostname](https://man7.org/linux/man-pages/man2/gethostname.2.html) system\ncall:\n\n```rust,ignore\n// libc api (unsafe, requires handling return code/errno)\npub unsafe extern fn gethostname(name: *mut c_char, len: size_t) -\u003e c_int;\n\n// nix api (returns a nix::Result\u003cOsString\u003e)\npub fn gethostname() -\u003e Result\u003cOsString\u003e;\n```\n\n## Supported Platforms\n\nnix target support consists of three tiers. While nix attempts to support all\nplatforms supported by [libc](https://github.com/rust-lang/libc), only some\nplatforms are actively supported due to either technical or manpower\nlimitations. Support for platforms is split into three tiers:\n\n  * Tier 1 - Builds and tests for this target are run in CI. Failures of either\n             block the inclusion of new code.\n  * Tier 2 - Builds for this target are run in CI. Failures during the build\n             blocks the inclusion of new code. Tests may be run, but failures\n             in tests don't block the inclusion of new code.\n  * Tier 3 - Builds for this target are run in CI. Failures during the build\n             *do not* necessarily block the inclusion of new code.  That is, at\n             our discretion a Tier 3 target may be dropped at any time, if it\n             would otherwise block development.\n\nPlatforms not listed are supported on a best-effort basis, relying on our users\nto report any problems.\n\nThe following targets are supported by `nix`:\n\n\u003ctable\u003e\n \u003ctr\u003e\n  \u003cth\u003eTier 1\u003c/th\u003e\n  \u003cth\u003eTier 2\u003c/th\u003e\n  \u003cth\u003eTier 3\u003c/th\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n  \u003ctd\u003e\n   \u003cul\u003e\n    \u003cli\u003eaarch64-apple-darwin\u003c/li\u003e\n    \u003cli\u003eaarch64-unknown-linux-gnu\u003c/li\u003e\n    \u003cli\u003earm-unknown-linux-gnueabi\u003c/li\u003e\n    \u003cli\u003earmv7-unknown-linux-gnueabihf\u003c/li\u003e\n    \u003cli\u003ei686-unknown-freebsd\u003c/li\u003e\n    \u003cli\u003ei686-unknown-linux-gnu\u003c/li\u003e\n    \u003cli\u003ei686-unknown-linux-musl\u003c/li\u003e\n    \u003cli\u003emips-unknown-linux-gnu\u003c/li\u003e\n    \u003cli\u003emips64-unknown-linux-gnuabi64\u003c/li\u003e\n    \u003cli\u003emips64el-unknown-linux-gnuabi64\u003c/li\u003e\n    \u003cli\u003emipsel-unknown-linux-gnu\u003c/li\u003e\n    \u003cli\u003epowerpc64le-unknown-linux-gnu\u003c/li\u003e\n    \u003cli\u003ex86_64-unknown-freebsd\u003c/li\u003e\n    \u003cli\u003ex86_64-unknown-linux-gnu\u003c/li\u003e\n    \u003cli\u003ex86_64-unknown-linux-musl\u003c/li\u003e\n   \u003c/ul\u003e\n  \u003c/td\u003e\n  \u003ctd\u003e\n   \u003cul\u003e\n    \u003cli\u003eaarch64-apple-ios\u003c/li\u003e\n    \u003cli\u003eaarch64-linux-android\u003c/li\u003e\n    \u003cli\u003eaarch64-unknown-linux-ohos\u003c/li\u003e\n    \u003cli\u003earm-linux-androideabi\u003c/li\u003e\n    \u003cli\u003earm-unknown-linux-musleabi\u003c/li\u003e\n    \u003cli\u003earmv7-linux-androideabi\u003c/li\u003e\n    \u003cli\u003earmv7-unknown-linux-ohos\u003c/li\u003e\n    \u003cli\u003ei686-linux-android\u003c/li\u003e\n    \u003cli\u003eloongarch64-unknown-linux-gnu\u003c/li\u003e\n    \u003cli\u003es390x-unknown-linux-gnu\u003c/li\u003e\n    \u003cli\u003ex86_64-linux-android\u003c/li\u003e\n    \u003cli\u003ex86_64-unknown-illumos\u003c/li\u003e\n    \u003cli\u003ex86_64-unknown-linux-ohos\u003c/li\u003e\n    \u003cli\u003ex86_64-unknown-netbsd\u003c/li\u003e\n   \u003c/td\u003e\n   \u003ctd\u003e\n    \u003cli\u003earmv7-unknown-linux-uclibceabihf\u003c/li\u003e\n    \u003cli\u003epowerpc64-unknown-linux-gnu\u003c/li\u003e\n    \u003cli\u003ex86_64-unknown-fuchsia\u003c/li\u003e\n    \u003cli\u003ex86_64-unknown-dragonfly\u003c/li\u003e\n    \u003cli\u003ex86_64-unknown-haiku\u003c/li\u003e\n    \u003cli\u003ex86_64-unknown-linux-gnux32\u003c/li\u003e\n    \u003cli\u003ex86_64-unknown-openbsd\u003c/li\u003e\n    \u003cli\u003ex86_64-unknown-redox\u003c/li\u003e\n    \u003cli\u003ei686-unknown-hurd-gnu\u003c/li\u003e\n   \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Minimum Supported Rust Version (MSRV)\n\nnix is supported on Rust 1.69 and higher.  Its MSRV will not be\nchanged in the future without bumping the major or minor version.\n\n## Contributing\n\nContributions are very welcome.  Please See [CONTRIBUTING](CONTRIBUTING.md) for\nadditional details.\n\nFeel free to join us in [the nix-rust/nix](https://discord.com/invite/rkBeJUsmyd) channel on Discord to\ndiscuss `nix` development.\n\n## License\n\nNix is licensed under the MIT license.  See [LICENSE](LICENSE) for more details.\n","funding_links":[],"categories":["Libraries","Rust","库 Libraries","库"],"sub_categories":["Platform specific","特定于平台的 Platform specific","平台特定","平台标准 Platform specific"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnix-rust%2Fnix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnix-rust%2Fnix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnix-rust%2Fnix/lists"}