diff --git a/.clang-format b/.clang-format
deleted file mode 100644
index 1ee475b7a..000000000
--- a/.clang-format
+++ /dev/null
@@ -1,50 +0,0 @@
----
-BasedOnStyle: LLVM
-AccessModifierOffset: -4
-AlignAfterOpenBracket: BlockIndent
-AlignEscapedNewlines: Left
-AlignOperands: DontAlign
-AllowShortBlocksOnASingleLine: Always
-AllowShortFunctionsOnASingleLine: Empty
-AllowShortIfStatementsOnASingleLine: WithoutElse
-AlwaysBreakBeforeMultilineStrings: true
-AlwaysBreakTemplateDeclarations: Yes
-BinPackArguments: false
-BinPackParameters: false
-BitFieldColonSpacing: None
-BraceWrapping:
- AfterCaseLabel: false
- AfterClass: true
- AfterControlStatement: MultiLine
- AfterEnum: false
- AfterFunction: true
- AfterNamespace: false
- AfterObjCDeclaration: false
- AfterStruct: true
- AfterUnion: true
- AfterExternBlock: false
- BeforeCatch: false
- BeforeElse: false
- BeforeLambdaBody: false
- BeforeWhile: false
- IndentBraces: false
- SplitEmptyFunction: true
- SplitEmptyRecord: false
- SplitEmptyNamespace: true
-BreakAfterAttributes: Always
-BreakBeforeBinaryOperators: NonAssignment
-BreakBeforeBraces: Custom
-BreakConstructorInitializers: BeforeComma
-ColumnLimit: 100
-EmptyLineAfterAccessModifier: Leave
-EmptyLineBeforeAccessModifier: Leave
-FixNamespaceComments: false
-IndentWidth: 4
-InsertBraces: true
-InsertTrailingCommas: Wrapped
-LambdaBodyIndentation: Signature
-PackConstructorInitializers: CurrentLine
-PointerAlignment: Middle
-SortIncludes: Never
-SpaceAfterCStyleCast: true
-SpaceAfterTemplateKeyword: false
diff --git a/.clang-tidy b/.clang-tidy
deleted file mode 100644
index 3b5dcd91a..000000000
--- a/.clang-tidy
+++ /dev/null
@@ -1,18 +0,0 @@
-UseColor: true
-Checks:
- - -*
- - bugprone-*
- # too many warnings
- - -bugprone-assignment-in-if-condition
- # too many warnings
- - -bugprone-narrowing-conversions
- # kind of nonsense
- - -bugprone-easily-swappable-parameters
- # too many warnings for now
- - -bugprone-implicit-widening-of-multiplication-result
- # Lix's exception handling is Questionable
- - -bugprone-empty-catch
- # many warnings
- - -bugprone-unchecked-optional-access
- # many warnings, seems like a questionable lint
- - -bugprone-branch-clone
diff --git a/.dir-locals.el b/.dir-locals.el
deleted file mode 100644
index a2d1dc48d..000000000
--- a/.dir-locals.el
+++ /dev/null
@@ -1,18 +0,0 @@
-((c++-mode . (
- (c-file-style . "k&r")
- (c-basic-offset . 4)
- (c-block-comment-prefix . " ")
- (indent-tabs-mode . nil)
- (tab-width . 4)
- (show-trailing-whitespace . t)
- (indicate-empty-lines . t)
- (eval . (c-set-offset 'innamespace 0))
- (eval . (c-set-offset 'defun-open 0))
- (eval . (c-set-offset 'inline-open 0))
- (eval . (c-set-offset 'arglist-intro '+))
- (eval . (c-set-offset 'arglist-cont 0))
- (eval . (c-set-offset 'arglist-cont-nonempty '+))
- (eval . (c-set-offset 'substatement-open 0))
- (eval . (c-set-offset 'access-label '-))
- (eval . (c-set-offset 'inlambda 0))
- )))
diff --git a/.editorconfig b/.editorconfig
deleted file mode 100644
index 887ecadba..000000000
--- a/.editorconfig
+++ /dev/null
@@ -1,26 +0,0 @@
-# EditorConfig configuration for nix
-# http://EditorConfig.org
-
-# Top-most EditorConfig file
-root = true
-
-# Unix-style newlines with a newline ending every file, utf-8 charset
-[*]
-end_of_line = lf
-insert_final_newline = true
-trim_trailing_whitespace = true
-charset = utf-8
-
-# Match nix files, set indent to spaces with width of two
-[*.nix]
-indent_style = space
-indent_size = 2
-
-# Match c++/shell/perl, set indent to spaces with width of four
-[*.{hpp,cc,hh,sh,pl}]
-indent_style = space
-indent_size = 4
-
-# Match diffs, avoid to trim trailing whitespace
-[*.{diff,patch}]
-trim_trailing_whitespace = false
diff --git a/.envrc b/.envrc
deleted file mode 100644
index e6505ace6..000000000
--- a/.envrc
+++ /dev/null
@@ -1,9 +0,0 @@
-# shellcheck shell=bash
-source_env_if_exists .envrc.local
-# TODO: `use flake .#native-clangStdenvPackages` on macOS?
-use flake ".#${LIX_SHELL_VARIANT:-default}" "${LIX_SHELL_EXTRA_ARGS[@]}"
-export MAKEFLAGS="$MAKEFLAGS -e"
-if [[ -n "$NIX_BUILD_CORES" ]]; then
- export MAKEFLAGS="$MAKEFLAGS -j $NIX_BUILD_CORES"
-fi
-export GTEST_BRIEF=1
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
deleted file mode 100644
index ab5908649..000000000
--- a/.github/CODEOWNERS
+++ /dev/null
@@ -1,18 +0,0 @@
-# Pull requests concerning the listed files will automatically invite the respective maintainers as reviewers.
-# This file is not used for denoting any kind of ownership, but is merely a tool for handling notifications.
-#
-# Merge permissions are required for maintaining an entry in this file.
-# For documentation on this mechanism, see https://help.github.com/articles/about-codeowners/
-
-# Default reviewers if nothing else matches
-* @edolstra
-
-# This file
-.github/CODEOWNERS @edolstra
-
-# Public documentation
-/doc @fricklerhandwerk
-*.md @fricklerhandwerk
-
-# Libstore layer
-/src/libstore @thufschmitt
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
deleted file mode 100644
index 50ee41b91..000000000
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ /dev/null
@@ -1,32 +0,0 @@
----
-name: Bug report
-about: Create a report to help us improve
-title: ''
-labels: bug
-assignees: ''
-
----
-
-## Describe the bug
-
-A clear and concise description of what the bug is.
-
-If you have a problem with a specific package or NixOS,
-you probably want to file an issue at https://github.com/NixOS/nixpkgs/issues.
-
-## Steps To Reproduce
-
-1. Go to '...'
-2. Click on '....'
-3. Scroll down to '....'
-4. See error
-
-## Expected behavior
-
-A clear and concise description of what you expected to happen.
-
-## `nix --version` output
-
-## Additional context
-
-Add any other context about the problem here.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
deleted file mode 100644
index c7f0d842b..000000000
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ /dev/null
@@ -1,24 +0,0 @@
----
-name: Feature request
-about: Suggest an idea for this project
-title: ''
-labels: feature
-assignees: ''
-
----
-
-## Is your feature request related to a problem? Please describe.
-
-A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
-
-## Describe the solution you'd like
-
-A clear and concise description of what you want to happen.
-
-## Describe alternatives you've considered
-
-A clear and concise description of any alternative solutions or features you've considered.
-
-## Additional context
-
-Add any other context or screenshots about the feature request here.
diff --git a/.github/ISSUE_TEMPLATE/installer.md b/.github/ISSUE_TEMPLATE/installer.md
deleted file mode 100644
index 05a2e1474..000000000
--- a/.github/ISSUE_TEMPLATE/installer.md
+++ /dev/null
@@ -1,32 +0,0 @@
----
-name: Installer issue
-about: Report problems with installation
-title: ''
-labels: installer
-assignees: ''
-
----
-
-## Platform
-
-
-
-- [ ] Linux:
-- [ ] macOS
-- [ ] WSL
-
-## Additional information
-
-
-
-## Output
-
-Output
-
-```log
-
-
-
-```
-
-
diff --git a/.github/ISSUE_TEMPLATE/missing_documentation.md b/.github/ISSUE_TEMPLATE/missing_documentation.md
deleted file mode 100644
index 250373feb..000000000
--- a/.github/ISSUE_TEMPLATE/missing_documentation.md
+++ /dev/null
@@ -1,27 +0,0 @@
----
-name: Missing or incorrect documentation
-about: Help us improve the reference manual
-title: ''
-labels: documentation
-assignees: ''
-
----
-
-## Problem
-
-
-
-## Proposal
-
-
-
-## Checklist
-
-
-
-- [ ] checked [latest Nix manual] \([source])
-- [ ] checked [open documentation issues and pull requests] for possible duplicates
-
-[latest Nix manual]: https://nixos.org/manual/nix/unstable/
-[source]: https://github.com/NixOS/nix/tree/master/doc/manual/src
-[open documentation issues and pull requests]: https://github.com/NixOS/nix/labels/documentation
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
deleted file mode 100644
index 529af0f37..000000000
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# Motivation
-
-
-# Context
-
-
-
-
-
-
-
diff --git a/.github/STALE-BOT.md b/.github/STALE-BOT.md
deleted file mode 100644
index 383717bfc..000000000
--- a/.github/STALE-BOT.md
+++ /dev/null
@@ -1,35 +0,0 @@
-# Stale bot information
-
-- Thanks for your contribution!
-- To remove the stale label, just leave a new comment.
-- _How to find the right people to ping?_ → [`git blame`](https://git-scm.com/docs/git-blame) to the rescue! (or GitHub's history and blame buttons.)
-- You can always ask for help on [our Discourse Forum](https://discourse.nixos.org/) or on [Matrix - #nix:nixos.org](https://matrix.to/#/#nix:nixos.org).
-
-## Suggestions for PRs
-
-1. GitHub sometimes doesn't notify people who commented / reviewed a PR previously, when you (force) push commits. If you have addressed the reviews you can [officially ask for a review](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/requesting-a-pull-request-review) from those who commented to you or anyone else.
-2. If it is unfinished but you plan to finish it, please mark it as a draft.
-3. If you don't expect to work on it any time soon, closing it with a short comment may encourage someone else to pick up your work.
-4. To get things rolling again, rebase the PR against the target branch and address valid comments.
-5. If you need a review to move forward, ask in [the Discourse thread for PRs that need help](https://discourse.nixos.org/t/prs-in-distress/3604).
-6. If all you need is a merge, check the git history to find and [request reviews](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/requesting-a-pull-request-review) from people who usually merge related contributions.
-
-## Suggestions for issues
-
-1. If it is resolved (either for you personally, or in general), please consider closing it.
-2. If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough.
-3. If you still have interest in resolving it, try to ping somebody who you believe might have an interest in the topic. Consider discussing the problem in [our Discourse Forum](https://discourse.nixos.org/).
-4. As with all open source projects, your best option is to submit a Pull Request that addresses this issue. We :heart: this attitude!
-
-**Memorandum on closing issues**
-
-Don't be afraid to close an issue that holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen--nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.
-
-## Useful GitHub search queries
-
-- [Open PRs with any stale-bot interaction](https://github.com/NixOS/nix/pulls?q=is%3Apr+is%3Aopen+commenter%3Aapp%2Fstale+)
-- [Open PRs with any stale-bot interaction and `stale`](https://github.com/NixOS/nix/pulls?q=is%3Apr+is%3Aopen+commenter%3Aapp%2Fstale+label%3A%22stale%22)
-- [Open PRs with any stale-bot interaction and NOT `stale`](https://github.com/NixOS/nix/pulls?q=is%3Apr+is%3Aopen+commenter%3Aapp%2Fstale+-label%3A%22stale%22+)
-- [Open Issues with any stale-bot interaction](https://github.com/NixOS/nix/issues?q=is%3Aissue+is%3Aopen+commenter%3Aapp%2Fstale+)
-- [Open Issues with any stale-bot interaction and `stale`](https://github.com/NixOS/nix/issues?q=is%3Aissue+is%3Aopen+commenter%3Aapp%2Fstale+label%3A%22stale%22+)
-- [Open Issues with any stale-bot interaction and NOT `stale`](https://github.com/NixOS/nix/issues?q=is%3Aissue+is%3Aopen+commenter%3Aapp%2Fstale+-label%3A%22stale%22+)
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
deleted file mode 100644
index 5ace4600a..000000000
--- a/.github/dependabot.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-version: 2
-updates:
- - package-ecosystem: "github-actions"
- directory: "/"
- schedule:
- interval: "weekly"
diff --git a/.github/labeler.yml b/.github/labeler.yml
deleted file mode 100644
index 7544f07a6..000000000
--- a/.github/labeler.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-"documentation":
- - doc/manual/*
- - src/nix/**/*.md
-
-"store":
- - src/libstore/store-api.*
- - src/libstore/*-store.*
-
-"fetching":
- - src/libfetchers/**/*
-
-"repl":
- - src/libcmd/repl.*
- - src/nix/repl.*
-
-"new-cli":
- - src/nix/**/*
-
-"with-tests":
- # Unit tests
- - src/*/tests/**/*
- # Functional and integration tests
- - tests/functional/**/*
diff --git a/.github/stale.yml b/.github/stale.yml
deleted file mode 100644
index ee831135a..000000000
--- a/.github/stale.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-# Configuration for probot-stale - https://github.com/probot/stale
-daysUntilStale: 180
-daysUntilClose: false
-exemptLabels:
- - "critical"
- - "never-stale"
-staleLabel: "stale"
-markComment: false
-closeComment: false
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 4d921d97f..000000000
--- a/.gitignore
+++ /dev/null
@@ -1,159 +0,0 @@
-Makefile.config
-perl/Makefile.config
-
-# /
-/aclocal.m4
-/autom4te.cache
-/precompiled-headers.h.gch
-/config.*
-/configure
-/stamp-h1
-/svn-revision
-/libtool
-/config
-
-# /doc/manual/
-/doc/manual/*.1
-/doc/manual/*.5
-/doc/manual/*.8
-/doc/manual/generated/*
-/doc/manual/nix.json
-/doc/manual/conf-file.json
-/doc/manual/language.json
-/doc/manual/xp-features.json
-/doc/manual/src/command-ref/experimental-features-shortlist.md
-/doc/manual/src/contributing/experimental-feature-descriptions.md
-/doc/manual/src/release-notes/rl-next-generated.md
-
-# /scripts/
-/scripts/nix-profile.sh
-/scripts/nix-profile-daemon.sh
-/scripts/nix-profile.fish
-/scripts/nix-profile-daemon.fish
-
-# /src/libexpr/
-/src/libexpr/lexer-tab.cc
-/src/libexpr/lexer-tab.hh
-/src/libexpr/parser-tab.cc
-/src/libexpr/parser-tab.hh
-/src/libexpr/parser-tab.output
-/src/libexpr/nix.tbl
-/src/libexpr/tests
-/tests/unit/libexpr/libnixexpr-tests
-
-# /src/libstore/
-*.gen.*
-/src/libstore/tests
-/tests/unit/libstore/libnixstore-tests
-
-# /src/libutil/
-/src/libutil/tests
-/tests/unit/libutil/libnixutil-tests
-
-/src/nix/nix
-
-/src/nix/doc
-
-# /src/nix-env/
-/src/nix-env/nix-env
-
-# /src/nix-instantiate/
-/src/nix-instantiate/nix-instantiate
-
-# /src/nix-store/
-/src/nix-store/nix-store
-
-/src/nix-prefetch-url/nix-prefetch-url
-
-/src/nix-collect-garbage/nix-collect-garbage
-
-# /src/nix-channel/
-/src/nix-channel/nix-channel
-
-# /src/nix-build/
-/src/nix-build/nix-build
-
-/src/nix-copy-closure/nix-copy-closure
-
-/src/error-demo/error-demo
-
-/src/build-remote/build-remote
-
-# /tests/functional/
-/tests/functional/test-tmp
-/tests/functional/common/vars-and-functions.sh
-/tests/functional/result*
-/tests/functional/restricted-innocent
-/tests/functional/shell
-/tests/functional/shell.drv
-/tests/functional/config.nix
-/tests/functional/ca/config.nix
-/tests/functional/dyn-drv/config.nix
-/tests/functional/repl-result-out
-/tests/functional/debugger-test-out
-/tests/functional/test-libstoreconsumer/test-libstoreconsumer
-
-# /tests/functional/lang/
-/tests/functional/lang/*.out
-/tests/functional/lang/*.out.xml
-/tests/functional/lang/*.err
-/tests/functional/lang/*.ast
-
-/perl/lib/Nix/Config.pm
-/perl/lib/Nix/Store.cc
-
-/misc/systemd/nix-daemon.service
-/misc/systemd/nix-daemon.socket
-/misc/systemd/nix-daemon.conf
-/misc/upstart/nix-daemon.conf
-
-/src/resolve-system-dependencies/resolve-system-dependencies
-
-outputs/
-
-*.a
-*.o
-*.o.tmp
-*.so
-*.dylib
-*.dll
-*.exe
-*.dep
-*~
-*.pc
-*.plist
-
-# GNU Global
-GPATH
-GRTAGS
-GSYMS
-GTAGS
-
-# ccls
-/.ccls-cache
-
-# auto-generated compilation database
-compile_commands.json
-
-nix-rust/target
-
-result
-result-*
-
-.vscode/
-.direnv/
-.envrc.local
-
-# clangd and possibly more
-.cache/
-
-# Mac OS
-.DS_Store
-
-# ClangBuildAnalyzer output, see maintainers/buildtime_report.sh
-buildtime.bin
-
-.envrc.local
-# We generate this with a Nix shell hook
-/.pre-commit-config.yaml
-/.nocontribmsg
diff --git a/.version b/.version
deleted file mode 100644
index 4004af690..000000000
--- a/.version
+++ /dev/null
@@ -1 +0,0 @@
-2.90.0
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
deleted file mode 100644
index 4a4c81cb2..000000000
--- a/CONTRIBUTING.md
+++ /dev/null
@@ -1,53 +0,0 @@
-# Contributing to Lix
-
-Welcome and thank you for considering contributing to Lix! We're currently in a soft release phase, and your support means a lot to us.
-
-To ensure a smooth and effective contribution process, here is a summary of our guidelines:
-
-## Getting help?
-
-If you have any question regarding getting started or reporting bugs, feel free
-to reach out to us.
-
-On Matrix, we have a space at `#space:lix.systems`, composed of:
-
-- [`#discuss:lix.systems`](https://matrix.to/#/#discuss:lix.systems) for discussions on Lix.
-- [`#dev:lix.systems`](https://matrix.to/#/#dev:lix.systems) for the development channel on Lix.
-
-## Report a bug
-
-- Check if your bug has already been reported in the [issue tracker](https://git.lix.systems/lix-project/lix/issues).
-- If you can't find the bug or feature, please open a new issue.
-
-We maintain a copy of the upstream Nix bugs. Their organisation can be read about [here](https://wiki.lix.systems/books/lix-contributors/page/bug-tracker-organisation).
-
-## Report a security vulnerability
-
-For security vulnerabilities, reach out by email at `security at lix dot systems`.
-
-## Making changes to Lix
-
-Before diving into making changes, we want to engage with you and your ideas.
-
-We have a few policies in effect; please take the time to familiarize yourself:
-
-- [Style guide on code](https://wiki.lix.systems/books/lix-contributors/page/code)
-- [Freeze policy and recommended contributions](https://wiki.lix.systems/books/lix-contributors/page/freezes-and-recommended-contributions)
-
-To avoid duplication of effort, it may be a good idea to check out the list of
-[pending pull requests](https://gerrit.lix.systems/q/status:open+-is:wip) (or "change lists", as Gerrit calls them). Once you have
-an idea of what you might want to do, we recommend dropping a message on our
-Matrix to ensure your contribution fits with our current schedule and plans
-
-When you're ready and your changes are ready to go:
-
-- Submit your code.
- - Submitting a GitHub PR [on our mirror](https://github.com/lix-project/lix) is totally ok if that's easier for you and your change is relatively small (300 lines or so).
-
- We may ask you to resubmit it as a Gerrit CL if it is necessary for the change you're making.
- - Our primary code review system is [our Gerrit instance](https://gerrit.lix.systems), where you can open a change list (CL).
- If you're new to Gerrit, check out [our wiki page about Gerrit](https://wiki.lix.systems/books/lix-contributors/page/gerrit).
-- Make sure to link any related issues.
-- If needed, indicate that the change is 'work in progress'.
-
-You can obtain an account on our platforms by clicking "Sign In with GitHub" on the sign-in page.
diff --git a/COPYING b/COPYING
deleted file mode 100644
index 9c6a6cc38..000000000
--- a/COPYING
+++ /dev/null
@@ -1,502 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- , 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
diff --git a/Makefile b/Makefile
deleted file mode 100644
index bb1b82bb1..000000000
--- a/Makefile
+++ /dev/null
@@ -1,71 +0,0 @@
-include mk/build-dir.mk
-
--include $(buildprefix)Makefile.config
-clean-files += $(buildprefix)Makefile.config
-
-ifeq ($(ENABLE_BUILD), yes)
-makefiles = \
- mk/precompiled-headers.mk \
- local.mk \
- src/libutil/local.mk \
- src/libstore/local.mk \
- src/libfetchers/local.mk \
- src/libmain/local.mk \
- src/libexpr/local.mk \
- src/libcmd/local.mk \
- src/nix/local.mk \
- src/resolve-system-dependencies/local.mk \
- scripts/local.mk \
- misc/bash/local.mk \
- misc/fish/local.mk \
- misc/zsh/local.mk \
- misc/systemd/local.mk \
- misc/launchd/local.mk
-endif
-
-ifeq ($(ENABLE_BUILD)_$(ENABLE_TESTS), yes_yes)
-UNIT_TEST_ENV = _NIX_TEST_UNIT_DATA=unit-test-data
-makefiles += \
- tests/unit/libutil/local.mk \
- tests/unit/libutil-support/local.mk \
- tests/unit/libstore/local.mk
-endif
-
-ifeq ($(ENABLE_TESTS), yes)
-makefiles += \
- tests/unit/libstore-support/local.mk \
- tests/unit/libexpr/local.mk \
- tests/unit/libexpr-support/local.mk \
- tests/functional/local.mk \
- tests/functional/ca/local.mk \
- tests/functional/dyn-drv/local.mk \
- tests/functional/test-libstoreconsumer/local.mk \
- tests/functional/repl_characterization/local.mk \
- tests/functional/plugins/local.mk
-else
-makefiles += \
- mk/disable-tests.mk
-endif
-
-# Some makefiles require access to built programs and must be included late.
-makefiles-late =
-
-ifeq ($(ENABLE_BUILD), yes)
-makefiles-late += doc/manual/local.mk
-makefiles-late += doc/internal-api/local.mk
-endif
-
-# Miscellaneous global Flags
-
-OPTIMIZE = 1
-
-ifeq ($(OPTIMIZE), 1)
- GLOBAL_CXXFLAGS += -O2 $(CXXLTO)
- GLOBAL_LDFLAGS += $(CXXLTO)
-else
- GLOBAL_CXXFLAGS += -O0 -U_FORTIFY_SOURCE
-endif
-
-include mk/lib.mk
-
-GLOBAL_CXXFLAGS += -g -Wall -Wimplicit-fallthrough -include $(buildprefix)config.h -std=c++2a -I src
diff --git a/Makefile.config.in b/Makefile.config.in
deleted file mode 100644
index 7367d0a3f..000000000
--- a/Makefile.config.in
+++ /dev/null
@@ -1,52 +0,0 @@
-AR = @AR@
-BDW_GC_LIBS = @BDW_GC_LIBS@
-BOOST_LDFLAGS = @BOOST_LDFLAGS@
-BUILD_SHARED_LIBS = @BUILD_SHARED_LIBS@
-CC = @CC@
-CFLAGS = @CFLAGS@
-CXX = @CXX@
-CXXFLAGS = @CXXFLAGS@
-CXXLTO = @CXXLTO@
-EDITLINE_LIBS = @EDITLINE_LIBS@
-ENABLE_S3 = @ENABLE_S3@
-GTEST_LIBS = @GTEST_LIBS@
-HAVE_LIBCPUID = @HAVE_LIBCPUID@
-HAVE_SECCOMP = @HAVE_SECCOMP@
-HOST_OS = @host_os@
-LDFLAGS = @LDFLAGS@
-LIBARCHIVE_LIBS = @LIBARCHIVE_LIBS@
-LIBBROTLI_LIBS = @LIBBROTLI_LIBS@
-LIBCURL_LIBS = @LIBCURL_LIBS@
-LIBSECCOMP_LIBS = @LIBSECCOMP_LIBS@
-LOWDOWN_LIBS = @LOWDOWN_LIBS@
-NIXDOC_LIBS = -llix_doc
-OPENSSL_LIBS = @OPENSSL_LIBS@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-RAPIDCHECK_HEADERS = @RAPIDCHECK_HEADERS@
-SHELL = @bash@
-SODIUM_LIBS = @SODIUM_LIBS@
-SQLITE3_LIBS = @SQLITE3_LIBS@
-bash = @bash@
-bindir = @bindir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-doc_generate = @doc_generate@
-docdir = @docdir@
-embedded_sandbox_shell = @embedded_sandbox_shell@
-exec_prefix = @exec_prefix@
-includedir = @includedir@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localstatedir = @localstatedir@
-lsof = @lsof@
-mandir = @mandir@
-pkglibdir = $(libdir)/$(PACKAGE_NAME)
-prefix = @prefix@
-sandbox_shell = @sandbox_shell@
-storedir = @storedir@
-sysconfdir = @sysconfdir@
-system = @system@
-ENABLE_BUILD = @ENABLE_BUILD@
-ENABLE_TESTS = @ENABLE_TESTS@
-internal_api_docs = @internal_api_docs@
diff --git a/README.md b/README.md
deleted file mode 100644
index 814fceac8..000000000
--- a/README.md
+++ /dev/null
@@ -1,29 +0,0 @@
-# Lix
-
-**Lix** is an implementation of **Nix**, a powerful package management system for Linux and other Unix systems that makes package management reliable and reproducible.
-
-Read more about us at https://lix.systems.
-
-## Installation
-
-On Linux and macOS the easiest way to install Nix is to run the following shell command
-(as a user other than root):
-
-```console
-$ curl -sSf -L https://install.lix.systems/lix | sh -s -- install
-```
-
-For systems that **already have Nix installed**, such as NixOS systems, read our [install page](https://lix.systems/install)
-
-## Building And Developing
-
-See our [Hacking guide](https://git.lix.systems/lix-project/lix/src/branch/main/doc/manual/src/contributing/hacking.md) in our manual for instruction on how to to set up a development environment and build Lix from source.
-
-## Additional Resources
-
-- [Our wiki](https://wiki.lix.systems)
-- [Matrix - #space:lix.systems](https://matrix.to/#/#space:lix.systems)
-
-## License
-
-Lix is released under the [LGPL v2.1](./COPYING).
diff --git a/bench/.gitignore b/bench/.gitignore
deleted file mode 100644
index 8115aa6f2..000000000
--- a/bench/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-bench-*.json
-bench-*.md
-nixpkgs
diff --git a/bench/README.md b/bench/README.md
deleted file mode 100644
index 4aefcd7a8..000000000
--- a/bench/README.md
+++ /dev/null
@@ -1,91 +0,0 @@
-# Benchmarking scripts for Lix
-
-These are very much WIP, and have a few clumsy assumptions that we would
-somewhat rather be fixed, but we have committed them to let others be able to
-do benchmarking in the mean time.
-
-## Benchmarking procedure
-
-Build some Lixes you want to compare, by whichever means you wish.
-
-Get a computer that is not busy and *strongly preferably* is bare-metal or at
-least not a cloud VM (e.g. go make coffee when running benchmarks).
-
-From the root of a Lix checkout, run `./bench/bench.sh resultlink-one
-resultlink-two`, where `resultlink-one` and `resultlink-two` are the result
-links from the builds you want to test (they can be any directory with bin/nix
-in it, however).
-
-To get the summary again, run `./bench/summarize.jq bench/bench-*.json`.
-
-## Example results
-
-(vim tip: `:r !bench/summarize.jq bench/bench-*.json` to dump it directly into
-your editor)
-
-```
-result-asserts/bin/nix --extra-experimental-features 'nix-command flakes' search --no-eval-cache github:nixos/nixpkgs/e1fa12d4f6
-c6fe19ccb59cac54b5b3f25e160870 hello
- mean: 15.993s ± 0.081s
- user: 13.321s | system: 1.865s
- median: 15.994s
- range: 15.829s ... 16.096s
- relative: 1
-result/bin/nix --extra-experimental-features 'nix-command flakes' search --no-eval-cache github:nixos/nixpkgs/e1fa12d4f6c6fe19cc
-b59cac54b5b3f25e160870 hello
- mean: 15.897s ± 0.075s
- user: 13.248s | system: 1.843s
- median: 15.88s
- range: 15.807s ... 16.047s
- relative: 0.994
-
----
-
-result/bin/nix --extra-experimental-features 'nix-command flakes' eval -f bench/nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix
- mean: 0.4s ± 0.024s
- user: 0.335s | system: 0.046s
- median: 0.386s
- range: 0.379s ... 0.43s
- relative: 1
-
-result-asserts/bin/nix --extra-experimental-features 'nix-command flakes' eval -f bench/nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix
- mean: 0.404s ± 0.024s
- user: 0.338s | system: 0.046s
- median: 0.386s
- range: 0.384s ... 0.436s
- relative: 1.008
-
----
-
-result-asserts/bin/nix --extra-experimental-features 'nix-command flakes' eval --raw --impure --expr 'with import {}; system'
- mean: 5.838s ± 0.023s
- user: 5.083s | system: 0.464s
- median: 5.845s
- range: 5.799s ... 5.867s
- relative: 1
-
-result/bin/nix --extra-experimental-features 'nix-command flakes' eval --raw --impure --expr 'with import {}; system'
- mean: 5.788s ± 0.044s
- user: 5.056s | system: 0.439s
- median: 5.79s
- range: 5.715s ... 5.876s
- relative: 0.991
-
----
-
-GC_INITIAL_HEAP_SIZE=10g result-asserts/bin/nix eval --extra-experimental-features 'nix-command flakes' --raw --impure --expr 'with import {}; system'
- mean: 4.147s ± 0.021s
- user: 3.457s | system: 0.487s
- median: 4.147s
- range: 4.123s ... 4.195s
- relative: 1
-
-GC_INITIAL_HEAP_SIZE=10g result/bin/nix eval --extra-experimental-features 'nix-command flakes' --raw --impure --expr 'with import {}; system'
- mean: 4.149s ± 0.027s
- user: 3.483s | system: 0.456s
- median: 4.142s
- range: 4.126s ... 4.215s
- relative: 1
-
----
-```
diff --git a/bench/bench.sh b/bench/bench.sh
deleted file mode 100755
index 70acd4640..000000000
--- a/bench/bench.sh
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/usr/bin/env bash
-
-set -euo pipefail
-shopt -s inherit_errexit
-
-scriptdir=$(cd "$(dirname -- "$0")" ; pwd -P)
-cd "$scriptdir/.."
-
-if [[ $# -lt 2 ]]; then
- # FIXME(jade): it is a reasonable use case to want to run a benchmark run
- # on just one build. However, since we are using hyperfine in comparison
- # mode, we would have to combine the JSON ourselves to support that, which
- # would probably be better done by writing a benchmarking script in
- # not-bash.
- echo "Fewer than two result dirs given, nothing to compare!" >&2
- echo "Pass some directories (with names indicating which alternative they are) with bin/nix in them" >&2
- echo "Usage: ./bench/bench.sh result-1 result-2 [result-3...]" >&2
- exit 1
-fi
-
-_exit=""
-trap "$_exit" EXIT
-
-# XXX: yes this is very silly. flakes~!!
-nix build --impure --expr '(builtins.getFlake "git+file:.").inputs.nixpkgs.outPath' -o bench/nixpkgs
-
-export NIX_REMOTE="$(mktemp -d)"
-_exit='rm -rfv "$NIX_REMOTE"; $_exit'
-export NIX_PATH="nixpkgs=bench/nixpkgs:nixos-config=bench/configuration.nix"
-
-builds=("$@")
-
-flake_args="--extra-experimental-features 'nix-command flakes'"
-
-hyperfineArgs=(
- --parameter-list BUILD "$(IFS=,; echo "${builds[*]}")"
- --warmup 2 --runs 10
-)
-
-declare -A cases
-cases=(
- [search]="{BUILD}/bin/nix $flake_args search --no-eval-cache github:nixos/nixpkgs/e1fa12d4f6c6fe19ccb59cac54b5b3f25e160870 hello"
- [rebuild]="{BUILD}/bin/nix $flake_args eval --raw --impure --expr 'with import {}; system'"
- [rebuild-lh]="GC_INITIAL_HEAP_SIZE=10g {BUILD}/bin/nix eval $flake_args --raw --impure --expr 'with import {}; system'"
- [parse]="{BUILD}/bin/nix $flake_args eval -f bench/nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix"
-)
-
-benches=(
- rebuild
- rebuild-lh
- search
- parse
-)
-
-for k in "${benches[@]}"; do
- taskset -c 2,3 \
- chrt -f 50 \
- hyperfine "${hyperfineArgs[@]}" --export-json="bench/bench-${k}.json" --export-markdown="bench/bench-${k}.md" "${cases[$k]}"
-done
-
-echo "Benchmarks summary (from ./bench/summarize.jq bench/bench-*.json)"
-bench/summarize.jq bench/*.json
diff --git a/bench/configuration.nix b/bench/configuration.nix
deleted file mode 100644
index 54782a1d3..000000000
--- a/bench/configuration.nix
+++ /dev/null
@@ -1,325 +0,0 @@
-{
- config,
- pkgs,
- lib,
- ...
-}:
-
-{
- boot = {
- initrd = {
- availableKernelModules = [
- "xhci_pci"
- "ahci"
- ];
- kernelModules = [ "dm-snapshot" ];
- luks.devices = {
- croot = {
- device = "/dev/sdb";
- allowDiscards = true;
- };
- };
- };
- kernelModules = [ "kvm-intel" ];
- kernelPackages = pkgs.linuxPackages_latest;
-
- loader = {
- systemd-boot.enable = true;
- efi.canTouchEfiVariables = true;
- };
- };
-
- hardware = {
- enableRedistributableFirmware = true;
- cpu.intel.updateMicrocode = true;
- opengl.driSupport32Bit = true;
- opengl.extraPackages = with pkgs; [
- vaapiIntel
- intel-media-driver
- intel-compute-runtime
- ];
- };
-
- fileSystems = {
- "/" = {
- device = "/dev/sda2";
- fsType = "xfs";
- options = [ "noatime" ];
- };
-
- "/boot" = {
- device = "/dev/sda1";
- fsType = "vfat";
- };
-
- "/nas" = {
- device = "nas:/";
- fsType = "nfs4";
- options = [
- "ro"
- "x-systemd.automount"
- ];
- };
- };
- swapDevices = [ { device = "/dev/swap"; } ];
-
- networking = {
- useDHCP = false;
- hostName = "host";
- wireless = {
- enable = true;
- interfaces = [ "eth1" ];
- };
- interfaces = {
- eth0.useDHCP = true;
- eth1.useDHCP = true;
- };
- wg-quick.interfaces = {
- wg0 = {
- address = [ "2001:db8::1" ];
- privateKeyFile = "/etc/secrets/wg0.key";
- peers = [
- {
- publicKey = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
- endpoint = "[2001:db8::2]:61021";
- allowedIPs = [ "2001::db8:1::/64" ];
- }
- ];
- };
- };
-
- firewall.allowedUDPPorts = [ 4567 ];
- };
-
- i18n = {
- defaultLocale = "en_US.UTF-8";
- inputMethod.enabled = "ibus";
- };
-
- services = {
- xserver = {
- enable = true;
- layout = "us";
- xkbVariant = "altgr-intl";
- xkbOptions = "ctrl:nocaps";
- libinput.enable = true;
- wacom.enable = true;
- videoDrivers = [ "modesetting" ];
- modules = [ pkgs.xf86_input_wacom ];
-
- displayManager.sx.enable = true;
- windowManager.i3.enable = true;
- };
-
- udev.extraHwdb = ''
- # not like this mattered at all
- # we're not running udev from here
- '';
-
- udev.extraRules = ''
- # ACTION=="add", SUBSYSTEM=="input", ...
- '';
- };
-
- sound.enable = true;
- hardware.pulseaudio = {
- enable = true;
- package = pkgs.pulseaudioFull;
- daemon.config = {
- lock-memory = "yes";
- realtime-scheduling = "yes";
- rlimit-rtprio = "-1";
- };
- };
-
- programs = {
- light.enable = true;
- wireshark = {
- enable = true;
- package = pkgs.wireshark-qt;
- };
- gnupg.agent = {
- enable = true;
- };
- };
-
- fonts.packages = with pkgs; [
- font-awesome
- noto-fonts
- noto-fonts-cjk
- noto-fonts-emoji
- noto-fonts-extra
- dejavu_fonts
- powerline-fonts
- source-code-pro
- cantarell-fonts
- ];
-
- users = {
- mutableUsers = false;
-
- users = {
- user = {
- isNormalUser = true;
- group = "user";
- extraGroups = [
- "wheel"
- "video"
- "audio"
- "dialout"
- "users"
- "kvm"
- "wireshark"
- ];
- password = "unimportant";
- };
- };
-
- groups = {
- user = { };
- };
- };
-
- security = {
- pam.loginLimits = [
- {
- domain = "@audio";
- item = "memlock";
- type = "-";
- value = "unlimited";
- }
- {
- domain = "@audio";
- item = "rtprio";
- type = "-";
- value = "99";
- }
- {
- domain = "@audio";
- item = "nofile";
- type = "soft";
- value = "99999";
- }
- {
- domain = "@audio";
- item = "nofile";
- type = "hard";
- value = "99999";
- }
- ];
-
- sudo.extraRules = [
- {
- users = [ "user" ];
- commands = [
- {
- command = "${pkgs.linuxPackages.cpupower}/bin/cpupower";
- options = [ "NOPASSWD" ];
- }
- ];
- }
- ];
- };
-
- environment.systemPackages = with pkgs; [
- a2jmidid
- age
- ardour
- bemenu
- blender
- breeze-icons
- breeze-qt5
- bubblewrap
- calf
- claws-mail
- darktable
- duperemove
- emacs
- feh
- file
- firefox
- fluidsynth
- gnome3.adwaita-icon-theme
- gnuplot
- graphviz
- helm
- i3status-rust
- inkscape
- jack2
- jq
- krita
- ldns
- libqalculate
- libreoffice
- man-pages
- nheko
- nix-diff
- nix-index
- nix-output-monitor
- open-music-kontrollers.patchmatrix
- pamixer
- pavucontrol
- pciutils
- picom
- pwgen
- redshift
- ripgrep
- rlwrap
- silver-searcher
- soundfont-fluid
- whois
- wol
- xclip
- xdot
- xdotool
- xorg.xkbcomp
- yt-dlp
- zathura
- borgbackup
- linuxPackages.cpupower
- mtr
- kitty
- xf86_input_wacom
- ];
-
- environment.pathsToLink = [ "/share/soundfonts" ];
-
- systemd.user.services.run-python = {
- after = [ "network-online.target" ];
- script = ''
- exec ${pkgs.python3}/bin/python
- '';
- serviceConfig = {
- CapabilityBoundingSet = [ "" ];
- KeyringMode = "private";
- LockPersonality = true;
- MemoryDenyWriteExecute = true;
- NoNewPrivileges = true;
- PrivateDevices = true;
- PrivateTmp = true;
- PrivateUsers = true;
- ProcSubset = "pid";
- ProtectClock = true;
- ProtectControlGroups = true;
- ProtectHome = true;
- ProtectHostname = true;
- ProtectKernelLogs = true;
- ProtectKernelModules = true;
- ProtectKernelTunables = true;
- ProtectProc = "invisible";
- ProtectSystem = "strict";
- RestrictAddressFamilies = "AF_INET AF_INET6";
- RestrictNamespaces = true;
- RestrictRealtime = true;
- RestrictSUIDSGID = true;
- SystemCallArchitectures = "native";
- SystemCallFilter = [
- "@system-service"
- "~ @resources @privileged"
- ];
- UMask = "077";
- };
- };
-
- system.stateVersion = "23.11";
-}
diff --git a/bench/summarize.jq b/bench/summarize.jq
deleted file mode 100755
index 5d1449108..000000000
--- a/bench/summarize.jq
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/env -S jq -Mrf
-
-def round3:
- . * 1000 | round | . / 1000
- ;
-
-def stats($first):
- [
- " mean: \(.mean | round3)s ± \(.stddev | round3)s",
- " user: \(.user | round3)s | system: \(.system | round3)s",
- " median: \(.median | round3)s",
- " range: \(.min | round3)s ... \(.max | round3)s",
- " relative: \(.mean / $first.mean | round3)"
- ]
- | join("\n")
- ;
-
-def fmt($first):
- "\(.command)\n" + (. | stats($first))
- ;
-
-[.results | .[0] as $first | .[] | fmt($first)] | join("\n\n") | (. + "\n\n---\n")
diff --git a/boehmgc-coroutine-sp-fallback.diff b/boehmgc-coroutine-sp-fallback.diff
deleted file mode 100644
index 24dcfa41a..000000000
--- a/boehmgc-coroutine-sp-fallback.diff
+++ /dev/null
@@ -1,99 +0,0 @@
-diff --git a/darwin_stop_world.c b/darwin_stop_world.c
-index 0468aaec..b348d869 100644
---- a/darwin_stop_world.c
-+++ b/darwin_stop_world.c
-@@ -356,6 +356,7 @@ GC_INNER void GC_push_all_stacks(void)
- int nthreads = 0;
- word total_size = 0;
- mach_msg_type_number_t listcount = (mach_msg_type_number_t)THREAD_TABLE_SZ;
-+ size_t stack_limit;
- if (!EXPECT(GC_thr_initialized, TRUE))
- GC_thr_init();
-
-@@ -411,6 +412,19 @@ GC_INNER void GC_push_all_stacks(void)
- GC_push_all_stack_sections(lo, hi, p->traced_stack_sect);
- }
- if (altstack_lo) {
-+ // When a thread goes into a coroutine, we lose its original sp until
-+ // control flow returns to the thread.
-+ // While in the coroutine, the sp points outside the thread stack,
-+ // so we can detect this and push the entire thread stack instead,
-+ // as an approximation.
-+ // We assume that the coroutine has similarly added its entire stack.
-+ // This could be made accurate by cooperating with the application
-+ // via new functions and/or callbacks.
-+ stack_limit = pthread_get_stacksize_np(p->id);
-+ if (altstack_lo >= altstack_hi || altstack_lo < altstack_hi - stack_limit) { // sp outside stack
-+ altstack_lo = altstack_hi - stack_limit;
-+ }
-+
- total_size += altstack_hi - altstack_lo;
- GC_push_all_stack(altstack_lo, altstack_hi);
- }
-diff --git a/include/gc.h b/include/gc.h
-index edab6c22..f2c61282 100644
---- a/include/gc.h
-+++ b/include/gc.h
-@@ -2172,6 +2172,11 @@ GC_API void GC_CALL GC_win32_free_heap(void);
- (*GC_amiga_allocwrapper_do)(a,GC_malloc_atomic_ignore_off_page)
- #endif /* _AMIGA && !GC_AMIGA_MAKINGLIB */
-
-+#if !__APPLE__
-+/* Patch doesn't work on apple */
-+#define NIX_BOEHM_PATCH_VERSION 1
-+#endif
-+
- #ifdef __cplusplus
- } /* extern "C" */
- #endif
-diff --git a/pthread_stop_world.c b/pthread_stop_world.c
-index b5d71e62..aed7b0bf 100644
---- a/pthread_stop_world.c
-+++ b/pthread_stop_world.c
-@@ -768,6 +768,8 @@ STATIC void GC_restart_handler(int sig)
- /* world is stopped. Should not fail if it isn't. */
- GC_INNER void GC_push_all_stacks(void)
- {
-+ size_t stack_limit;
-+ pthread_attr_t pattr;
- GC_bool found_me = FALSE;
- size_t nthreads = 0;
- int i;
-@@ -851,6 +853,37 @@ GC_INNER void GC_push_all_stacks(void)
- hi = p->altstack + p->altstack_size;
- /* FIXME: Need to scan the normal stack too, but how ? */
- /* FIXME: Assume stack grows down */
-+ } else {
-+#ifdef HAVE_PTHREAD_ATTR_GET_NP
-+ if (!pthread_attr_init(&pattr)
-+ || !pthread_attr_get_np(p->id, &pattr))
-+#else /* HAVE_PTHREAD_GETATTR_NP */
-+ if (pthread_getattr_np(p->id, &pattr))
-+#endif
-+ {
-+ ABORT("GC_push_all_stacks: pthread_getattr_np failed!");
-+ }
-+ if (pthread_attr_getstacksize(&pattr, &stack_limit)) {
-+ ABORT("GC_push_all_stacks: pthread_attr_getstacksize failed!");
-+ }
-+ if (pthread_attr_destroy(&pattr)) {
-+ ABORT("GC_push_all_stacks: pthread_attr_destroy failed!");
-+ }
-+ // When a thread goes into a coroutine, we lose its original sp until
-+ // control flow returns to the thread.
-+ // While in the coroutine, the sp points outside the thread stack,
-+ // so we can detect this and push the entire thread stack instead,
-+ // as an approximation.
-+ // We assume that the coroutine has similarly added its entire stack.
-+ // This could be made accurate by cooperating with the application
-+ // via new functions and/or callbacks.
-+ #ifndef STACK_GROWS_UP
-+ if (lo >= hi || lo < hi - stack_limit) { // sp outside stack
-+ lo = hi - stack_limit;
-+ }
-+ #else
-+ #error "STACK_GROWS_UP not supported in boost_coroutine2 (as of june 2021), so we don't support it in Nix."
-+ #endif
- }
- GC_push_all_stack_sections(lo, hi, traced_stack_sect);
- # ifdef STACK_GROWS_UP
diff --git a/boehmgc-traceable_allocator-public.diff b/boehmgc-traceable_allocator-public.diff
deleted file mode 100644
index a0c51ef4d..000000000
--- a/boehmgc-traceable_allocator-public.diff
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/include/gc_allocator.h b/include/gc_allocator.h
-index 597c7f13..587286be 100644
---- a/include/gc_allocator.h
-+++ b/include/gc_allocator.h
-@@ -312,6 +312,7 @@ public:
-
- template<>
- class traceable_allocator {
-+public:
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
- typedef void* pointer;
diff --git a/clang-tidy/.clang-format b/clang-tidy/.clang-format
deleted file mode 100644
index cd8995543..000000000
--- a/clang-tidy/.clang-format
+++ /dev/null
@@ -1 +0,0 @@
-BasedOnStyle: llvm
diff --git a/clang-tidy/.editorconfig b/clang-tidy/.editorconfig
deleted file mode 100644
index 19ee09eec..000000000
--- a/clang-tidy/.editorconfig
+++ /dev/null
@@ -1,4 +0,0 @@
-# LLVM style code is 2-space indented
-[*.{cc,hh}]
-indent_style = space
-indent_size = 2
diff --git a/clang-tidy/FixIncludes.cc b/clang-tidy/FixIncludes.cc
deleted file mode 100644
index 8ba350243..000000000
--- a/clang-tidy/FixIncludes.cc
+++ /dev/null
@@ -1,81 +0,0 @@
-#include "FixIncludes.hh"
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-namespace nix::clang_tidy {
-
-using namespace clang;
-using namespace clang::tidy;
-
-class FixIncludesCallbacks : public PPCallbacks {
-public:
- ClangTidyCheck &Check;
- Preprocessor &PP;
- FixIncludesCallbacks(ClangTidyCheck &Check, Preprocessor &PP)
- : Check(Check), PP(PP) {}
-
-private:
- bool Ignore = false;
- virtual void LexedFileChanged(FileID FID, LexedFileChangeReason Reason,
- SrcMgr::CharacteristicKind FileType,
- FileID PrevFID, SourceLocation Loc) override;
-
- virtual void InclusionDirective(SourceLocation HashLoc,
- const Token &IncludeTok, StringRef FileName,
- bool IsAngled, CharSourceRange FilenameRange,
- OptionalFileEntryRef File,
- StringRef SearchPath, StringRef RelativePath,
- const Module *Imported,
- SrcMgr::CharacteristicKind FileType) override;
-};
-
-void FixIncludesCallbacks::LexedFileChanged(FileID, LexedFileChangeReason,
- SrcMgr::CharacteristicKind FileType,
- FileID, SourceLocation) {
- Ignore = FileType != SrcMgr::C_User;
-}
-
-void FixIncludesCallbacks::InclusionDirective(
- SourceLocation, const Token &, StringRef, bool,
- CharSourceRange FilenameRange, OptionalFileEntryRef File, StringRef,
- StringRef, const Module *, SrcMgr::CharacteristicKind) {
- if (Ignore)
- return;
-
- // FIXME: this is kinda evil, but this is a one-time fixup
- const std::string SourceDir = "src/";
-
- if (File && File->getNameAsRequested().contains(SourceDir)) {
- StringRef Name = File->getNameAsRequested();
- auto Idx = Name.find(SourceDir);
- assert(Idx != std::string::npos);
- StringRef Suffix = Name.drop_front(Idx + SourceDir.length());
-
- if (!Suffix.starts_with("lib")) {
- llvm::dbgs() << "ignored: " << Suffix << "\n";
- return;
- }
-
- auto Diag = Check.diag(FilenameRange.getBegin(),
- "include needs to specify the source subdir");
-
- Diag << FilenameRange
- << FixItHint::CreateReplacement(FilenameRange,
- ("\"" + Suffix + "\"").str());
- }
-}
-
-void FixIncludesCheck::registerPPCallbacks(const SourceManager &,
- Preprocessor *PP, Preprocessor *) {
- PP->addPPCallbacks(std::make_unique(*this, *PP));
-}
-
-}; // namespace nix::clang_tidy
diff --git a/clang-tidy/FixIncludes.hh b/clang-tidy/FixIncludes.hh
deleted file mode 100644
index ea890cd39..000000000
--- a/clang-tidy/FixIncludes.hh
+++ /dev/null
@@ -1,21 +0,0 @@
-#pragma once
-///@file
-
-#include
-#include
-#include
-
-namespace nix::clang_tidy {
-
-using namespace clang;
-using namespace clang::tidy;
-
-class FixIncludesCheck : public ClangTidyCheck {
- public:
- FixIncludesCheck(StringRef Name, ClangTidyContext *Context)
- : ClangTidyCheck(Name, Context) {}
-
- void registerPPCallbacks(const SourceManager &SM, Preprocessor *PP, Preprocessor *ModuleExpanderPP) override;
-};
-
-};
diff --git a/clang-tidy/HasPrefixSuffix.cc b/clang-tidy/HasPrefixSuffix.cc
deleted file mode 100644
index e29b67e7c..000000000
--- a/clang-tidy/HasPrefixSuffix.cc
+++ /dev/null
@@ -1,80 +0,0 @@
-#include "HasPrefixSuffix.hh"
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-namespace nix::clang_tidy {
-using namespace clang::ast_matchers;
-using namespace clang;
-
-void HasPrefixSuffixCheck::registerMatchers(ast_matchers::MatchFinder *Finder) {
- Finder->addMatcher(
- traverse(clang::TK_AsIs,
- callExpr(callee(functionDecl(anyOf(hasName("hasPrefix"),
- hasName("hasSuffix")))
- .bind("callee-decl")),
- optionally(hasArgument(
- 0, cxxConstructExpr(
- hasDeclaration(functionDecl(hasParameter(
- 0, parmVarDecl(hasType(
- asString("const char *")))))))
- .bind("implicit-cast"))))
- .bind("call")),
- this);
-}
-
-void HasPrefixSuffixCheck::check(
- const ast_matchers::MatchFinder::MatchResult &Result) {
-
- const auto *CalleeDecl = Result.Nodes.getNodeAs("callee-decl");
- auto FuncName = std::string(CalleeDecl->getName());
- std::string NewName;
- if (FuncName == "hasPrefix") {
- NewName = "starts_with";
- } else if (FuncName == "hasSuffix") {
- NewName = "ends_with";
- } else {
- llvm_unreachable("nix-has-prefix: invalid callee");
- }
-
- const auto *MatchedDecl = Result.Nodes.getNodeAs("call");
- const auto *ImplicitConvertArg =
- Result.Nodes.getNodeAs("implicit-cast");
-
- const auto *Lhs = MatchedDecl->getArg(0);
- const auto *Rhs = MatchedDecl->getArg(1);
- auto Diag = diag(MatchedDecl->getExprLoc(), FuncName + " is deprecated");
-
- std::string Text = "";
-
- // Form possible cast to string_view, or nothing.
- if (ImplicitConvertArg) {
- Text = "std::string_view(";
- Text.append(tooling::getText(*Lhs, *Result.Context));
- Text.append(").");
- } else {
- Text.append(*tooling::buildAccess(*Lhs, *Result.Context));
- }
-
- // Call .starts_with.
- Text.append(NewName);
- Text.push_back('(');
- Text.append(tooling::getText(*Rhs, *Result.Context));
- Text.push_back(')');
-
- Diag << FixItHint::CreateReplacement(MatchedDecl->getSourceRange(), Text);
-
- // for (const auto *arg : MatchedDecl->arguments()) {
- // arg->dumpColor();
- // arg->getType().dump();
- // }
-}
-}; // namespace nix::clang_tidy
diff --git a/clang-tidy/HasPrefixSuffix.hh b/clang-tidy/HasPrefixSuffix.hh
deleted file mode 100644
index 8693b6767..000000000
--- a/clang-tidy/HasPrefixSuffix.hh
+++ /dev/null
@@ -1,25 +0,0 @@
-#pragma once
-///@file
-/// This is an example of a clang-tidy automated refactoring against the Nix
-/// codebase. The refactoring has been completed in
-/// https://gerrit.lix.systems/c/lix/+/565 so this code is around as
-/// an example.
-
-#include
-#include
-#include
-
-namespace nix::clang_tidy {
-
-using namespace clang;
-using namespace clang::tidy;
-using namespace llvm;
-
-class HasPrefixSuffixCheck : public ClangTidyCheck {
-public:
- HasPrefixSuffixCheck(StringRef Name, ClangTidyContext *Context)
- : ClangTidyCheck(Name, Context) {}
- void registerMatchers(ast_matchers::MatchFinder *Finder) override;
- void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
-};
-}; // namespace nix::clang_tidy
diff --git a/clang-tidy/LixClangTidyChecks.cc b/clang-tidy/LixClangTidyChecks.cc
deleted file mode 100644
index b3503dd3a..000000000
--- a/clang-tidy/LixClangTidyChecks.cc
+++ /dev/null
@@ -1,19 +0,0 @@
-#include
-#include
-#include "FixIncludes.hh"
-#include "HasPrefixSuffix.hh"
-
-namespace nix::clang_tidy {
-using namespace clang;
-using namespace clang::tidy;
-
-class NixClangTidyChecks : public ClangTidyModule {
- public:
- void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
- CheckFactories.registerCheck("lix-hasprefixsuffix");
- CheckFactories.registerCheck("lix-fixincludes");
- }
-};
-
-static ClangTidyModuleRegistry::Add X("lix-module", "Adds lix specific checks");
-};
diff --git a/clang-tidy/README.md b/clang-tidy/README.md
deleted file mode 100644
index cf46c71ec..000000000
--- a/clang-tidy/README.md
+++ /dev/null
@@ -1,56 +0,0 @@
-# Clang tidy lints for Nix
-
-This is a skeleton of a clang-tidy lints library for Nix.
-
-Currently there is one check (which is already obsolete as it has served its
-goal and is there as an example), `HasPrefixSuffixCheck`.
-
-## Running fixes/checks
-
-One file:
-
-```
-ninja -C build && clang-tidy --checks='-*,nix-*' --load=build/libnix-clang-tidy.so -p ../compile_commands.json --fix ../src/libcmd/installables.cc
-```
-
-Several files, in parallel:
-
-```
-ninja -C build && run-clang-tidy -checks='-*,nix-*' -load=build/libnix-clang-tidy.so -p .. -fix ../src | tee -a clang-tidy-result
-```
-
-## Resources
-
-* https://firefox-source-docs.mozilla.org/code-quality/static-analysis/writing-new/clang-query.html
-* https://clang.llvm.org/docs/LibASTMatchersReference.html
-* https://devblogs.microsoft.com/cppblog/exploring-clang-tooling-part-3-rewriting-code-with-clang-tidy/
-
-## Developing new checks
-
-Put something like so in `myquery.txt`:
-
-```
-set traversal IgnoreUnlessSpelledInSource
-# ^ Ignore implicit AST nodes. May need to use AsIs depending on how you are
-# working.
-set bind-root true
-# ^ true unless you use any .bind("foo") commands
-set print-matcher true
-enable output dump
-match callExpr(callee(functionDecl(hasName("hasPrefix"))), optionally(hasArgument( 0, cxxConstructExpr(hasDeclaration(functionDecl(hasParameter(0, parmVarDecl(hasType(asString("const char *"))).bind("meow2"))))))))
-```
-
-Then run, e.g. `clang-query --preload hasprefix.query -p compile_commands.json src/libcmd/installables.cc`.
-
-With this you can iterate a query before writing it in C++ and suffering from
-C++.
-
-### Tips and tricks for the C++
-
-There is a function `dump()` on many things that will dump to stderr. Also
-`llvm::errs()` lets you print to stderr.
-
-When I wrote `HasPrefixSuffixCheck`, I was not really able to figure out how
-the structured replacement system was supposed to work. In principle you can
-describe the replacement with a nice DSL. Look up the Stencil system in Clang
-for details.
diff --git a/clang-tidy/meson.build b/clang-tidy/meson.build
deleted file mode 100644
index c59164a72..000000000
--- a/clang-tidy/meson.build
+++ /dev/null
@@ -1,13 +0,0 @@
-project('lix-clang-tidy', ['cpp', 'c'],
- version : '0.1',
- default_options : ['warning_level=3', 'cpp_std=c++20'])
-
-llvm = dependency('Clang', version: '>= 14', modules: ['libclang'])
-sources = files(
- 'HasPrefixSuffix.cc',
- 'LixClangTidyChecks.cc',
- 'FixIncludes.cc',
-)
-
-shared_module('lix-clang-tidy', sources,
- dependencies: llvm)
diff --git a/configure.ac b/configure.ac
deleted file mode 100644
index 12a5873cf..000000000
--- a/configure.ac
+++ /dev/null
@@ -1,396 +0,0 @@
-AC_INIT([nix],[m4_esyscmd(bash -c "echo -n $(cat ./.version)$VERSION_SUFFIX")])
-AC_CONFIG_MACRO_DIRS([m4])
-AC_CONFIG_SRCDIR(README.md)
-AC_CONFIG_AUX_DIR(config)
-
-AC_PROG_SED
-
-# Construct a Nix system name (like "i686-linux"):
-# https://www.gnu.org/software/autoconf/manual/html_node/Canonicalizing.html#index-AC_005fCANONICAL_005fHOST-1
-# The inital value is produced by the `config/config.guess` script:
-# upstream: https://git.savannah.gnu.org/cgit/config.git/tree/config.guess
-# It has the following form, which is not documented anywhere:
-# --[][-]
-# If `./configure` is passed any of the `--host`, `--build`, `--target` options, the value comes from `config/config.sub` instead:
-# upstream: https://git.savannah.gnu.org/cgit/config.git/tree/config.sub
-AC_CANONICAL_HOST
-AC_MSG_CHECKING([for the canonical Nix system name])
-
-AC_ARG_WITH(system, AS_HELP_STRING([--with-system=SYSTEM],[Platform identifier (e.g., `i686-linux').]),
- [system=$withval],
- [case "$host_cpu" in
- i*86)
- machine_name="i686";;
- amd64)
- machine_name="x86_64";;
- armv6|armv7)
- machine_name="${host_cpu}l";;
- *)
- machine_name="$host_cpu";;
- esac
-
- case "$host_os" in
- linux-gnu*|linux-musl*)
- # For backward compatibility, strip the `-gnu' part.
- system="$machine_name-linux";;
- *)
- # Strip the version number from names such as `gnu0.3',
- # `darwin10.2.0', etc.
- system="$machine_name-`echo $host_os | "$SED" -e's/@<:@0-9.@:>@*$//g'`";;
- esac])
-
-AC_MSG_RESULT($system)
-AC_SUBST(system)
-AC_DEFINE_UNQUOTED(SYSTEM, ["$system"], [platform identifier ('cpu-os')])
-
-
-# State should be stored in /nix/var, unless the user overrides it explicitly.
-test "$localstatedir" = '${prefix}/var' && localstatedir=/nix/var
-
-# Assign a default value to C{,XX}FLAGS as the default configure script sets them
-# to -O2 otherwise, which we don't want to have hardcoded
-CFLAGS=${CFLAGS-""}
-CXXFLAGS=${CXXFLAGS-""}
-
-AC_PROG_CC
-AC_PROG_CXX
-AC_PROG_CPP
-
-AC_CHECK_TOOL([AR], [ar])
-
-# Use 64-bit file system calls so that we can support files > 2 GiB.
-AC_SYS_LARGEFILE
-
-
-# Solaris-specific stuff.
-AC_STRUCT_DIRENT_D_TYPE
-case "$host_os" in
- solaris*)
- # Solaris requires -lsocket -lnsl for network functions
- LDFLAGS="-lsocket -lnsl $LDFLAGS"
- ;;
-esac
-
-
-ENSURE_NO_GCC_BUG_80431
-
-
-# Check for pubsetbuf.
-AC_MSG_CHECKING([for pubsetbuf])
-AC_LANG_PUSH(C++)
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include
-using namespace std;
-static char buf[1024];]],
- [[cerr.rdbuf()->pubsetbuf(buf, sizeof(buf));]])],
- [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_PUBSETBUF, 1, [Whether pubsetbuf is available.])],
- AC_MSG_RESULT(no))
-AC_LANG_POP(C++)
-
-
-AC_CHECK_FUNCS([statvfs pipe2])
-
-
-# Check for lutimes, optionally used for changing the mtime of
-# symlinks.
-AC_CHECK_FUNCS([lutimes])
-
-
-# Check whether the store optimiser can optimise symlinks.
-AC_MSG_CHECKING([whether it is possible to create a link to a symlink])
-ln -s bla tmp_link
-if ln tmp_link tmp_link2 2> /dev/null; then
- AC_MSG_RESULT(yes)
- AC_DEFINE(CAN_LINK_SYMLINK, 1, [Whether link() works on symlinks.])
-else
- AC_MSG_RESULT(no)
-fi
-rm -f tmp_link tmp_link2
-
-
-# Check for .
-AC_LANG_PUSH(C++)
-AC_CHECK_HEADERS([locale])
-AC_LANG_POP(C++)
-
-
-AC_DEFUN([NEED_PROG],
-[
-AC_PATH_PROG($1, $2)
-if test -z "$$1"; then
- AC_MSG_ERROR([$2 is required])
-fi
-])
-
-NEED_PROG(bash, bash)
-AC_PATH_PROG(flex, flex, false)
-AC_PATH_PROG(bison, bison, false)
-AC_PATH_PROG(dot, dot)
-AC_PATH_PROG(lsof, lsof, lsof)
-NEED_PROG(jq, jq)
-
-
-AC_SUBST(coreutils, [$(dirname $(type -p cat))])
-
-
-AC_ARG_WITH(store-dir, AS_HELP_STRING([--with-store-dir=PATH],[path of the Nix store (defaults to /nix/store)]),
- storedir=$withval, storedir='/nix/store')
-AC_SUBST(storedir)
-
-
-# Look for boost, a required dependency.
-# Note that AX_BOOST_BASE only exports *CPP* BOOST_CPPFLAGS, no CXX flags,
-# and CPPFLAGS are not passed to the C++ compiler automatically.
-# Thus we append the returned CPPFLAGS to the CXXFLAGS here.
-AX_BOOST_BASE([1.66], [CXXFLAGS="$BOOST_CPPFLAGS $CXXFLAGS"], [AC_MSG_ERROR([Nix requires boost.])])
-# For unknown reasons, setting this directly in the ACTION-IF-FOUND above
-# ends up with LDFLAGS being empty, so we set it afterwards.
-LDFLAGS="$BOOST_LDFLAGS $LDFLAGS"
-
-# On some platforms, new-style atomics need a helper library
-AC_MSG_CHECKING(whether -latomic is needed)
-AC_LINK_IFELSE([AC_LANG_SOURCE([[
-#include
-uint64_t v;
-int main() {
- return (int)__atomic_load_n(&v, __ATOMIC_ACQUIRE);
-}]])], GCC_ATOMIC_BUILTINS_NEED_LIBATOMIC=no, GCC_ATOMIC_BUILTINS_NEED_LIBATOMIC=yes)
-AC_MSG_RESULT($GCC_ATOMIC_BUILTINS_NEED_LIBATOMIC)
-if test "x$GCC_ATOMIC_BUILTINS_NEED_LIBATOMIC" = xyes; then
- LDFLAGS="-latomic $LDFLAGS"
-fi
-
-# Running the functional tests without building Nix is useful for testing
-# different pre-built versions of Nix against each other.
-AC_ARG_ENABLE(build, AS_HELP_STRING([--disable-build],[Do not build nix]),
- ENABLE_BUILD=$enableval, ENABLE_BUILD=yes)
-AC_SUBST(ENABLE_BUILD)
-# Building without tests is useful for bootstrapping with a smaller footprint
-# or running the tests in a separate derivation. Otherwise, we do compile and
-# run them.
-AC_ARG_ENABLE(tests, AS_HELP_STRING([--disable-tests],[Do not build the tests]),
- ENABLE_TESTS=$enableval, ENABLE_TESTS=yes)
-AC_SUBST(ENABLE_TESTS)
-
-# Building without API docs is the default as Nix' C++ interfaces are internal and unstable.
-AC_ARG_ENABLE(internal_api_docs, AS_HELP_STRING([--enable-internal-api-docs],[Build API docs for Nix's internal unstable C++ interfaces]),
- internal_api_docs=$enableval, internal_api_docs=no)
-AC_SUBST(internal_api_docs)
-
-# LTO is currently broken with clang for unknown reasons; ld segfaults in the llvm plugin
-AC_ARG_ENABLE(lto, AS_HELP_STRING([--enable-lto],[Enable LTO (only supported with GCC) [default=no]]),
- lto=$enableval, lto=no)
-if test "$lto" = yes; then
- if $CXX --version | grep -q GCC; then
- AC_SUBST(CXXLTO, [-flto=jobserver])
- else
- echo "error: LTO is only supported with GCC at the moment" >&2
- exit 1
- fi
-else
- AC_SUBST(CXXLTO, [""])
-fi
-
-PKG_PROG_PKG_CONFIG
-
-AC_ARG_ENABLE(shared, AS_HELP_STRING([--enable-shared],[Build shared libraries for Nix [default=yes]]),
- shared=$enableval, shared=yes)
-if test "$shared" = yes; then
- AC_SUBST(BUILD_SHARED_LIBS, 1, [Whether to build shared libraries.])
-else
- AC_SUBST(BUILD_SHARED_LIBS, 0, [Whether to build shared libraries.])
- PKG_CONFIG="$PKG_CONFIG --static"
-fi
-
-# Look for OpenSSL, a required dependency. FIXME: this is only (maybe)
-# used by S3BinaryCacheStore.
-PKG_CHECK_MODULES([OPENSSL], [libcrypto >= 1.1.1], [CXXFLAGS="$OPENSSL_CFLAGS $CXXFLAGS"])
-
-
-# Look for libarchive.
-PKG_CHECK_MODULES([LIBARCHIVE], [libarchive >= 3.1.2], [CXXFLAGS="$LIBARCHIVE_CFLAGS $CXXFLAGS"])
-# Workaround until https://github.com/libarchive/libarchive/issues/1446 is fixed
-if test "$shared" != yes; then
- LIBARCHIVE_LIBS+=' -lz'
-fi
-
-# Look for SQLite, a required dependency.
-PKG_CHECK_MODULES([SQLITE3], [sqlite3 >= 3.6.19], [CXXFLAGS="$SQLITE3_CFLAGS $CXXFLAGS"])
-
-# Look for libcurl, a required dependency.
-PKG_CHECK_MODULES([LIBCURL], [libcurl], [CXXFLAGS="$LIBCURL_CFLAGS $CXXFLAGS"])
-
-# Look for editline, a required dependency.
-# The the libeditline.pc file was added only in libeditline >= 1.15.2,
-# see https://github.com/troglobit/editline/commit/0a8f2ef4203c3a4a4726b9dd1336869cd0da8607,
-# but e.g. Ubuntu 16.04 has an older version, so we fall back to searching for
-# editline.h when the pkg-config approach fails.
-PKG_CHECK_MODULES([EDITLINE], [libeditline], [CXXFLAGS="$EDITLINE_CFLAGS $CXXFLAGS"], [
- AC_CHECK_HEADERS([editline.h], [true],
- [AC_MSG_ERROR([Nix requires libeditline; it was found neither via pkg-config nor its normal header.])])
- AC_SEARCH_LIBS([readline read_history], [editline], [],
- [AC_MSG_ERROR([Nix requires libeditline; it was not found via pkg-config, but via its header, but required functions do not work. Maybe it is too old? >= 1.14 is required.])])
-])
-
-# Look for libsodium.
-PKG_CHECK_MODULES([SODIUM], [libsodium], [CXXFLAGS="$SODIUM_CFLAGS $CXXFLAGS"])
-
-# Look for libbrotli{enc,dec}.
-PKG_CHECK_MODULES([LIBBROTLI], [libbrotlienc libbrotlidec], [CXXFLAGS="$LIBBROTLI_CFLAGS $CXXFLAGS"])
-
-# Look for libcpuid.
-have_libcpuid=
-if test "$machine_name" = "x86_64"; then
- AC_ARG_ENABLE([cpuid],
- AS_HELP_STRING([--disable-cpuid], [Do not determine microarchitecture levels with libcpuid (relevant to x86_64 only)]))
- if test "x$enable_cpuid" != "xno"; then
- PKG_CHECK_MODULES([LIBCPUID], [libcpuid],
- [CXXFLAGS="$LIBCPUID_CFLAGS $CXXFLAGS"
- have_libcpuid=1
- AC_DEFINE([HAVE_LIBCPUID], [1], [Use libcpuid])]
- )
- fi
-fi
-AC_SUBST(HAVE_LIBCPUID, [$have_libcpuid])
-
-
-# Look for libseccomp, required for Linux sandboxing.
-case "$host_os" in
- linux*)
- AC_ARG_ENABLE([seccomp-sandboxing],
- AS_HELP_STRING([--disable-seccomp-sandboxing],[Don't build support for seccomp sandboxing (only recommended if your arch doesn't support libseccomp yet!)
- ]))
- if test "x$enable_seccomp_sandboxing" != "xno"; then
- PKG_CHECK_MODULES([LIBSECCOMP], [libseccomp],
- [CXXFLAGS="$LIBSECCOMP_CFLAGS $CXXFLAGS"])
- have_seccomp=1
- AC_DEFINE([HAVE_SECCOMP], [1], [Whether seccomp is available and should be used for sandboxing.])
- else
- have_seccomp=
- fi
- ;;
- *)
- have_seccomp=
- ;;
-esac
-AC_SUBST(HAVE_SECCOMP, [$have_seccomp])
-
-
-# Look for aws-cpp-sdk-s3.
-AC_LANG_PUSH(C++)
-AC_CHECK_HEADERS([aws/s3/S3Client.h],
- [AC_DEFINE([ENABLE_S3], [1], [Whether to enable S3 support via aws-sdk-cpp.]) enable_s3=1],
- [AC_DEFINE([ENABLE_S3], [0], [Whether to enable S3 support via aws-sdk-cpp.]) enable_s3=])
-AC_SUBST(ENABLE_S3, [$enable_s3])
-AC_LANG_POP(C++)
-
-if test -n "$enable_s3"; then
- declare -a aws_version_tokens=($(printf '#include \nAWS_SDK_VERSION_STRING' | $CPP $CPPFLAGS - | grep -v '^#.*' | sed 's/"//g' | tr '.' ' '))
- AC_DEFINE_UNQUOTED([AWS_VERSION_MAJOR], ${aws_version_tokens@<:@0@:>@}, [Major version of aws-sdk-cpp.])
- AC_DEFINE_UNQUOTED([AWS_VERSION_MINOR], ${aws_version_tokens@<:@1@:>@}, [Minor version of aws-sdk-cpp.])
- AC_DEFINE_UNQUOTED([AWS_VERSION_PATCH], ${aws_version_tokens@<:@2@:>@}, [Patch version of aws-sdk-cpp.])
-fi
-
-
-# Whether to use the Boehm garbage collector.
-AC_ARG_ENABLE(gc, AS_HELP_STRING([--enable-gc],[enable garbage collection in the Nix expression evaluator (requires Boehm GC) [default=yes]]),
- gc=$enableval, gc=yes)
-if test "$gc" = yes; then
- PKG_CHECK_MODULES([BDW_GC], [bdw-gc])
- CXXFLAGS="$BDW_GC_CFLAGS $CXXFLAGS"
- AC_DEFINE(HAVE_BOEHMGC, 1, [Whether to use the Boehm garbage collector.])
-fi
-
-
-if test "$ENABLE_TESTS" = yes; then
-
-# Look for gtest.
-PKG_CHECK_MODULES([GTEST], [gtest_main gmock_main])
-
-
-# Look for rapidcheck.
-AC_ARG_VAR([RAPIDCHECK_HEADERS], [include path of gtest headers shipped by RAPIDCHECK])
-# No pkg-config yet, https://github.com/emil-e/rapidcheck/issues/302
-AC_LANG_PUSH(C++)
-AC_SUBST(RAPIDCHECK_HEADERS)
-[CXXFLAGS="-I $RAPIDCHECK_HEADERS $CXXFLAGS"]
-[LIBS="-lrapidcheck -lgtest $LIBS"]
-AC_CHECK_HEADERS([rapidcheck/gtest.h], [], [], [#include ])
-dnl AC_CHECK_LIB doesn't work for C++ libs with mangled symbols
-AC_LINK_IFELSE([
- AC_LANG_PROGRAM([[
- #include
- #include
- ]], [[
- return RUN_ALL_TESTS();
- ]])
- ],
- [],
- [AC_MSG_ERROR([librapidcheck is not found.])])
-AC_LANG_POP(C++)
-
-fi
-
-# Look for nlohmann/json.
-PKG_CHECK_MODULES([NLOHMANN_JSON], [nlohmann_json >= 3.9])
-
-
-# documentation generation switch
-AC_ARG_ENABLE(doc-gen, AS_HELP_STRING([--disable-doc-gen],[disable documentation generation]),
- doc_generate=$enableval, doc_generate=yes)
-AC_SUBST(doc_generate)
-
-# Look for lowdown library.
-PKG_CHECK_MODULES([LOWDOWN], [lowdown >= 0.9.0], [CXXFLAGS="$LOWDOWN_CFLAGS $CXXFLAGS"])
-
-# Look for toml11, a required dependency.
-AC_ARG_VAR([TOML11_HEADERS], [include path of toml11 headers])
-AC_LANG_PUSH(C++)
-[CXXFLAGS="-I $TOML11_HEADERS $CXXFLAGS"]
-AC_CHECK_HEADER([toml.hpp], [], [AC_MSG_ERROR([toml11 is not found.])])
-AC_LANG_POP(C++)
-
-# Setuid installations.
-AC_CHECK_FUNCS([setresuid setreuid lchown])
-
-
-# Nice to have, but not essential.
-AC_CHECK_FUNCS([strsignal posix_fallocate sysconf])
-
-
-AC_ARG_WITH(sandbox-shell, AS_HELP_STRING([--with-sandbox-shell=PATH],[path of a statically-linked shell to use as /bin/sh in sandboxes]),
- sandbox_shell=$withval)
-AC_SUBST(sandbox_shell)
-if test ${cross_compiling:-no} = no && ! test -z ${sandbox_shell+x}; then
- AC_MSG_CHECKING([whether sandbox-shell has the standalone feature])
- # busybox shell sometimes allows executing other busybox applets,
- # even if they are not in the path, breaking our sandbox
- if PATH= $sandbox_shell -c "busybox" 2>&1 | grep -qv "not found"; then
- AC_MSG_RESULT(enabled)
- AC_MSG_ERROR([Please disable busybox FEATURE_SH_STANDALONE])
- else
- AC_MSG_RESULT(disabled)
- fi
-fi
-
-AC_ARG_ENABLE(embedded-sandbox-shell, AS_HELP_STRING([--enable-embedded-sandbox-shell],[include the sandbox shell in the Nix binary [default=no]]),
- embedded_sandbox_shell=$enableval, embedded_sandbox_shell=no)
-AC_SUBST(embedded_sandbox_shell)
-if test "$embedded_sandbox_shell" = yes; then
- AC_DEFINE(HAVE_EMBEDDED_SANDBOX_SHELL, 1, [Include the sandbox shell in the Nix binary.])
-fi
-
-
-# Expand all variables in config.status.
-test "$prefix" = NONE && prefix=$ac_default_prefix
-test "$exec_prefix" = NONE && exec_prefix='${prefix}'
-for name in $ac_subst_vars; do
- declare $name="$(eval echo "${!name}")"
- declare $name="$(eval echo "${!name}")"
- declare $name="$(eval echo "${!name}")"
-done
-
-rm -f Makefile.config
-
-AC_CONFIG_HEADERS([config.h])
-AC_CONFIG_FILES([])
-AC_OUTPUT
diff --git a/contrib/stack-collapse.py b/contrib/stack-collapse.py
deleted file mode 100755
index f5602c95c..000000000
--- a/contrib/stack-collapse.py
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/env nix-shell
-#!nix-shell -i python3 -p python3 --pure
-
-# To be used with `--trace-function-calls` and `flamegraph.pl`.
-#
-# For example:
-#
-# nix-instantiate --trace-function-calls '' -A hello 2> nix-function-calls.trace
-# ./contrib/stack-collapse.py nix-function-calls.trace > nix-function-calls.folded
-# nix-shell -p flamegraph --run "flamegraph.pl nix-function-calls.folded > nix-function-calls.svg"
-
-import sys
-from pprint import pprint
-import fileinput
-
-stack = []
-timestack = []
-
-for line in fileinput.input():
- components = line.strip().split(" ", 2)
- if components[0] != "function-trace":
- continue
-
- direction = components[1]
- components = components[2].rsplit(" ", 2)
-
- loc = components[0]
- _at = components[1]
- time = int(components[2])
-
- if direction == "entered":
- stack.append(loc)
- timestack.append(time)
- elif direction == "exited":
- dur = time - timestack.pop()
- vst = ";".join(stack)
- print(f"{vst} {dur}")
- stack.pop()
diff --git a/default.nix b/default.nix
deleted file mode 100644
index 6466507b7..000000000
--- a/default.nix
+++ /dev/null
@@ -1,9 +0,0 @@
-(import (
- let
- lock = builtins.fromJSON (builtins.readFile ./flake.lock);
- in
- fetchTarball {
- url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
- sha256 = lock.nodes.flake-compat.locked.narHash;
- }
-) { src = ./.; }).defaultNix
diff --git a/doc/internal-api/.gitignore b/doc/internal-api/.gitignore
deleted file mode 100644
index dab28b6b0..000000000
--- a/doc/internal-api/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-/doxygen.cfg
-/html
-/latex
diff --git a/doc/internal-api/doxygen.cfg.in b/doc/internal-api/doxygen.cfg.in
deleted file mode 100644
index 55bccebd7..000000000
--- a/doc/internal-api/doxygen.cfg.in
+++ /dev/null
@@ -1,99 +0,0 @@
-# Doxyfile 1.9.5
-
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
-# double-quotes, unless you are using Doxywizard) that should identify the
-# project for which the documentation is generated. This name is used in the
-# title of most generated pages and in a few other places.
-# The default value is: My Project.
-
-PROJECT_NAME = "Nix"
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
-# could be handy for archiving the generated documentation or if some version
-# control system is used.
-
-PROJECT_NUMBER = @PACKAGE_VERSION@
-
-OUTPUT_DIRECTORY = @docdir@
-
-# Using the PROJECT_BRIEF tag one can provide an optional one line description
-# for a project that appears at the top of each page and should give viewer a
-# quick idea about the purpose of the project. Keep the description short.
-
-PROJECT_BRIEF = "Nix, the purely functional package manager; unstable internal interfaces"
-
-# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
-# The default value is: YES.
-
-GENERATE_LATEX = NO
-
-# The INPUT tag is used to specify the files and/or directories that contain
-# documented source files. You may enter file names like myfile.cpp or
-# directories like /usr/src/myproject. Separate the files or directories with
-# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
-# Note: If this tag is empty the current directory is searched.
-
-# FIXME Make this list more maintainable somehow. We could maybe generate this
-# in the Makefile, but we would need to change how `.in` files are preprocessed
-# so they can expand variables despite configure variables.
-
-INPUT = \
- src/libcmd \
- src/libexpr \
- src/libexpr/flake \
- tests/unit/libexpr \
- tests/unit/libexpr/value \
- tests/unit/libexpr/test \
- tests/unit/libexpr/test/value \
- src/libexpr/value \
- src/libfetchers \
- src/libmain \
- src/libstore \
- src/libstore/build \
- src/libstore/builtins \
- tests/unit/libstore \
- tests/unit/libstore/test \
- src/libutil \
- tests/unit/libutil \
- tests/unit/libutil/test \
- src/nix \
- src/nix-env \
- src/nix-store
-
-# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names
-# in the source code. If set to NO, only conditional compilation will be
-# performed. Macro expansion can be done in a controlled way by setting
-# EXPAND_ONLY_PREDEF to YES.
-# The default value is: NO.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-MACRO_EXPANSION = YES
-
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
-# the macro expansion is limited to the macros specified with the PREDEFINED and
-# EXPAND_AS_DEFINED tags.
-# The default value is: NO.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-EXPAND_ONLY_PREDEF = YES
-
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by the
-# preprocessor. Note that the INCLUDE_PATH is not recursive, so the setting of
-# RECURSIVE has no effect here.
-# This tag requires that the tag SEARCH_INCLUDES is set to YES.
-
-INCLUDE_PATH = @RAPIDCHECK_HEADERS@
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
-# tag can be used to specify a list of macro names that should be expanded. The
-# macro definition that is found in the sources will be used. Use the PREDEFINED
-# tag if you want to use a different macro definition that overrules the
-# definition found in the source code.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-EXPAND_AS_DEFINED = \
- DECLARE_COMMON_SERIALISER \
- DECLARE_WORKER_SERIALISER \
- DECLARE_SERVE_SERIALISER \
- LENGTH_PREFIXED_PROTO_HELPER
diff --git a/doc/internal-api/local.mk b/doc/internal-api/local.mk
deleted file mode 100644
index 890f341b7..000000000
--- a/doc/internal-api/local.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-.PHONY: internal-api-html
-
-ifeq ($(internal_api_docs), yes)
-
-$(docdir)/internal-api/html/index.html $(docdir)/internal-api/latex: $(d)/doxygen.cfg
- mkdir -p $(docdir)/internal-api
- { cat $< ; echo "OUTPUT_DIRECTORY=$(docdir)/internal-api" ; } | doxygen -
-
-# Generate the HTML API docs for Nix's unstable internal interfaces.
-internal-api-html: $(docdir)/internal-api/html/index.html
-
-else
-
-# Make a nicer error message
-internal-api-html:
- @echo "Internal API docs are disabled. Configure with '--enable-internal-api-docs', or avoid calling 'make internal-api-html'."
- @exit 1
-
-endif
diff --git a/doc/internal-api/meson.build b/doc/internal-api/meson.build
deleted file mode 100644
index 35d8a0e5b..000000000
--- a/doc/internal-api/meson.build
+++ /dev/null
@@ -1,33 +0,0 @@
-doxygen_cfg = configure_file(
- input : 'doxygen.cfg.in',
- output : 'doxygen.cfg',
- configuration : {
- 'PACKAGE_VERSION': meson.project_version(),
- 'RAPIDCHECK_HEADERS': rapidcheck_meson.get_variable('includedir'),
- 'docdir' : meson.current_build_dir(),
- },
-)
-
-internal_api_docs = custom_target(
- 'internal-api-docs',
- command : [
- bash,
- # Meson can you please just give us a `workdir` argument to custom targets...
- '-c',
- # We have to prefix the doxygen_cfg path with the project build root
- # because of the cd in front.
- 'cd @0@ && @1@ @2@/@INPUT0@'.format(
- meson.project_source_root(),
- doxygen.full_path(),
- meson.project_build_root(),
- ),
- ],
- input : [
- doxygen_cfg,
- ],
- output : 'html',
- install : true,
- install_dir : datadir / 'doc/nix/internal-api',
-)
-
-alias_target('internal-api-html', internal_api_docs)
diff --git a/doc/manual/anchors.jq b/doc/manual/anchors.jq
deleted file mode 100644
index 72309779c..000000000
--- a/doc/manual/anchors.jq
+++ /dev/null
@@ -1,31 +0,0 @@
-"\\[\\]\\{#(?[^\\}]+?)\\}" as $empty_anchor_regex |
-"\\[(?[^\\]]+?)\\]\\{#(?[^\\}]+?)\\}" as $anchor_regex |
-
-
-def transform_anchors_html:
- . | gsub($empty_anchor_regex; "")
- | gsub($anchor_regex; "" + .text + "");
-
-
-def transform_anchors_strip:
- . | gsub($empty_anchor_regex; "")
- | gsub($anchor_regex; .text);
-
-
-def map_contents_recursively(transformer):
- . + {
- Chapter: (.Chapter + {
- content: .Chapter.content | transformer,
- sub_items: .Chapter.sub_items | map(map_contents_recursively(transformer)),
- }),
- };
-
-
-def process_command:
- .[0] as $context |
- .[1] as $body |
- $body + {
- sections: $body.sections | map(map_contents_recursively(if $context.renderer == "html" then transform_anchors_html else transform_anchors_strip end)),
- };
-
-process_command
diff --git a/doc/manual/book.toml b/doc/manual/book.toml
deleted file mode 100644
index 1030f96bb..000000000
--- a/doc/manual/book.toml
+++ /dev/null
@@ -1,38 +0,0 @@
-[book]
-title = "Lix Reference Manual"
-
-[build]
-create-missing = false
-
-[output.html]
-additional-css = ["custom.css"]
-additional-js = ["redirects.js"]
-# Using our GitHub mirror enables easier typo fixes since there is no easy way
-# to just submit a Gerrit CL by the web for trivial stuff.
-edit-url-template = "https://github.com/lix-project/lix/tree/main/doc/manual/{path}"
-git-repository-url = "https://git.lix.systems/lix-project/lix"
-
-# Handles replacing @docroot@ with a path to ./src relative to that markdown file,
-# {{#include handlebars}}, and the @generated@ syntax used within these. it mostly
-# but not entirely replaces the links preprocessor (which we cannot simply use due
-# to @generated@ files living in a different directory to make meson happy). we do
-# not want to disable the links preprocessor entirely though because that requires
-# disabling *all* built-in preprocessors and selectively reenabling those we want.
-[preprocessor.substitute]
-command = "python3 doc/manual/substitute.py"
-before = ["anchors", "links"]
-
-[preprocessor.anchors]
-renderers = ["html"]
-command = "jq --from-file doc/manual/anchors.jq"
-
-[output.markdown]
-
-[output.linkcheck]
-# no Internet during the build (in the sandbox)
-follow-web-links = false
-
-# mdbook-linkcheck does not understand [foo]{#bar} style links, resulting in
-# excessive "Potential incomplete link" warnings. No other kind of warning was
-# produced at the time of writing.
-warning-policy = "ignore"
diff --git a/doc/manual/custom.css b/doc/manual/custom.css
deleted file mode 100644
index b90f5423f..000000000
--- a/doc/manual/custom.css
+++ /dev/null
@@ -1,11 +0,0 @@
-h1:not(:first-of-type) {
- margin-top: 1.3em;
-}
-
-h2 {
- margin-top: 1em;
-}
-
-.hljs-meta {
- user-select: none;
-}
diff --git a/doc/manual/generate-builtin-constants.nix b/doc/manual/generate-builtin-constants.nix
deleted file mode 100644
index 23ec2cb55..000000000
--- a/doc/manual/generate-builtin-constants.nix
+++ /dev/null
@@ -1,37 +0,0 @@
-let
- inherit (builtins) concatStringsSep attrValues mapAttrs;
- inherit (import ./utils.nix) optionalString squash;
-in
-
-builtinsInfo:
-let
- showBuiltin =
- name:
- {
- doc,
- type,
- impure-only,
- }:
- let
- type' = optionalString (type != null) " (${type})";
-
- impureNotice = optionalString impure-only ''
- > **Note**
- >
- > Not available in [pure evaluation mode](@docroot@/command-ref/conf-file.md#conf-pure-eval).
- '';
- in
- squash ''
-
- ${name}
${type'}
-
-
-
- ${doc}
-
- ${impureNotice}
-
-
- '';
-in
-concatStringsSep "\n" (attrValues (mapAttrs showBuiltin builtinsInfo))
diff --git a/doc/manual/generate-builtins.nix b/doc/manual/generate-builtins.nix
deleted file mode 100644
index 60cba266b..000000000
--- a/doc/manual/generate-builtins.nix
+++ /dev/null
@@ -1,35 +0,0 @@
-let
- inherit (builtins) concatStringsSep attrValues mapAttrs;
- inherit (import ./utils.nix) optionalString squash;
-in
-
-builtinsInfo:
-let
- showBuiltin =
- name:
- {
- doc,
- args,
- arity,
- experimental-feature,
- }:
- let
- experimentalNotice = optionalString (experimental-feature != null) ''
- This function is only available if the [${experimental-feature}](@docroot@/contributing/experimental-features.md#xp-feature-${experimental-feature}) experimental feature is enabled.
- '';
- in
- squash ''
-
- ${name} ${listArgs args}
-
-
-
- ${doc}
-
- ${experimentalNotice}
-
-
- '';
- listArgs = args: concatStringsSep " " (map (s: "${s}") args);
-in
-concatStringsSep "\n" (attrValues (mapAttrs showBuiltin builtinsInfo))
diff --git a/doc/manual/generate-deps.py b/doc/manual/generate-deps.py
deleted file mode 100755
index 297bd3939..000000000
--- a/doc/manual/generate-deps.py
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/env python3
-
-import glob
-import sys
-
-# meson expects makefile-style dependency declarations, i.e.
-#
-# target: dependency...
-#
-# meson seems to pass depfiles straight on to ninja even though
-# it also parses the file itself (or at least has code to do so
-# in its tree), so we must live by ninja's rules: only slashes,
-# spaces and octothorpes can be escaped, anything else is taken
-# literally. since the rules for these aren't even the same for
-# all three we will just fail when we encounter any of them (if
-# asserts are off for some reason the depfile will likely point
-# to nonexistant paths, making everything phony and thus fine.)
-for path in glob.glob(sys.argv[1] + '/**', recursive=True):
- assert '\\' not in path
- assert ' ' not in path
- assert '#' not in path
- print("ignored:", path)
diff --git a/doc/manual/generate-manpage.nix b/doc/manual/generate-manpage.nix
deleted file mode 100644
index 5c6a2a48a..000000000
--- a/doc/manual/generate-manpage.nix
+++ /dev/null
@@ -1,224 +0,0 @@
-let
- inherit (builtins)
- attrNames
- attrValues
- fromJSON
- listToAttrs
- mapAttrs
- concatStringsSep
- concatMap
- length
- lessThan
- replaceStrings
- sort
- ;
- inherit (import ./utils.nix)
- concatStrings
- optionalString
- filterAttrs
- trim
- squash
- unique
- showSettings
- ;
-in
-
-inlineHTML: commandDump:
-
-let
-
- commandInfo = fromJSON commandDump;
-
- showCommand =
- {
- command,
- details,
- filename,
- toplevel,
- }:
- let
-
- result = ''
- > **Warning** \
- > This program is
- > [**experimental**](@docroot@/contributing/experimental-features.md#xp-feature-nix-command)
- > and its interface is subject to change.
-
- # Name
-
- `${command}` - ${details.description}
-
- # Synopsis
-
- ${showSynopsis command details.args}
-
- ${maybeSubcommands}
-
- ${maybeStoreDocs}
-
- ${maybeOptions}
- '';
-
- showSynopsis =
- command: args:
- let
- showArgument = arg: "*${arg.label}*" + optionalString (!arg ? arity) "...";
- arguments = concatStringsSep " " (map showArgument args);
- in
- ''
- `${command}` [*option*...] ${arguments}
- '';
-
- maybeSubcommands = optionalString (details ? commands && details.commands != { }) ''
- where *subcommand* is one of the following:
-
- ${subcommands}
- '';
-
- subcommands = if length categories > 1 then listCategories else listSubcommands details.commands;
-
- categories = sort (x: y: x.id < y.id) (
- unique (map (cmd: cmd.category) (attrValues details.commands))
- );
-
- listCategories = concatStrings (map showCategory categories);
-
- showCategory = cat: ''
- **${toString cat.description}:**
-
- ${listSubcommands (filterAttrs (n: v: v.category == cat) details.commands)}
- '';
-
- listSubcommands = cmds: concatStrings (attrValues (mapAttrs showSubcommand cmds));
-
- showSubcommand = name: subcmd: ''
- * [`${command} ${name}`](./${appendName filename name}.md) - ${subcmd.description}
- '';
-
- # TODO: move this confusing special case out of here when implementing #8496
- maybeStoreDocs = optionalString (details ? doc) (
- replaceStrings [ "@stores@" ] [ storeDocs ] details.doc
- );
-
- maybeOptions = optionalString (details.flags != { }) ''
- # Options
-
- ${showOptions details.flags toplevel.flags}
-
- > **Note**
- >
- > See [`man nix.conf`](@docroot@/command-ref/conf-file.md#command-line-flags) for overriding configuration settings with command line flags.
- '';
-
- showOptions =
- options: commonOptions:
- let
- allOptions = options // commonOptions;
- showCategory = cat: ''
- ${optionalString (cat != "") "**${cat}:**"}
-
- ${listOptions (filterAttrs (n: v: v.category == cat) allOptions)}
- '';
- listOptions = opts: concatStringsSep "\n" (attrValues (mapAttrs showOption opts));
- showOption =
- name: option:
- let
- result = trim ''
- - ${item}
- ${option.description}
- '';
- item =
- if inlineHTML then
- ''[`--${name}`](#opt-${name}) ${shortName} ${labels}''
- else
- "`--${name}` ${shortName} ${labels}";
- shortName = optionalString (option ? shortName) ("/ `-${option.shortName}`");
- labels = optionalString (option ? labels) (concatStringsSep " " (map (s: "*${s}*") option.labels));
- in
- result;
- categories = sort lessThan (unique (map (cmd: cmd.category) (attrValues allOptions)));
- in
- concatStrings (map showCategory categories);
- in
- squash result;
-
- appendName = filename: name: (if filename == "nix" then "nix3" else filename) + "-" + name;
-
- processCommand =
- {
- command,
- details,
- filename,
- toplevel,
- }:
- let
- cmd = {
- inherit command;
- name = filename + ".md";
- value = showCommand {
- inherit
- command
- details
- filename
- toplevel
- ;
- };
- };
- subcommand =
- subCmd:
- processCommand {
- command = command + " " + subCmd;
- details = details.commands.${subCmd};
- filename = appendName filename subCmd;
- inherit toplevel;
- };
- in
- [ cmd ] ++ concatMap subcommand (attrNames details.commands or { });
-
- manpages = processCommand {
- command = "nix";
- details = commandInfo.args;
- filename = "nix";
- toplevel = commandInfo.args;
- };
-
- storeDocs =
- let
- showStore =
- name:
- {
- settings,
- doc,
- experimentalFeature,
- }:
- let
- experimentalFeatureNote = optionalString (experimentalFeature != null) ''
- > **Warning**
- > This store is part of an
- > [experimental feature](@docroot@/contributing/experimental-features.md).
-
- To use this store, you need to make sure the corresponding experimental feature,
- [`${experimentalFeature}`](@docroot@/contributing/experimental-features.md#xp-feature-${experimentalFeature}),
- is enabled.
- For example, include the following in [`nix.conf`](@docroot@/command-ref/conf-file.md):
-
- ```
- extra-experimental-features = ${experimentalFeature}
- ```
- '';
- in
- ''
- ## ${name}
-
- ${doc}
-
- ${experimentalFeatureNote}
-
- **Settings**:
-
- ${showSettings { inherit inlineHTML; } settings}
- '';
- in
- concatStrings (attrValues (mapAttrs showStore commandInfo.stores));
-in
-listToAttrs manpages
diff --git a/doc/manual/generate-xp-features-shortlist.nix b/doc/manual/generate-xp-features-shortlist.nix
deleted file mode 100644
index ea8bf8d49..000000000
--- a/doc/manual/generate-xp-features-shortlist.nix
+++ /dev/null
@@ -1,9 +0,0 @@
-with builtins;
-with import ./utils.nix;
-
-let
- showExperimentalFeature = name: doc: ''
- - [`${name}`](@docroot@/contributing/experimental-features.md#xp-feature-${name})
- '';
-in
-xps: indent " " (concatStrings (attrValues (mapAttrs showExperimentalFeature xps)))
diff --git a/doc/manual/generate-xp-features.nix b/doc/manual/generate-xp-features.nix
deleted file mode 100644
index c56ddeea1..000000000
--- a/doc/manual/generate-xp-features.nix
+++ /dev/null
@@ -1,13 +0,0 @@
-with builtins;
-with import ./utils.nix;
-
-let
- showExperimentalFeature =
- name: doc:
- squash ''
- ## [`${name}`]{#xp-feature-${name}}
-
- ${doc}
- '';
-in
-xps: (concatStringsSep "\n" (attrValues (mapAttrs showExperimentalFeature xps)))
diff --git a/doc/manual/json-to-tree.py b/doc/manual/json-to-tree.py
deleted file mode 100755
index 27c8e417c..000000000
--- a/doc/manual/json-to-tree.py
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/usr/bin/env python3
-
-"""
-This script is a helper for this project's Meson buildsystem, to replace its
-usage of `nix eval --write-to`. Writing a JSON object as a nested directory
-tree is more generic, easier to maintain, and far, far less cursed. Nix
-has 'good' support for JSON output. Let's just use it.
-"""
-
-import argparse
-from pathlib import Path
-import json
-import sys
-
-name = 'json-to-tree.py'
-
-def log(*args, **kwargs):
- kwargs['file'] = sys.stderr
- return print(f'{name}:', *args, **kwargs)
-
-def write_dict_to_directory(current_directory: Path, data: dict, files_written=0):
- current_directory.mkdir(parents=True, exist_ok=True)
- for key, value in data.items():
- nested_path = current_directory / key
- match value:
- case dict(nested_data):
- files_written += write_dict_to_directory(nested_path, nested_data)
-
- case str(content):
- nested_path.write_text(content)
- files_written += 1
-
- case rest:
- assert False, \
- f'should have been called on a dict or string, not {type(rest)=}\n\t{rest=}'
-
- return files_written
-
-def main():
- parser = argparse.ArgumentParser(name)
- parser.add_argument('-i', '--input', type=argparse.FileType('r'), default='-',
- help='The JSON input to operate on and output as a directory tree',
- )
- parser.add_argument('-o', '--output', type=Path, required=True,
- help='The place to put the directory tree',
- )
- args = parser.parse_args()
-
- json_string = args.input.read()
-
- try:
- data = json.loads(json_string)
- except json.JSONDecodeError:
- log(f'could not decode JSON from input: {json_string}')
- raise
-
-
- files_written = write_dict_to_directory(args.output, data)
- log(f'wrote {files_written} files')
-
-sys.exit(main())
diff --git a/doc/manual/local.mk b/doc/manual/local.mk
deleted file mode 100644
index 50c67b8ae..000000000
--- a/doc/manual/local.mk
+++ /dev/null
@@ -1,178 +0,0 @@
-ifeq ($(doc_generate),yes)
-
-# The version of Nix used to generate the doc. Can also be
-# `$(nix_INSTALL_PATH)` or just `nix` (to grap ambient from the `PATH`),
-# if one prefers.
-doc_nix = $(nix_PATH)
-
-MANUAL_SRCS := \
- $(call rwildcard, $(d)/src, *.md) \
- $(call rwildcard, $(d)/src, */*.md)
-
-man-pages := $(foreach n, \
- nix-env.1 nix-store.1 \
- nix-build.1 nix-shell.1 nix-instantiate.1 \
- nix-collect-garbage.1 \
- nix-prefetch-url.1 nix-channel.1 \
- nix-hash.1 nix-copy-closure.1 \
- nix.conf.5 nix-daemon.8 \
- nix-profiles.5 \
-, doc/manual/generated/in/$(n))
-
-# man pages for subcommands
-# convert from `$(d)/src/command-ref/nix-{1}/{2}.md` to `$(d)/nix-{1}-{2}.1`
-# FIXME: unify with how nix3-cli man pages are generated
-man-pages += $(foreach subcommand, \
- $(filter-out %opt-common.md %env-common.md, $(wildcard $(d)/src/command-ref/nix-*/*.md)), \
- doc/manual/generated/in/$(subst /,-,$(subst $(d)/src/command-ref/,,$(subst .md,.1,$(subcommand)))))
-
-clean-files += $(d)/*.1 $(d)/*.5 $(d)/*.8
-
-# Provide a dummy environment for nix, so that it will not access files outside the macOS sandbox.
-# Set cores to 0 because otherwise nix config show resolves the cores based on the current machine
-dummy-env = env -i \
- HOME=/dummy \
- NIX_CONF_DIR=/dummy \
- NIX_SSL_CERT_FILE=/dummy/no-ca-bundle.crt \
- NIX_STATE_DIR=/dummy \
- NIX_CONFIG='cores = 0'
-
-nix-eval = $(dummy-env) $(doc_nix) eval --experimental-features nix-command -I nix/corepkgs=corepkgs --store dummy:// --impure --raw
-
-doc/manual/generated/in/nix-env-%.1: doc/manual/generated/out
- $(trace-gen) doc/manual/render-manpage.sh \
- --out-no-smarty "$(subst nix-env-,nix-env --,$$(basename "$@" .1))" 1 \
- doc/manual/generated/out/markdown/command-ref/nix-env/$*.md \
- $@
-
-doc/manual/generated/in/nix-store-%.1: doc/manual/generated/out
- $(trace-gen) doc/manual/render-manpage.sh \
- --out-no-smarty "$(subst nix-store-,nix-store --,$$(basename "$@" .1))" 1 \
- doc/manual/generated/out/markdown/command-ref/nix-store/$*.md \
- $@
-
-
-doc/manual/generated/in/%.1: doc/manual/generated/out
- $(trace-gen) doc/manual/render-manpage.sh "$$(basename $@ .1)" 1 \
- doc/manual/generated/out/markdown/command-ref/$*.md \
- $@
-
-doc/manual/generated/in/%.8: doc/manual/generated/out
- $(trace-gen) doc/manual/render-manpage.sh "$$(basename $@ .8)" 8 \
- doc/manual/generated/out/markdown/command-ref/$*.md \
- $@
-
-doc/manual/generated/in/nix.conf.5: doc/manual/generated/out
- $(trace-gen) doc/manual/render-manpage.sh "$$(basename $@ .5)" 5 \
- doc/manual/generated/out/markdown/command-ref/conf-file.md \
- $@
-
-doc/manual/generated/in/nix-profiles.5: doc/manual/generated/out
- $(trace-gen) doc/manual/render-manpage.sh "$$(basename $@ .5)" 5 \
- doc/manual/generated/out/markdown/command-ref/files/profiles.md \
- $@
-
-doc/manual/generated/in/command-ref/new-cli: doc/manual/generated/in/nix.json $(d)/utils.nix $(d)/generate-manpage.nix $(doc_nix)
- @mkdir -p doc/manual/generated/in/command-ref
- @rm -rf $@ $@.tmp
- $(trace-gen) $(nix-eval) --write-to $@.tmp --expr 'import doc/manual/generate-manpage.nix true (builtins.readFile $<)'
- @mv $@.tmp $@
-
-doc/manual/generated/in/command-ref/conf-file.md: doc/manual/generated/in/conf-file.json $(d)/utils.nix doc/manual/generated/in/command-ref/experimental-features-shortlist.md $(doc_nix)
- @mkdir -p doc/manual/generated/in/command-ref
- $(trace-gen) $(nix-eval) --expr '(import doc/manual/utils.nix).showSettings { inlineHTML = true; } (builtins.fromJSON (builtins.readFile $<))' >> $@
-
-doc/manual/generated/in/nix.json: $(doc_nix)
- @mkdir -p doc/manual/generated/in
- $(trace-gen) $(dummy-env) $(doc_nix) __dump-cli > $@.tmp
- @mv $@.tmp $@
-
-doc/manual/generated/in/conf-file.json: $(doc_nix)
- @mkdir -p doc/manual/generated/in
- $(trace-gen) $(dummy-env) $(doc_nix) config show --json --experimental-features nix-command > $@.tmp
- @mv $@.tmp $@
-
-doc/manual/generated/in/contributing/experimental-feature-descriptions.md: doc/manual/generated/in/xp-features.json $(d)/utils.nix $(d)/generate-xp-features.nix $(doc_nix)
- @mkdir -p doc/manual/generated/in/contributing
- @rm -rf $@ $@.tmp
- $(trace-gen) $(nix-eval) --write-to $@.tmp --expr 'import doc/manual/generate-xp-features.nix (builtins.fromJSON (builtins.readFile $<))'
- @mv $@.tmp $@
-
-doc/manual/generated/in/command-ref/experimental-features-shortlist.md: doc/manual/generated/in/xp-features.json $(d)/utils.nix $(d)/generate-xp-features-shortlist.nix $(doc_nix)
- @mkdir -p doc/manual/generated/in/command-ref
- @rm -rf $@ $@.tmp
- $(trace-gen) $(nix-eval) --write-to $@.tmp --expr 'import doc/manual/generate-xp-features-shortlist.nix (builtins.fromJSON (builtins.readFile $<))'
- @mv $@.tmp $@
-
-doc/manual/generated/in/xp-features.json: $(doc_nix)
- $(trace-gen) $(dummy-env) NIX_PATH=nix/corepkgs=corepkgs $(doc_nix) __dump-xp-features > $@.tmp
- @mv $@.tmp $@
-
-doc/manual/generated/in/language/builtins.md: doc/manual/generated/in/language.json $(d)/generate-builtins.nix $(doc_nix)
- @mkdir -p doc/manual/generated/in/language
- $(trace-gen) $(nix-eval) --expr 'import doc/manual/generate-builtins.nix (builtins.fromJSON (builtins.readFile $<)).builtins' >> $@
-
-doc/manual/generated/in/language/builtin-constants.md: doc/manual/generated/in/language.json $(d)/generate-builtin-constants.nix $(doc_nix)
- @mkdir -p doc/manual/generated/in/language
- $(trace-gen) $(nix-eval) --expr 'import doc/manual/generate-builtin-constants.nix (builtins.fromJSON (builtins.readFile $<)).constants' >> $@
-
-doc/manual/generated/in/language.json: $(doc_nix)
- @mkdir -p doc/manual/generated/in
- $(trace-gen) $(dummy-env) NIX_PATH=nix/corepkgs=corepkgs $(doc_nix) __dump-language > $@.tmp
- @mv $@.tmp $@
-
-# Generate "Upcoming release" notes (or clear it and remove from menu)
-doc/manual/generated/in/release-notes/rl-next-generated.md: $(d)/rl-next $(d)/rl-next/*
- @mkdir -p doc/manual/generated/in/release-notes
- @if type -p build-release-notes > /dev/null; then \
- echo " GEN " $@; \
- build-release-notes doc/manual/rl-next > $@; \
- else \
- echo " NULL " $@; \
- true > $@; \
- fi
-
-# Generate the HTML manual.
-.PHONY: manual-html
-manual-html: $(docdir)/manual/index.html
-install: $(docdir)/manual/index.html
-
-# Generate 'nix' manpages.
-install: $(mandir)/man1/nix3-manpages
-man: doc/manual/generated/man1/nix3-manpages
-all: doc/manual/generated/man1/nix3-manpages
-
-# FIXME: unify with how the other man pages are generated.
-# this one works differently and does not use any of the amenities provided by `/mk/lib.mk`.
-$(mandir)/man1/nix3-manpages: doc/manual/generated/man1/nix3-manpages
- @mkdir -p $(DESTDIR)$$(dirname $@)
- $(trace-install) install -m 0644 $$(dirname $<)/* $(DESTDIR)$$(dirname $@)
-
-doc/manual/generated/man1/nix3-manpages: doc/manual/generated/out
- @mkdir -p $(DESTDIR)$$(dirname $@)
- $(trace-gen) for i in doc/manual/generated/out/markdown/command-ref/new-cli/*.md; do \
- name=$$(basename $$i .md); \
- tmpFile=$$(mktemp); \
- if [[ $$name = SUMMARY ]]; then continue; fi; \
- printf "Title: %s\n\n" "$$name" > $$tmpFile; \
- cat $$i >> $$tmpFile; \
- lowdown -sT man --nroff-nolinks -M section=1 $$tmpFile -o $(DESTDIR)$$(dirname $@)/$$name.1; \
- rm $$tmpFile; \
- done
- @touch $@
-
-doc/manual/generated/out: $(MANUAL_SRCS) $(d)/book.toml $(d)/anchors.jq $(d)/custom.css $(d)/src/SUMMARY.md doc/manual/generated/in/command-ref/new-cli doc/manual/generated/in/command-ref/experimental-features-shortlist.md doc/manual/generated/in/contributing/experimental-feature-descriptions.md doc/manual/generated/in/command-ref/conf-file.md doc/manual/generated/in/language/builtins.md doc/manual/generated/in/language/builtin-constants.md doc/manual/generated/in/release-notes/rl-next-generated.md $(d)/substitute.py
- @rm -rf $@
- $(trace-gen) \
- MDBOOK_SUBSTITUTE_SEARCH=doc/manual/generated/in \
- RUST_LOG=warn \
- mdbook build doc/manual -d generated/out 2>&1 \
- | { grep -Fv "because fragment resolution isn't implemented" || :; }
- @find $@ -iname meson.build -delete
-
-$(docdir)/manual/index.html: doc/manual/generated/out
- @mkdir -p $(DESTDIR)$(docdir)
- @rm -rf $(DESTDIR)$(docdir)/manual
- @cp -r $