From b34756945ba1148b14696c8758a607baf0931cca Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 6 Feb 2024 11:21:02 -0500 Subject: [PATCH 1/5] Two misc ideas for Nix itself --- ideas/2024.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ideas/2024.md b/ideas/2024.md index 5213a46..fc7157f 100644 --- a/ideas/2024.md +++ b/ideas/2024.md @@ -4,6 +4,14 @@ Welcome to our Google Summer of Code ideas list! ## small (90 hours) +### Nix cleanup: merge `ParsedDerivation` into `BasicDerivation`, improve JSON format + +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. @@ -77,6 +85,15 @@ 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` + +See https://github.com/NixOS/nix/issues/9205 for details. + +This shrinks Nix (no need to have our own code that duplicates the standard library!), and will also aid in porting Nix to Windows. + +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. From a15476a96c4e81184d6b140f3b62c5f40f06ca7a Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 6 Feb 2024 14:10:43 -0500 Subject: [PATCH 2/5] Add descriptions --- ideas/2024.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/ideas/2024.md b/ideas/2024.md index 25711c8..a083231 100644 --- a/ideas/2024.md +++ b/ideas/2024.md @@ -6,6 +6,14 @@ Welcome to our Google Summer of Code ideas list! ### 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 and `builtins.derivation` because backwards compatibility, 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. @@ -87,9 +95,14 @@ We have [boot counting](https://github.com/NixOS/nixpkgs/pull/273062) that is on ### Nix Internals: Use `std::filesystem::path` for `Path` -See https://github.com/NixOS/nix/issues/9205 for details. +Nix currently has a bunch of home-grown file system and file path utilities. +However in recently years (C++2017) the standard library has gained a new `std::fileystem` library which has much of the same functionality. -This shrinks Nix (no need to have our own code that duplicates the standard library!), and will also aid in porting Nix to Windows. +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) From e5ec1fb280c747a6076e10b89279a708a8195a9d Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 6 Feb 2024 16:28:49 -0500 Subject: [PATCH 3/5] Update ideas/2024.md --- ideas/2024.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ideas/2024.md b/ideas/2024.md index a083231..5d63fde 100644 --- a/ideas/2024.md +++ b/ideas/2024.md @@ -7,7 +7,7 @@ Welcome to our Google Summer of Code ideas list! ### 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 and `builtins.derivation` because backwards compatibility, but that doesn't mean our internal data structures and (currently experimental, i.e. not yet stabilized and immobile) JSON format cannot be improved. +We're stuck with this in the [`.drv` A-Term format](https://nixos.org/manual/nix/stable/protocols/derivation-aterm) and `builtins.derivation` because backwards compatibility, 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. From 582e8a7047c8118998f127f509818e7ce8c5e0b6 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 6 Feb 2024 16:42:01 -0500 Subject: [PATCH 4/5] Update ideas/2024.md --- ideas/2024.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ideas/2024.md b/ideas/2024.md index 5d63fde..64fcd14 100644 --- a/ideas/2024.md +++ b/ideas/2024.md @@ -96,7 +96,7 @@ We have [boot counting](https://github.com/NixOS/nixpkgs/pull/273062) that is on ### Nix Internals: Use `std::filesystem::path` for `Path` Nix currently has a bunch of home-grown file system and file path utilities. -However in recently years (C++2017) the standard library has gained a new `std::fileystem` library which has much of the same functionality. +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`). From 0af1f8dd16f8f292cd0dcc270ffed6679d340f3d Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 6 Feb 2024 18:40:03 -0500 Subject: [PATCH 5/5] Update ideas/2024.md Co-authored-by: Valentin Gagarin --- ideas/2024.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ideas/2024.md b/ideas/2024.md index 64fcd14..a8708cb 100644 --- a/ideas/2024.md +++ b/ideas/2024.md @@ -7,7 +7,7 @@ Welcome to our Google Summer of Code ideas list! ### 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 backwards compatibility, but that doesn't mean our internal data structures and (currently experimental, i.e. not yet stabilized and immobile) JSON format cannot be improved. +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.