Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two misc ideas for Nix itself #13

Merged
merged 6 commits into from
Feb 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions ideas/2024.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ Welcome to our Google Summer of Code ideas list!

## small (90 hours)

### Nix cleanup: merge `ParsedDerivation` into `BasicDerivation`, improve JSON format

Nix currently special-cases some environment variables in derivations to convey extra meaning ("system features", "prefer local build", etc.).
We're stuck with this in the [`.drv` A-Term format](https://nixos.org/manual/nix/stable/protocols/derivation-aterm) and `builtins.derivation` because of backwards compatibility requirements, but that doesn't mean our internal data structures and (currently experimental, i.e. not yet stabilized and immobile) JSON format cannot be improved.

This project would be about doing just that: Fix the internal data structures, and then use that refactor to make the JSON format better.

As a stretch goal, we can then start proposing/prototyping a worthy successor to `builtins.derivation` that would better support this stuff.
(C.f. the "structured attrs" work in Nixpkgs.)

See https://github.com/NixOS/nix/issues/9846
and https://github.com/NixOS/nix/issues/9866.

Possible mentors:
- [@Ericson2314](https://github.com/Ericson2314)

### nixpkgs library networking functions

Many things in NixOS use the Internet Protocol and other network related technologies, thus a lot of modules and service have to deal with them.
Expand Down Expand Up @@ -77,6 +93,20 @@ We have [boot counting](https://github.com/NixOS/nixpkgs/pull/273062) that is on

## medium (175 hours)

### Nix Internals: Use `std::filesystem::path` for `Path`

Nix currently has a bunch of home-grown file system and file path utilities.
However in recent years ([C++17](https://en.wikipedia.org/wiki/C%2B%2B17#Language)) the standard library has gained a new [`std::fileystem`](https://en.cppreference.com/w/cpp/filesystem) library which has much of the same functionality.

The purpose of this project is to use `std::filesystem` where possible, with a particular emphasis on using the `std::filesystem::path` type rather than our own `Path` (which is just an alias for `std::string`).

This shrinks Nix (no need to maintain redundant code!), and will also aid in porting Nix to Windows, since an explicit design goal of `std::filesystem` is to be portable between Unix and Windows.

See https://github.com/NixOS/nix/issues/9205 for details.

Possible mentors:
- [@Ericson2314](https://github.com/Ericson2314)

### nixpkgs pnpm tooling

pnpm is a package manager that claims to be up to 2x faster than npm and more efficient than npm when it comes to disk space usage, because of this benefits more and more projects are using pnpm.
Expand Down