mirror of
https://github.com/NixOS/nix
synced 2025-06-30 15:48:00 +02:00
Tagging release 2.26.2
-----BEGIN PGP SIGNATURE----- iQFHBAABCAAxFiEEtUHVUwEnDgvPFcpdgXC0cm1xmN4FAmetA5oTHGVkb2xzdHJh QGdtYWlsLmNvbQAKCRCBcLRybXGY3g2pB/9JAFyjmaXuccbMTO/6x9qwsWuuXNLk OQWzfbdUekvsihZZSFZg1r7KqqXHCi64f0nxLPsJ/0oeDWZktJ5KnbV630nuUlDj ulLCpKdvhWFa8dVx9LiziGwQw4KLx8PjOfwThtQ4DqCWxWEmu6lKkijag9cE+ai4 3mw9YtUjBRxlXyhYLzWz3whLbv37c/m+R8iGS8xm8W260pmei6D0beOIPdfXYBQF PzPlPORyI08A06uqyA3z7bTxzmSMnzvu0QInCPCKSHzFUnTZPHUYuYStFl28NrZS fXKK59L0G7QEfdTRAmqQkdHdtPj2RlYFiMN0kQiNLflvKfGGWdi/kvdx =rRix -----END PGP SIGNATURE----- Merge tag '2.26.2' into sync-2.26.2 Tagging release 2.26.2
This commit is contained in:
commit
4055239936
1395 changed files with 24694 additions and 16040 deletions
|
@ -31,3 +31,4 @@ AlwaysBreakBeforeMultilineStrings: true
|
||||||
IndentPPDirectives: AfterHash
|
IndentPPDirectives: AfterHash
|
||||||
PPIndentWidth: 2
|
PPIndentWidth: 2
|
||||||
BinPackArguments: false
|
BinPackArguments: false
|
||||||
|
BreakBeforeTernaryOperators: true
|
||||||
|
|
50
.github/ISSUE_TEMPLATE/bug_report.md
vendored
50
.github/ISSUE_TEMPLATE/bug_report.md
vendored
|
@ -1,36 +1,54 @@
|
||||||
---
|
---
|
||||||
name: Bug report
|
name: Bug report
|
||||||
about: Create a report to help us improve
|
about: Report unexpected or incorrect behaviour
|
||||||
title: ''
|
title: ''
|
||||||
labels: bug
|
labels: bug
|
||||||
assignees: ''
|
assignees: ''
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Describe the bug**
|
## Describe the bug
|
||||||
|
|
||||||
A clear and concise description of what the bug is.
|
<!--
|
||||||
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
If you have a problem with a specific package or NixOS,
|
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.
|
you probably want to file an issue at https://github.com/NixOS/nixpkgs/issues.
|
||||||
|
-->
|
||||||
|
|
||||||
**Steps To Reproduce**
|
## Steps To Reproduce
|
||||||
|
|
||||||
1. Go to '...'
|
<!--
|
||||||
2. Click on '....'
|
Example:
|
||||||
3. Scroll down to '....'
|
|
||||||
4. See error
|
|
||||||
|
|
||||||
**Expected behavior**
|
1. Clone this repository: ...
|
||||||
|
2. Run `nix-... ...`
|
||||||
|
3. Observe unexpected behaviour
|
||||||
|
-->
|
||||||
|
|
||||||
A clear and concise description of what you expected to happen.
|
## Expected behavior
|
||||||
|
|
||||||
**`nix-env --version` output**
|
<!-- A clear and concise description of what you expected to happen. -->
|
||||||
|
|
||||||
**Additional context**
|
## Metadata
|
||||||
|
|
||||||
Add any other context about the problem here.
|
<!-- Please insert the output of running `nix-env --version` below this line -->
|
||||||
|
|
||||||
**Priorities**
|
## Additional context
|
||||||
|
|
||||||
|
<!-- Add any other context about the problem here. -->
|
||||||
|
|
||||||
|
## Checklist
|
||||||
|
|
||||||
|
<!-- make sure this issue is not redundant or obsolete -->
|
||||||
|
|
||||||
|
- [ ] checked [latest Nix manual] \([source])
|
||||||
|
- [ ] checked [open bug 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/source
|
||||||
|
[open bug issues and pull requests]: https://github.com/NixOS/nix/labels/bug
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
Add :+1: to [issues you find important](https://github.com/NixOS/nix/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc).
|
Add :+1: to [issues you find important](https://github.com/NixOS/nix/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc).
|
||||||
|
|
35
.github/ISSUE_TEMPLATE/feature_request.md
vendored
35
.github/ISSUE_TEMPLATE/feature_request.md
vendored
|
@ -1,24 +1,39 @@
|
||||||
---
|
---
|
||||||
name: Feature request
|
name: Feature request
|
||||||
about: Suggest an idea for this project
|
about: Suggest a new feature
|
||||||
title: ''
|
title: ''
|
||||||
labels: feature
|
labels: feature
|
||||||
assignees: ''
|
assignees: ''
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Is your feature request related to a problem? Please describe.**
|
## Is your feature request related to a problem?
|
||||||
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 the problem is. Ex. I'm always frustrated when [...] -->
|
||||||
A clear and concise description of what you want to happen.
|
|
||||||
|
|
||||||
**Describe alternatives you've considered**
|
## Proposed solution
|
||||||
A clear and concise description of any alternative solutions or features you've considered.
|
|
||||||
|
|
||||||
**Additional context**
|
<!-- A clear and concise description of what you want to happen. -->
|
||||||
Add any other context or screenshots about the feature request here.
|
|
||||||
|
|
||||||
**Priorities**
|
## Alternative solutions
|
||||||
|
|
||||||
|
<!-- 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. -->
|
||||||
|
|
||||||
|
## Checklist
|
||||||
|
|
||||||
|
<!-- make sure this issue is not redundant or obsolete -->
|
||||||
|
|
||||||
|
- [ ] checked [latest Nix manual] \([source])
|
||||||
|
- [ ] checked [open feature 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/source
|
||||||
|
[open feature issues and pull requests]: https://github.com/NixOS/nix/labels/feature
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
Add :+1: to [issues you find important](https://github.com/NixOS/nix/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc).
|
Add :+1: to [issues you find important](https://github.com/NixOS/nix/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc).
|
||||||
|
|
17
.github/ISSUE_TEMPLATE/installer.md
vendored
17
.github/ISSUE_TEMPLATE/installer.md
vendored
|
@ -23,14 +23,25 @@ assignees: ''
|
||||||
|
|
||||||
<details><summary>Output</summary>
|
<details><summary>Output</summary>
|
||||||
|
|
||||||
```log
|
<!-- paste console output inside the below code block -->
|
||||||
|
|
||||||
<!-- paste console output here and remove this comment -->
|
```log
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
## Priorities
|
## Checklist
|
||||||
|
|
||||||
|
<!-- make sure this issue is not redundant or obsolete -->
|
||||||
|
|
||||||
|
- [ ] checked [latest Nix manual] \([source])
|
||||||
|
- [ ] checked [open installer 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/source
|
||||||
|
[open installer issues and pull requests]: https://github.com/NixOS/nix/labels/installer
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
Add :+1: to [issues you find important](https://github.com/NixOS/nix/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc).
|
Add :+1: to [issues you find important](https://github.com/NixOS/nix/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc).
|
||||||
|
|
|
@ -23,9 +23,9 @@ assignees: ''
|
||||||
- [ ] checked [open documentation issues and pull requests] for possible duplicates
|
- [ ] checked [open documentation issues and pull requests] for possible duplicates
|
||||||
|
|
||||||
[latest Nix manual]: https://nixos.org/manual/nix/unstable/
|
[latest Nix manual]: https://nixos.org/manual/nix/unstable/
|
||||||
[source]: https://github.com/NixOS/nix/tree/master/doc/manual/src
|
[source]: https://github.com/NixOS/nix/tree/master/doc/manual/source
|
||||||
[open documentation issues and pull requests]: https://github.com/NixOS/nix/labels/documentation
|
[open documentation issues and pull requests]: https://github.com/NixOS/nix/labels/documentation
|
||||||
|
|
||||||
## Priorities
|
---
|
||||||
|
|
||||||
Add :+1: to [issues you find important](https://github.com/NixOS/nix/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc).
|
Add :+1: to [issues you find important](https://github.com/NixOS/nix/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc).
|
||||||
|
|
27
.github/PULL_REQUEST_TEMPLATE.md
vendored
27
.github/PULL_REQUEST_TEMPLATE.md
vendored
|
@ -1,7 +1,28 @@
|
||||||
# Motivation
|
<!--
|
||||||
|
|
||||||
|
IMPORTANT
|
||||||
|
|
||||||
|
Nix is a non-trivial project, so for your contribution to be successful,
|
||||||
|
it really is important to follow the contributing guidelines:
|
||||||
|
|
||||||
|
https://github.com/NixOS/nix/blob/master/CONTRIBUTING.md
|
||||||
|
|
||||||
|
Even if you've contributed to open source before, take a moment to read it,
|
||||||
|
so you understand the process and the expectations.
|
||||||
|
|
||||||
|
- what information to include in commit messages
|
||||||
|
- proper attribution
|
||||||
|
- volunteering contributions effectively
|
||||||
|
- how to get help and our review process.
|
||||||
|
|
||||||
|
-->
|
||||||
|
|
||||||
|
## Motivation
|
||||||
|
|
||||||
<!-- Briefly explain what the change is about and why it is desirable. -->
|
<!-- Briefly explain what the change is about and why it is desirable. -->
|
||||||
|
|
||||||
# Context
|
## Context
|
||||||
|
|
||||||
<!-- Provide context. Reference open issues if available. -->
|
<!-- Provide context. Reference open issues if available. -->
|
||||||
|
|
||||||
<!-- Non-trivial change: Briefly outline the implementation strategy. -->
|
<!-- Non-trivial change: Briefly outline the implementation strategy. -->
|
||||||
|
@ -10,7 +31,7 @@
|
||||||
|
|
||||||
<!-- Large change: Provide instructions to reviewers how to read the diff. -->
|
<!-- Large change: Provide instructions to reviewers how to read the diff. -->
|
||||||
|
|
||||||
# Priorities and Process
|
---
|
||||||
|
|
||||||
Add :+1: to [pull requests you find important](https://github.com/NixOS/nix/pulls?q=is%3Aopen+sort%3Areactions-%2B1-desc).
|
Add :+1: to [pull requests you find important](https://github.com/NixOS/nix/pulls?q=is%3Aopen+sort%3Areactions-%2B1-desc).
|
||||||
|
|
||||||
|
|
4
.github/labeler.yml
vendored
4
.github/labeler.yml
vendored
|
@ -1,7 +1,7 @@
|
||||||
"c api":
|
"c api":
|
||||||
- changed-files:
|
- changed-files:
|
||||||
- any-glob-to-any-file: "src/lib*-c/**/*"
|
- any-glob-to-any-file: "src/lib*-c/**/*"
|
||||||
- any-glob-to-any-file: "test/unit/**/nix_api_*"
|
- any-glob-to-any-file: "src/*test*/**/nix_api_*"
|
||||||
- any-glob-to-any-file: "doc/external-api/**/*"
|
- any-glob-to-any-file: "doc/external-api/**/*"
|
||||||
|
|
||||||
"contributor-experience":
|
"contributor-experience":
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
- any-glob-to-any-file: "CONTRIBUTING.md"
|
- any-glob-to-any-file: "CONTRIBUTING.md"
|
||||||
- any-glob-to-any-file: ".github/ISSUE_TEMPLATE/*"
|
- any-glob-to-any-file: ".github/ISSUE_TEMPLATE/*"
|
||||||
- any-glob-to-any-file: ".github/PULL_REQUEST_TEMPLATE.md"
|
- any-glob-to-any-file: ".github/PULL_REQUEST_TEMPLATE.md"
|
||||||
- any-glob-to-any-file: "doc/manual/src/contributing/**"
|
- any-glob-to-any-file: "doc/manual/source/contributing/**"
|
||||||
|
|
||||||
"documentation":
|
"documentation":
|
||||||
- changed-files:
|
- changed-files:
|
||||||
|
|
24
.github/workflows/ci.yml
vendored
24
.github/workflows/ci.yml
vendored
|
@ -13,6 +13,16 @@ permissions:
|
||||||
contents: "read"
|
contents: "read"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
eval:
|
||||||
|
runs-on: UbuntuLatest32Cores128G
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- uses: DeterminateSystems/nix-installer-action@main
|
||||||
|
with:
|
||||||
|
flakehub: true
|
||||||
|
- run: nix flake show --all-systems --json
|
||||||
|
|
||||||
build_x86_64-linux:
|
build_x86_64-linux:
|
||||||
uses: ./.github/workflows/build.yml
|
uses: ./.github/workflows/build.yml
|
||||||
|
@ -49,17 +59,23 @@ jobs:
|
||||||
|
|
||||||
vm_tests:
|
vm_tests:
|
||||||
needs: build_x86_64-linux
|
needs: build_x86_64-linux
|
||||||
runs-on: ubuntu-22.04
|
runs-on: UbuntuLatest32Cores128G
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: DeterminateSystems/nix-installer-action@main
|
- uses: DeterminateSystems/nix-installer-action@main
|
||||||
with:
|
with:
|
||||||
flakehub: true
|
flakehub: true
|
||||||
- uses: DeterminateSystems/magic-nix-cache-action@main
|
- uses: DeterminateSystems/magic-nix-cache-action@main
|
||||||
- run: nix build -L .#hydraJobs.tests.githubFlakes .#hydraJobs.tests.tarballFlakes
|
- run: |
|
||||||
|
nix build -L \
|
||||||
|
.#hydraJobs.tests.functional_user \
|
||||||
|
.#hydraJobs.tests.githubFlakes \
|
||||||
|
.#hydraJobs.tests.nix-docker \
|
||||||
|
.#hydraJobs.tests.tarballFlakes \
|
||||||
|
;
|
||||||
|
|
||||||
flake_regressions:
|
flake_regressions:
|
||||||
needs: build_x86_64-linux
|
needs: vm_tests
|
||||||
runs-on: UbuntuLatest32Cores128G
|
runs-on: UbuntuLatest32Cores128G
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout nix
|
- name: Checkout nix
|
||||||
|
@ -78,4 +94,4 @@ jobs:
|
||||||
with:
|
with:
|
||||||
flakehub: true
|
flakehub: true
|
||||||
- uses: DeterminateSystems/magic-nix-cache-action@main
|
- uses: DeterminateSystems/magic-nix-cache-action@main
|
||||||
- run: nix build --out-link ./new-nix && PATH=$(pwd)/new-nix/bin:$PATH MAX_FLAKES=25 flake-regressions/eval-all.sh
|
- run: nix build -L --out-link ./new-nix && PATH=$(pwd)/new-nix/bin:$PATH MAX_FLAKES=25 flake-regressions/eval-all.sh
|
||||||
|
|
2
.github/workflows/labels.yml
vendored
2
.github/workflows/labels.yml
vendored
|
@ -15,7 +15,7 @@ permissions:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
labels:
|
labels:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-24.04
|
||||||
if: github.repository_owner == 'NixOS'
|
if: github.repository_owner == 'NixOS'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/labeler@v5
|
- uses: actions/labeler@v5
|
||||||
|
|
125
.gitignore
vendored
125
.gitignore
vendored
|
@ -1,113 +1,12 @@
|
||||||
Makefile.config
|
|
||||||
perl/Makefile.config
|
|
||||||
|
|
||||||
# /
|
|
||||||
/aclocal.m4
|
|
||||||
/autom4te.cache
|
|
||||||
/precompiled-headers.h.gch
|
|
||||||
/config.*
|
|
||||||
/configure
|
|
||||||
/stamp-h1
|
|
||||||
/svn-revision
|
|
||||||
/libtool
|
|
||||||
/config/config.*
|
|
||||||
# Default meson build dir
|
# Default meson build dir
|
||||||
/build
|
/build
|
||||||
|
|
||||||
# /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/SUMMARY.md
|
|
||||||
/doc/manual/src/SUMMARY-rl-next.md
|
|
||||||
/doc/manual/src/store/types/*
|
|
||||||
!/doc/manual/src/store/types/index.md.in
|
|
||||||
/doc/manual/src/command-ref/new-cli
|
|
||||||
/doc/manual/src/command-ref/conf-file.md
|
|
||||||
/doc/manual/src/command-ref/experimental-features-shortlist.md
|
|
||||||
/doc/manual/src/contributing/experimental-feature-descriptions.md
|
|
||||||
/doc/manual/src/language/builtins.md
|
|
||||||
/doc/manual/src/language/builtin-constants.md
|
|
||||||
/doc/manual/src/release-notes/rl-next.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/libfetchers
|
|
||||||
/tests/unit/libfetchers/libnixfetchers-tests
|
|
||||||
|
|
||||||
# /src/libflake
|
|
||||||
/tests/unit/libflake/libnixflake-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/generated-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/
|
||||||
/tests/functional/test-tmp
|
|
||||||
/tests/functional/common/subst-vars.sh
|
/tests/functional/common/subst-vars.sh
|
||||||
/tests/functional/result*
|
|
||||||
/tests/functional/restricted-innocent
|
/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/debugger-test-out
|
||||||
/tests/functional/test-libstoreconsumer/test-libstoreconsumer
|
/tests/functional/test-libstoreconsumer/test-libstoreconsumer
|
||||||
|
/tests/functional/nix-shell
|
||||||
|
|
||||||
# /tests/functional/lang/
|
# /tests/functional/lang/
|
||||||
/tests/functional/lang/*.out
|
/tests/functional/lang/*.out
|
||||||
|
@ -115,27 +14,9 @@ perl/Makefile.config
|
||||||
/tests/functional/lang/*.err
|
/tests/functional/lang/*.err
|
||||||
/tests/functional/lang/*.ast
|
/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
|
|
||||||
|
|
||||||
outputs/
|
outputs/
|
||||||
|
|
||||||
*.a
|
|
||||||
*.o
|
|
||||||
*.o.tmp
|
|
||||||
*.so
|
|
||||||
*.dylib
|
|
||||||
*.dll
|
|
||||||
*.exe
|
|
||||||
*.dep
|
|
||||||
*~
|
*~
|
||||||
*.pc
|
|
||||||
*.plist
|
|
||||||
|
|
||||||
# GNU Global
|
# GNU Global
|
||||||
GPATH
|
GPATH
|
||||||
|
@ -150,8 +31,6 @@ GTAGS
|
||||||
compile_commands.json
|
compile_commands.json
|
||||||
*.compile_commands.json
|
*.compile_commands.json
|
||||||
|
|
||||||
nix-rust/target
|
|
||||||
|
|
||||||
result
|
result
|
||||||
result-*
|
result-*
|
||||||
|
|
||||||
|
@ -166,3 +45,5 @@ result-*
|
||||||
|
|
||||||
# Mac OS
|
# Mac OS
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
flake-regressions
|
||||||
|
|
30
.mergify.yml
30
.mergify.yml
|
@ -2,19 +2,17 @@ queue_rules:
|
||||||
- name: default
|
- name: default
|
||||||
# all required tests need to go here
|
# all required tests need to go here
|
||||||
merge_conditions:
|
merge_conditions:
|
||||||
- check-success=installer
|
- check-success=tests on macos
|
||||||
- check-success=installer_test (macos-latest)
|
- check-success=tests on ubuntu
|
||||||
- check-success=installer_test (ubuntu-latest)
|
- check-success=installer test on macos
|
||||||
- check-success=tests (macos-latest)
|
- check-success=installer test on ubuntu
|
||||||
- check-success=tests (ubuntu-latest)
|
|
||||||
- check-success=vm_tests
|
- check-success=vm_tests
|
||||||
merge_method: rebase
|
|
||||||
batch_size: 5
|
batch_size: 5
|
||||||
|
|
||||||
pull_request_rules:
|
pull_request_rules:
|
||||||
- name: merge using the merge queue
|
- name: merge using the merge queue
|
||||||
conditions:
|
conditions:
|
||||||
- base=master
|
- base~=master|.+-maintenance
|
||||||
- label~=merge-queue|dependencies
|
- label~=merge-queue|dependencies
|
||||||
actions:
|
actions:
|
||||||
queue: {}
|
queue: {}
|
||||||
|
@ -29,6 +27,7 @@ pull_request_rules:
|
||||||
branches:
|
branches:
|
||||||
- 2.18-maintenance
|
- 2.18-maintenance
|
||||||
labels:
|
labels:
|
||||||
|
- automatic backport
|
||||||
- merge-queue
|
- merge-queue
|
||||||
|
|
||||||
- name: backport patches to 2.19
|
- name: backport patches to 2.19
|
||||||
|
@ -39,6 +38,7 @@ pull_request_rules:
|
||||||
branches:
|
branches:
|
||||||
- 2.19-maintenance
|
- 2.19-maintenance
|
||||||
labels:
|
labels:
|
||||||
|
- automatic backport
|
||||||
- merge-queue
|
- merge-queue
|
||||||
|
|
||||||
- name: backport patches to 2.20
|
- name: backport patches to 2.20
|
||||||
|
@ -49,6 +49,7 @@ pull_request_rules:
|
||||||
branches:
|
branches:
|
||||||
- 2.20-maintenance
|
- 2.20-maintenance
|
||||||
labels:
|
labels:
|
||||||
|
- automatic backport
|
||||||
- merge-queue
|
- merge-queue
|
||||||
|
|
||||||
- name: backport patches to 2.21
|
- name: backport patches to 2.21
|
||||||
|
@ -59,6 +60,7 @@ pull_request_rules:
|
||||||
branches:
|
branches:
|
||||||
- 2.21-maintenance
|
- 2.21-maintenance
|
||||||
labels:
|
labels:
|
||||||
|
- automatic backport
|
||||||
- merge-queue
|
- merge-queue
|
||||||
|
|
||||||
- name: backport patches to 2.22
|
- name: backport patches to 2.22
|
||||||
|
@ -69,6 +71,7 @@ pull_request_rules:
|
||||||
branches:
|
branches:
|
||||||
- 2.22-maintenance
|
- 2.22-maintenance
|
||||||
labels:
|
labels:
|
||||||
|
- automatic backport
|
||||||
- merge-queue
|
- merge-queue
|
||||||
|
|
||||||
- name: backport patches to 2.23
|
- name: backport patches to 2.23
|
||||||
|
@ -79,6 +82,7 @@ pull_request_rules:
|
||||||
branches:
|
branches:
|
||||||
- 2.23-maintenance
|
- 2.23-maintenance
|
||||||
labels:
|
labels:
|
||||||
|
- automatic backport
|
||||||
- merge-queue
|
- merge-queue
|
||||||
|
|
||||||
- name: backport patches to 2.24
|
- name: backport patches to 2.24
|
||||||
|
@ -89,4 +93,16 @@ pull_request_rules:
|
||||||
branches:
|
branches:
|
||||||
- "2.24-maintenance"
|
- "2.24-maintenance"
|
||||||
labels:
|
labels:
|
||||||
|
- automatic backport
|
||||||
|
- merge-queue
|
||||||
|
|
||||||
|
- name: backport patches to 2.25
|
||||||
|
conditions:
|
||||||
|
- label=backport 2.25-maintenance
|
||||||
|
actions:
|
||||||
|
backport:
|
||||||
|
branches:
|
||||||
|
- "2.25-maintenance"
|
||||||
|
labels:
|
||||||
|
- automatic backport
|
||||||
- merge-queue
|
- merge-queue
|
||||||
|
|
2
.version
2
.version
|
@ -1 +1 @@
|
||||||
2.24.10
|
2.26.2
|
||||||
|
|
|
@ -52,6 +52,20 @@ Check out the [security policy](https://github.com/NixOS/nix/security/policy).
|
||||||
|
|
||||||
Link related issues to inform interested parties and future contributors about your change.
|
Link related issues to inform interested parties and future contributors about your change.
|
||||||
If your pull request closes one or multiple issues, mention that in the description using `Closes: #<number>`, as it will then happen automatically when your change is merged.
|
If your pull request closes one or multiple issues, mention that in the description using `Closes: #<number>`, as it will then happen automatically when your change is merged.
|
||||||
|
* Credit original authors when you're reusing or building on their work.
|
||||||
|
* Link to relevant changes in other projects, so that others can understand the full context of the change in the future when you or someone else will change or troubleshoot the code.
|
||||||
|
This is especially important when your change is based on work done in other repositories.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
```
|
||||||
|
This is based on the work of @user in <url>.
|
||||||
|
This solution took inspiration from <url>.
|
||||||
|
|
||||||
|
Co-authored-by: User Name <user@example.com>
|
||||||
|
```
|
||||||
|
|
||||||
|
When cherry-picking from a different repository, use the `-x` flag, and then amend the commits to turn the hashes into URLs.
|
||||||
|
|
||||||
* Make sure to have [a clean history of commits on your branch by using rebase](https://www.digitalocean.com/community/tutorials/how-to-rebase-and-update-a-pull-request).
|
* Make sure to have [a clean history of commits on your branch by using rebase](https://www.digitalocean.com/community/tutorials/how-to-rebase-and-update-a-pull-request).
|
||||||
* [Mark the pull request as draft](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request) if you're not done with the changes.
|
* [Mark the pull request as draft](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request) if you're not done with the changes.
|
||||||
|
|
||||||
|
@ -65,7 +79,7 @@ Check out the [security policy](https://github.com/NixOS/nix/security/policy).
|
||||||
- Functional tests – [`tests/functional/**.sh`](./tests/functional)
|
- Functional tests – [`tests/functional/**.sh`](./tests/functional)
|
||||||
- Unit tests – [`src/*/tests`](./src/)
|
- Unit tests – [`src/*/tests`](./src/)
|
||||||
- Integration tests – [`tests/nixos/*`](./tests/nixos)
|
- Integration tests – [`tests/nixos/*`](./tests/nixos)
|
||||||
- [ ] User documentation in the [manual](./doc/manual/src)
|
- [ ] User documentation in the [manual](./doc/manual/source)
|
||||||
- [ ] API documentation in header files
|
- [ ] API documentation in header files
|
||||||
- [ ] Code and comments are self-explanatory
|
- [ ] Code and comments are self-explanatory
|
||||||
- [ ] Commit message explains **why** the change was made
|
- [ ] Commit message explains **why** the change was made
|
||||||
|
@ -76,11 +90,11 @@ Check out the [security policy](https://github.com/NixOS/nix/security/policy).
|
||||||
## Making changes to the Nix manual
|
## Making changes to the Nix manual
|
||||||
|
|
||||||
The Nix reference manual is hosted on https://nixos.org/manual/nix.
|
The Nix reference manual is hosted on https://nixos.org/manual/nix.
|
||||||
The underlying source files are located in [`doc/manual/src`](./doc/manual/src).
|
The underlying source files are located in [`doc/manual/source`](./doc/manual/source).
|
||||||
For small changes you can [use GitHub to edit these files](https://docs.github.com/en/repositories/working-with-files/managing-files/editing-files)
|
For small changes you can [use GitHub to edit these files](https://docs.github.com/en/repositories/working-with-files/managing-files/editing-files)
|
||||||
For larger changes see the [Nix reference manual](https://nix.dev/manual/nix/development/development/contributing.html).
|
For larger changes see the [Nix reference manual](https://nix.dev/manual/nix/development/development/contributing.html).
|
||||||
|
|
||||||
## Getting help
|
## Getting help
|
||||||
|
|
||||||
Whenever you're stuck or do not know how to proceed, you can always ask for help.
|
Whenever you're stuck or do not know how to proceed, you can always ask for help.
|
||||||
The appropriate channels to do so can be found on the [NixOS Community](https://nixos.org/community/) page.
|
We invite you to use our [Matrix room](https://matrix.to/#/#nix-dev:nixos.org) to ask questions.
|
||||||
|
|
1
HACKING.md
Symbolic link
1
HACKING.md
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
doc/manual/source/development/building.md
|
128
Makefile
128
Makefile
|
@ -1,128 +0,0 @@
|
||||||
# External build directory support
|
|
||||||
|
|
||||||
include mk/build-dir.mk
|
|
||||||
|
|
||||||
-include $(buildprefix)Makefile.config
|
|
||||||
clean-files += $(buildprefix)Makefile.config
|
|
||||||
|
|
||||||
# List makefiles
|
|
||||||
|
|
||||||
include mk/platform.mk
|
|
||||||
|
|
||||||
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/libflake/local.mk \
|
|
||||||
src/libcmd/local.mk \
|
|
||||||
src/nix/local.mk \
|
|
||||||
src/libutil-c/local.mk \
|
|
||||||
src/libstore-c/local.mk \
|
|
||||||
src/libexpr-c/local.mk
|
|
||||||
|
|
||||||
ifdef HOST_UNIX
|
|
||||||
makefiles += \
|
|
||||||
scripts/local.mk \
|
|
||||||
maintainers/local.mk \
|
|
||||||
misc/bash/local.mk \
|
|
||||||
misc/fish/local.mk \
|
|
||||||
misc/zsh/local.mk \
|
|
||||||
misc/systemd/local.mk \
|
|
||||||
misc/launchd/local.mk \
|
|
||||||
misc/upstart/local.mk
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(ENABLE_UNIT_TESTS), yes)
|
|
||||||
makefiles += \
|
|
||||||
tests/unit/libutil/local.mk \
|
|
||||||
tests/unit/libutil-support/local.mk \
|
|
||||||
tests/unit/libstore/local.mk \
|
|
||||||
tests/unit/libstore-support/local.mk \
|
|
||||||
tests/unit/libfetchers/local.mk \
|
|
||||||
tests/unit/libexpr/local.mk \
|
|
||||||
tests/unit/libexpr-support/local.mk \
|
|
||||||
tests/unit/libflake/local.mk
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(ENABLE_FUNCTIONAL_TESTS), yes)
|
|
||||||
ifdef HOST_UNIX
|
|
||||||
makefiles += \
|
|
||||||
tests/functional/local.mk \
|
|
||||||
tests/functional/flakes/local.mk \
|
|
||||||
tests/functional/ca/local.mk \
|
|
||||||
tests/functional/git-hashing/local.mk \
|
|
||||||
tests/functional/dyn-drv/local.mk \
|
|
||||||
tests/functional/local-overlay-store/local.mk \
|
|
||||||
tests/functional/test-libstoreconsumer/local.mk \
|
|
||||||
tests/functional/plugins/local.mk
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Some makefiles require access to built programs and must be included late.
|
|
||||||
makefiles-late =
|
|
||||||
|
|
||||||
ifeq ($(ENABLE_DOC_GEN), yes)
|
|
||||||
makefiles-late += doc/manual/local.mk
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Miscellaneous global Flags
|
|
||||||
|
|
||||||
OPTIMIZE = 1
|
|
||||||
|
|
||||||
ifeq ($(OPTIMIZE), 1)
|
|
||||||
GLOBAL_CXXFLAGS += -O3 $(CXXLTO)
|
|
||||||
GLOBAL_LDFLAGS += $(CXXLTO)
|
|
||||||
else
|
|
||||||
GLOBAL_CXXFLAGS += -O0 -U_FORTIFY_SOURCE
|
|
||||||
unexport NIX_HARDENING_ENABLE
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef HOST_WINDOWS
|
|
||||||
# Windows DLLs are stricter about symbol visibility than Unix shared
|
|
||||||
# objects --- see https://gcc.gnu.org/wiki/Visibility for details.
|
|
||||||
# This is a temporary sledgehammer to export everything like on Unix,
|
|
||||||
# and not detail with this yet.
|
|
||||||
#
|
|
||||||
# TODO do not do this, and instead do fine-grained export annotations.
|
|
||||||
GLOBAL_LDFLAGS += -Wl,--export-all-symbols
|
|
||||||
endif
|
|
||||||
|
|
||||||
GLOBAL_CXXFLAGS += -g -Wall -Wdeprecated-copy -Wignored-qualifiers -Wimplicit-fallthrough -Werror=unused-result -Werror=suggest-override -include $(buildprefix)config.h -std=c++2a -I src
|
|
||||||
|
|
||||||
# Include the main lib, causing rules to be defined
|
|
||||||
|
|
||||||
include mk/lib.mk
|
|
||||||
|
|
||||||
# Fallback stub rules for better UX when things are disabled
|
|
||||||
#
|
|
||||||
# These must be defined after `mk/lib.mk`. Otherwise the first rule
|
|
||||||
# incorrectly becomes the default target.
|
|
||||||
|
|
||||||
ifneq ($(ENABLE_UNIT_TESTS), yes)
|
|
||||||
.PHONY: check
|
|
||||||
check:
|
|
||||||
@echo "Unit tests are disabled. Configure without '--disable-unit-tests', or avoid calling 'make check'."
|
|
||||||
@exit 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(ENABLE_FUNCTIONAL_TESTS), yes)
|
|
||||||
.PHONY: installcheck
|
|
||||||
installcheck:
|
|
||||||
@echo "Functional tests are disabled. Configure without '--disable-functional-tests', or avoid calling 'make installcheck'."
|
|
||||||
@exit 1
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Documentation fallback stub rules.
|
|
||||||
|
|
||||||
ifneq ($(ENABLE_DOC_GEN), yes)
|
|
||||||
.PHONY: manual-html manpages
|
|
||||||
manual-html manpages:
|
|
||||||
@echo "Generated docs are disabled. Configure without '--disable-doc-gen', or avoid calling 'make manpages' and 'make manual-html'."
|
|
||||||
@exit 1
|
|
||||||
endif
|
|
|
@ -1,54 +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_BUILD = @ENABLE_BUILD@
|
|
||||||
ENABLE_DOC_GEN = @ENABLE_DOC_GEN@
|
|
||||||
ENABLE_FUNCTIONAL_TESTS = @ENABLE_FUNCTIONAL_TESTS@
|
|
||||||
ENABLE_S3 = @ENABLE_S3@
|
|
||||||
ENABLE_UNIT_TESTS = @ENABLE_UNIT_TESTS@
|
|
||||||
GTEST_LIBS = @GTEST_LIBS@
|
|
||||||
HAVE_LIBCPUID = @HAVE_LIBCPUID@
|
|
||||||
HAVE_SECCOMP = @HAVE_SECCOMP@
|
|
||||||
HOST_OS = @host_os@
|
|
||||||
INSTALL_UNIT_TESTS = @INSTALL_UNIT_TESTS@
|
|
||||||
LDFLAGS = @LDFLAGS@
|
|
||||||
LIBARCHIVE_LIBS = @LIBARCHIVE_LIBS@
|
|
||||||
LIBBROTLI_LIBS = @LIBBROTLI_LIBS@
|
|
||||||
LIBCURL_LIBS = @LIBCURL_LIBS@
|
|
||||||
LIBGIT2_LIBS = @LIBGIT2_LIBS@
|
|
||||||
LIBSECCOMP_LIBS = @LIBSECCOMP_LIBS@
|
|
||||||
LOWDOWN_LIBS = @LOWDOWN_LIBS@
|
|
||||||
OPENSSL_LIBS = @OPENSSL_LIBS@
|
|
||||||
PACKAGE_NAME = @PACKAGE_NAME@
|
|
||||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
|
||||||
SHELL = @bash@
|
|
||||||
SODIUM_LIBS = @SODIUM_LIBS@
|
|
||||||
SQLITE3_LIBS = @SQLITE3_LIBS@
|
|
||||||
bash = @bash@
|
|
||||||
bindir = @bindir@
|
|
||||||
checkbindir = @checkbindir@
|
|
||||||
checklibdir = @checklibdir@
|
|
||||||
datadir = @datadir@
|
|
||||||
datarootdir = @datarootdir@
|
|
||||||
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@
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Nix
|
# Nix
|
||||||
|
|
||||||
[](https://opencollective.com/nixos)
|
[](https://opencollective.com/nixos)
|
||||||
[](https://github.com/NixOS/nix/actions)
|
[](https://github.com/NixOS/nix/actions/workflows/ci.yml)
|
||||||
|
|
||||||
Nix is a powerful package manager for Linux and other Unix systems that makes package
|
Nix is a powerful package manager for Linux and other Unix systems that makes package
|
||||||
management reliable and reproducible. Please refer to the [Nix manual](https://nix.dev/reference/nix-manual)
|
management reliable and reproducible. Please refer to the [Nix manual](https://nix.dev/reference/nix-manual)
|
||||||
|
@ -15,7 +15,7 @@ Full reference documentation can be found in the [Nix manual](https://nix.dev/re
|
||||||
|
|
||||||
## Building and developing
|
## Building and developing
|
||||||
|
|
||||||
Follow instructions in the Nix reference manual to [set up a development environment and build Nix from source](https://nix.dev/manual/nix/development/building.html).
|
Follow instructions in the Nix reference manual to [set up a development environment and build Nix from source](https://nix.dev/manual/nix/development/development/building.html).
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
# This is only conditional to work around
|
|
||||||
# https://github.com/mesonbuild/meson/issues/13293. It should be
|
|
||||||
# unconditional.
|
|
||||||
if not (host_machine.system() == 'windows' and cxx.get_id() == 'gcc')
|
|
||||||
deps_private += dependency('threads')
|
|
||||||
endif
|
|
|
@ -1,527 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
# install - install a program, script, or datafile
|
|
||||||
|
|
||||||
scriptversion=2011-11-20.07; # UTC
|
|
||||||
|
|
||||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
|
||||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
|
||||||
# following copyright and license.
|
|
||||||
#
|
|
||||||
# Copyright (C) 1994 X Consortium
|
|
||||||
#
|
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
# of this software and associated documentation files (the "Software"), to
|
|
||||||
# deal in the Software without restriction, including without limitation the
|
|
||||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
||||||
# sell copies of the Software, and to permit persons to whom the Software is
|
|
||||||
# furnished to do so, subject to the following conditions:
|
|
||||||
#
|
|
||||||
# The above copyright notice and this permission notice shall be included in
|
|
||||||
# all copies or substantial portions of the Software.
|
|
||||||
#
|
|
||||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
|
||||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
|
||||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
#
|
|
||||||
# Except as contained in this notice, the name of the X Consortium shall not
|
|
||||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
|
||||||
# ings in this Software without prior written authorization from the X Consor-
|
|
||||||
# tium.
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# FSF changes to this file are in the public domain.
|
|
||||||
#
|
|
||||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
|
||||||
# 'make' implicit rules from creating a file called install from it
|
|
||||||
# when there is no Makefile.
|
|
||||||
#
|
|
||||||
# This script is compatible with the BSD install script, but was written
|
|
||||||
# from scratch.
|
|
||||||
|
|
||||||
nl='
|
|
||||||
'
|
|
||||||
IFS=" "" $nl"
|
|
||||||
|
|
||||||
# set DOITPROG to echo to test this script
|
|
||||||
|
|
||||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
|
||||||
doit=${DOITPROG-}
|
|
||||||
if test -z "$doit"; then
|
|
||||||
doit_exec=exec
|
|
||||||
else
|
|
||||||
doit_exec=$doit
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Put in absolute file names if you don't have them in your path;
|
|
||||||
# or use environment vars.
|
|
||||||
|
|
||||||
chgrpprog=${CHGRPPROG-chgrp}
|
|
||||||
chmodprog=${CHMODPROG-chmod}
|
|
||||||
chownprog=${CHOWNPROG-chown}
|
|
||||||
cmpprog=${CMPPROG-cmp}
|
|
||||||
cpprog=${CPPROG-cp}
|
|
||||||
mkdirprog=${MKDIRPROG-mkdir}
|
|
||||||
mvprog=${MVPROG-mv}
|
|
||||||
rmprog=${RMPROG-rm}
|
|
||||||
stripprog=${STRIPPROG-strip}
|
|
||||||
|
|
||||||
posix_glob='?'
|
|
||||||
initialize_posix_glob='
|
|
||||||
test "$posix_glob" != "?" || {
|
|
||||||
if (set -f) 2>/dev/null; then
|
|
||||||
posix_glob=
|
|
||||||
else
|
|
||||||
posix_glob=:
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
'
|
|
||||||
|
|
||||||
posix_mkdir=
|
|
||||||
|
|
||||||
# Desired mode of installed file.
|
|
||||||
mode=0755
|
|
||||||
|
|
||||||
chgrpcmd=
|
|
||||||
chmodcmd=$chmodprog
|
|
||||||
chowncmd=
|
|
||||||
mvcmd=$mvprog
|
|
||||||
rmcmd="$rmprog -f"
|
|
||||||
stripcmd=
|
|
||||||
|
|
||||||
src=
|
|
||||||
dst=
|
|
||||||
dir_arg=
|
|
||||||
dst_arg=
|
|
||||||
|
|
||||||
copy_on_change=false
|
|
||||||
no_target_directory=
|
|
||||||
|
|
||||||
usage="\
|
|
||||||
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
|
||||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
|
||||||
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
|
||||||
or: $0 [OPTION]... -d DIRECTORIES...
|
|
||||||
|
|
||||||
In the 1st form, copy SRCFILE to DSTFILE.
|
|
||||||
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
|
||||||
In the 4th, create DIRECTORIES.
|
|
||||||
|
|
||||||
Options:
|
|
||||||
--help display this help and exit.
|
|
||||||
--version display version info and exit.
|
|
||||||
|
|
||||||
-c (ignored)
|
|
||||||
-C install only if different (preserve the last data modification time)
|
|
||||||
-d create directories instead of installing files.
|
|
||||||
-g GROUP $chgrpprog installed files to GROUP.
|
|
||||||
-m MODE $chmodprog installed files to MODE.
|
|
||||||
-o USER $chownprog installed files to USER.
|
|
||||||
-s $stripprog installed files.
|
|
||||||
-t DIRECTORY install into DIRECTORY.
|
|
||||||
-T report an error if DSTFILE is a directory.
|
|
||||||
|
|
||||||
Environment variables override the default commands:
|
|
||||||
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
|
|
||||||
RMPROG STRIPPROG
|
|
||||||
"
|
|
||||||
|
|
||||||
while test $# -ne 0; do
|
|
||||||
case $1 in
|
|
||||||
-c) ;;
|
|
||||||
|
|
||||||
-C) copy_on_change=true;;
|
|
||||||
|
|
||||||
-d) dir_arg=true;;
|
|
||||||
|
|
||||||
-g) chgrpcmd="$chgrpprog $2"
|
|
||||||
shift;;
|
|
||||||
|
|
||||||
--help) echo "$usage"; exit $?;;
|
|
||||||
|
|
||||||
-m) mode=$2
|
|
||||||
case $mode in
|
|
||||||
*' '* | *' '* | *'
|
|
||||||
'* | *'*'* | *'?'* | *'['*)
|
|
||||||
echo "$0: invalid mode: $mode" >&2
|
|
||||||
exit 1;;
|
|
||||||
esac
|
|
||||||
shift;;
|
|
||||||
|
|
||||||
-o) chowncmd="$chownprog $2"
|
|
||||||
shift;;
|
|
||||||
|
|
||||||
-s) stripcmd=$stripprog;;
|
|
||||||
|
|
||||||
-t) dst_arg=$2
|
|
||||||
# Protect names problematic for 'test' and other utilities.
|
|
||||||
case $dst_arg in
|
|
||||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
|
||||||
esac
|
|
||||||
shift;;
|
|
||||||
|
|
||||||
-T) no_target_directory=true;;
|
|
||||||
|
|
||||||
--version) echo "$0 $scriptversion"; exit $?;;
|
|
||||||
|
|
||||||
--) shift
|
|
||||||
break;;
|
|
||||||
|
|
||||||
-*) echo "$0: invalid option: $1" >&2
|
|
||||||
exit 1;;
|
|
||||||
|
|
||||||
*) break;;
|
|
||||||
esac
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
|
|
||||||
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
|
||||||
# When -d is used, all remaining arguments are directories to create.
|
|
||||||
# When -t is used, the destination is already specified.
|
|
||||||
# Otherwise, the last argument is the destination. Remove it from $@.
|
|
||||||
for arg
|
|
||||||
do
|
|
||||||
if test -n "$dst_arg"; then
|
|
||||||
# $@ is not empty: it contains at least $arg.
|
|
||||||
set fnord "$@" "$dst_arg"
|
|
||||||
shift # fnord
|
|
||||||
fi
|
|
||||||
shift # arg
|
|
||||||
dst_arg=$arg
|
|
||||||
# Protect names problematic for 'test' and other utilities.
|
|
||||||
case $dst_arg in
|
|
||||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test $# -eq 0; then
|
|
||||||
if test -z "$dir_arg"; then
|
|
||||||
echo "$0: no input file specified." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
# It's OK to call 'install-sh -d' without argument.
|
|
||||||
# This can happen when creating conditional directories.
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -z "$dir_arg"; then
|
|
||||||
do_exit='(exit $ret); exit $ret'
|
|
||||||
trap "ret=129; $do_exit" 1
|
|
||||||
trap "ret=130; $do_exit" 2
|
|
||||||
trap "ret=141; $do_exit" 13
|
|
||||||
trap "ret=143; $do_exit" 15
|
|
||||||
|
|
||||||
# Set umask so as not to create temps with too-generous modes.
|
|
||||||
# However, 'strip' requires both read and write access to temps.
|
|
||||||
case $mode in
|
|
||||||
# Optimize common cases.
|
|
||||||
*644) cp_umask=133;;
|
|
||||||
*755) cp_umask=22;;
|
|
||||||
|
|
||||||
*[0-7])
|
|
||||||
if test -z "$stripcmd"; then
|
|
||||||
u_plus_rw=
|
|
||||||
else
|
|
||||||
u_plus_rw='% 200'
|
|
||||||
fi
|
|
||||||
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
|
||||||
*)
|
|
||||||
if test -z "$stripcmd"; then
|
|
||||||
u_plus_rw=
|
|
||||||
else
|
|
||||||
u_plus_rw=,u+rw
|
|
||||||
fi
|
|
||||||
cp_umask=$mode$u_plus_rw;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
for src
|
|
||||||
do
|
|
||||||
# Protect names problematic for 'test' and other utilities.
|
|
||||||
case $src in
|
|
||||||
-* | [=\(\)!]) src=./$src;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if test -n "$dir_arg"; then
|
|
||||||
dst=$src
|
|
||||||
dstdir=$dst
|
|
||||||
test -d "$dstdir"
|
|
||||||
dstdir_status=$?
|
|
||||||
else
|
|
||||||
|
|
||||||
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
|
||||||
# might cause directories to be created, which would be especially bad
|
|
||||||
# if $src (and thus $dsttmp) contains '*'.
|
|
||||||
if test ! -f "$src" && test ! -d "$src"; then
|
|
||||||
echo "$0: $src does not exist." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -z "$dst_arg"; then
|
|
||||||
echo "$0: no destination specified." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
dst=$dst_arg
|
|
||||||
|
|
||||||
# If destination is a directory, append the input filename; won't work
|
|
||||||
# if double slashes aren't ignored.
|
|
||||||
if test -d "$dst"; then
|
|
||||||
if test -n "$no_target_directory"; then
|
|
||||||
echo "$0: $dst_arg: Is a directory" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
dstdir=$dst
|
|
||||||
dst=$dstdir/`basename "$src"`
|
|
||||||
dstdir_status=0
|
|
||||||
else
|
|
||||||
# Prefer dirname, but fall back on a substitute if dirname fails.
|
|
||||||
dstdir=`
|
|
||||||
(dirname "$dst") 2>/dev/null ||
|
|
||||||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
|
||||||
X"$dst" : 'X\(//\)[^/]' \| \
|
|
||||||
X"$dst" : 'X\(//\)$' \| \
|
|
||||||
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
|
|
||||||
echo X"$dst" |
|
|
||||||
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
|
|
||||||
s//\1/
|
|
||||||
q
|
|
||||||
}
|
|
||||||
/^X\(\/\/\)[^/].*/{
|
|
||||||
s//\1/
|
|
||||||
q
|
|
||||||
}
|
|
||||||
/^X\(\/\/\)$/{
|
|
||||||
s//\1/
|
|
||||||
q
|
|
||||||
}
|
|
||||||
/^X\(\/\).*/{
|
|
||||||
s//\1/
|
|
||||||
q
|
|
||||||
}
|
|
||||||
s/.*/./; q'
|
|
||||||
`
|
|
||||||
|
|
||||||
test -d "$dstdir"
|
|
||||||
dstdir_status=$?
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
obsolete_mkdir_used=false
|
|
||||||
|
|
||||||
if test $dstdir_status != 0; then
|
|
||||||
case $posix_mkdir in
|
|
||||||
'')
|
|
||||||
# Create intermediate dirs using mode 755 as modified by the umask.
|
|
||||||
# This is like FreeBSD 'install' as of 1997-10-28.
|
|
||||||
umask=`umask`
|
|
||||||
case $stripcmd.$umask in
|
|
||||||
# Optimize common cases.
|
|
||||||
*[2367][2367]) mkdir_umask=$umask;;
|
|
||||||
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
|
|
||||||
|
|
||||||
*[0-7])
|
|
||||||
mkdir_umask=`expr $umask + 22 \
|
|
||||||
- $umask % 100 % 40 + $umask % 20 \
|
|
||||||
- $umask % 10 % 4 + $umask % 2
|
|
||||||
`;;
|
|
||||||
*) mkdir_umask=$umask,go-w;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# With -d, create the new directory with the user-specified mode.
|
|
||||||
# Otherwise, rely on $mkdir_umask.
|
|
||||||
if test -n "$dir_arg"; then
|
|
||||||
mkdir_mode=-m$mode
|
|
||||||
else
|
|
||||||
mkdir_mode=
|
|
||||||
fi
|
|
||||||
|
|
||||||
posix_mkdir=false
|
|
||||||
case $umask in
|
|
||||||
*[123567][0-7][0-7])
|
|
||||||
# POSIX mkdir -p sets u+wx bits regardless of umask, which
|
|
||||||
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
|
||||||
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
|
|
||||||
|
|
||||||
if (umask $mkdir_umask &&
|
|
||||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
|
|
||||||
then
|
|
||||||
if test -z "$dir_arg" || {
|
|
||||||
# Check for POSIX incompatibilities with -m.
|
|
||||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
|
||||||
# other-writable bit of parent directory when it shouldn't.
|
|
||||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
|
||||||
ls_ld_tmpdir=`ls -ld "$tmpdir"`
|
|
||||||
case $ls_ld_tmpdir in
|
|
||||||
d????-?r-*) different_mode=700;;
|
|
||||||
d????-?--*) different_mode=755;;
|
|
||||||
*) false;;
|
|
||||||
esac &&
|
|
||||||
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
|
|
||||||
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
|
|
||||||
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
then posix_mkdir=:
|
|
||||||
fi
|
|
||||||
rmdir "$tmpdir/d" "$tmpdir"
|
|
||||||
else
|
|
||||||
# Remove any dirs left behind by ancient mkdir implementations.
|
|
||||||
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
|
|
||||||
fi
|
|
||||||
trap '' 0;;
|
|
||||||
esac;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if
|
|
||||||
$posix_mkdir && (
|
|
||||||
umask $mkdir_umask &&
|
|
||||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
|
||||||
)
|
|
||||||
then :
|
|
||||||
else
|
|
||||||
|
|
||||||
# The umask is ridiculous, or mkdir does not conform to POSIX,
|
|
||||||
# or it failed possibly due to a race condition. Create the
|
|
||||||
# directory the slow way, step by step, checking for races as we go.
|
|
||||||
|
|
||||||
case $dstdir in
|
|
||||||
/*) prefix='/';;
|
|
||||||
[-=\(\)!]*) prefix='./';;
|
|
||||||
*) prefix='';;
|
|
||||||
esac
|
|
||||||
|
|
||||||
eval "$initialize_posix_glob"
|
|
||||||
|
|
||||||
oIFS=$IFS
|
|
||||||
IFS=/
|
|
||||||
$posix_glob set -f
|
|
||||||
set fnord $dstdir
|
|
||||||
shift
|
|
||||||
$posix_glob set +f
|
|
||||||
IFS=$oIFS
|
|
||||||
|
|
||||||
prefixes=
|
|
||||||
|
|
||||||
for d
|
|
||||||
do
|
|
||||||
test X"$d" = X && continue
|
|
||||||
|
|
||||||
prefix=$prefix$d
|
|
||||||
if test -d "$prefix"; then
|
|
||||||
prefixes=
|
|
||||||
else
|
|
||||||
if $posix_mkdir; then
|
|
||||||
(umask=$mkdir_umask &&
|
|
||||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
|
||||||
# Don't fail if two instances are running concurrently.
|
|
||||||
test -d "$prefix" || exit 1
|
|
||||||
else
|
|
||||||
case $prefix in
|
|
||||||
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
|
||||||
*) qprefix=$prefix;;
|
|
||||||
esac
|
|
||||||
prefixes="$prefixes '$qprefix'"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
prefix=$prefix/
|
|
||||||
done
|
|
||||||
|
|
||||||
if test -n "$prefixes"; then
|
|
||||||
# Don't fail if two instances are running concurrently.
|
|
||||||
(umask $mkdir_umask &&
|
|
||||||
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
|
||||||
test -d "$dstdir" || exit 1
|
|
||||||
obsolete_mkdir_used=true
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -n "$dir_arg"; then
|
|
||||||
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
|
|
||||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
|
|
||||||
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
|
|
||||||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
|
|
||||||
else
|
|
||||||
|
|
||||||
# Make a couple of temp file names in the proper directory.
|
|
||||||
dsttmp=$dstdir/_inst.$$_
|
|
||||||
rmtmp=$dstdir/_rm.$$_
|
|
||||||
|
|
||||||
# Trap to clean up those temp files at exit.
|
|
||||||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
|
||||||
|
|
||||||
# Copy the file name to the temp name.
|
|
||||||
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
|
|
||||||
|
|
||||||
# and set any options; do chmod last to preserve setuid bits.
|
|
||||||
#
|
|
||||||
# If any of these fail, we abort the whole thing. If we want to
|
|
||||||
# ignore errors from any of these, just make sure not to ignore
|
|
||||||
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
|
||||||
#
|
|
||||||
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
|
|
||||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
|
|
||||||
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
|
|
||||||
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
|
|
||||||
|
|
||||||
# If -C, don't bother to copy if it wouldn't change the file.
|
|
||||||
if $copy_on_change &&
|
|
||||||
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
|
||||||
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
|
||||||
|
|
||||||
eval "$initialize_posix_glob" &&
|
|
||||||
$posix_glob set -f &&
|
|
||||||
set X $old && old=:$2:$4:$5:$6 &&
|
|
||||||
set X $new && new=:$2:$4:$5:$6 &&
|
|
||||||
$posix_glob set +f &&
|
|
||||||
|
|
||||||
test "$old" = "$new" &&
|
|
||||||
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
|
|
||||||
then
|
|
||||||
rm -f "$dsttmp"
|
|
||||||
else
|
|
||||||
# Rename the file to the real destination.
|
|
||||||
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
|
|
||||||
|
|
||||||
# The rename failed, perhaps because mv can't rename something else
|
|
||||||
# to itself, or perhaps because mv is so ancient that it does not
|
|
||||||
# support -f.
|
|
||||||
{
|
|
||||||
# Now remove or move aside any old file at destination location.
|
|
||||||
# We try this two ways since rm can't unlink itself on some
|
|
||||||
# systems and the destination file might be busy for other
|
|
||||||
# reasons. In this case, the final cleanup might fail but the new
|
|
||||||
# file should still install successfully.
|
|
||||||
{
|
|
||||||
test ! -f "$dst" ||
|
|
||||||
$doit $rmcmd -f "$dst" 2>/dev/null ||
|
|
||||||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
|
|
||||||
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
|
|
||||||
} ||
|
|
||||||
{ echo "$0: cannot unlink or rename $dst" >&2
|
|
||||||
(exit 1); exit 1
|
|
||||||
}
|
|
||||||
} &&
|
|
||||||
|
|
||||||
# Now rename the file to the real destination.
|
|
||||||
$doit $mvcmd "$dsttmp" "$dst"
|
|
||||||
}
|
|
||||||
fi || exit 1
|
|
||||||
|
|
||||||
trap '' 0
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Local variables:
|
|
||||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
|
||||||
# time-stamp-start: "scriptversion="
|
|
||||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
|
||||||
# time-stamp-time-zone: "UTC"
|
|
||||||
# time-stamp-end: "; # UTC"
|
|
||||||
# End:
|
|
452
configure.ac
452
configure.ac
|
@ -1,452 +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:
|
|
||||||
# <cpu>-<vendor>-<os>[<version>][-<abi>]
|
|
||||||
# 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
|
|
||||||
|
|
||||||
|
|
||||||
# OS-specific stuff.
|
|
||||||
case "$host_os" in
|
|
||||||
solaris*)
|
|
||||||
# Solaris requires -lsocket -lnsl for network functions
|
|
||||||
LDFLAGS="-lsocket -lnsl $LDFLAGS"
|
|
||||||
;;
|
|
||||||
darwin*)
|
|
||||||
# Need to link to libsandbox.
|
|
||||||
LDFLAGS="-lsandbox $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 <iostream>
|
|
||||||
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 and utimensat, optionally used for changing the
|
|
||||||
# mtime of symlinks.
|
|
||||||
AC_CHECK_DECLS([AT_SYMLINK_NOFOLLOW], [], [], [[#include <fcntl.h>]])
|
|
||||||
AC_CHECK_FUNCS([lutimes utimensat])
|
|
||||||
|
|
||||||
|
|
||||||
# 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 <locale>.
|
|
||||||
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)
|
|
||||||
|
|
||||||
|
|
||||||
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)
|
|
||||||
|
|
||||||
|
|
||||||
# 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 unit 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(unit-tests, AS_HELP_STRING([--disable-unit-tests],[Do not build the tests]),
|
|
||||||
ENABLE_UNIT_TESTS=$enableval, ENABLE_UNIT_TESTS=$ENABLE_BUILD)
|
|
||||||
AC_SUBST(ENABLE_UNIT_TESTS)
|
|
||||||
|
|
||||||
AS_IF(
|
|
||||||
[test "$ENABLE_BUILD" == "no" && test "$ENABLE_UNIT_TESTS" == "yes"],
|
|
||||||
[AC_MSG_ERROR([Cannot enable unit tests when building overall is disabled. Please do not pass '--enable-unit-tests' or do not pass '--disable-build'.])])
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(functional-tests, AS_HELP_STRING([--disable-functional-tests],[Do not build the tests]),
|
|
||||||
ENABLE_FUNCTIONAL_TESTS=$enableval, ENABLE_FUNCTIONAL_TESTS=yes)
|
|
||||||
AC_SUBST(ENABLE_FUNCTIONAL_TESTS)
|
|
||||||
|
|
||||||
# documentation generation switch
|
|
||||||
AC_ARG_ENABLE(doc-gen, AS_HELP_STRING([--disable-doc-gen],[disable documentation generation]),
|
|
||||||
ENABLE_DOC_GEN=$enableval, ENABLE_DOC_GEN=$ENABLE_BUILD)
|
|
||||||
AC_SUBST(ENABLE_DOC_GEN)
|
|
||||||
|
|
||||||
AS_IF(
|
|
||||||
[test "$ENABLE_BUILD" == "no" && test "$ENABLE_DOC_GEN" == "yes"],
|
|
||||||
[AC_MSG_ERROR([Cannot enable generated docs when building overall is disabled. Please do not pass '--enable-doc-gen' or do not pass '--disable-build'.])])
|
|
||||||
|
|
||||||
AS_IF(
|
|
||||||
[test "$ENABLE_FUNCTIONAL_TESTS" == "yes" || test "$ENABLE_DOC_GEN" == "yes"],
|
|
||||||
[NEED_PROG(jq, jq)])
|
|
||||||
|
|
||||||
AS_IF([test "$ENABLE_BUILD" == "yes"],[
|
|
||||||
|
|
||||||
# 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 <stdint.h>
|
|
||||||
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
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(install-unit-tests, AS_HELP_STRING([--enable-install-unit-tests],[Install the unit tests for running later (default no)]),
|
|
||||||
INSTALL_UNIT_TESTS=$enableval, INSTALL_UNIT_TESTS=no)
|
|
||||||
AC_SUBST(INSTALL_UNIT_TESTS)
|
|
||||||
|
|
||||||
AC_ARG_WITH(check-bin-dir, AS_HELP_STRING([--with-check-bin-dir=PATH],[path to install unit tests for running later (defaults to $libexecdir/nix)]),
|
|
||||||
checkbindir=$withval, checkbindir=$libexecdir/nix)
|
|
||||||
AC_SUBST(checkbindir)
|
|
||||||
|
|
||||||
AC_ARG_WITH(check-lib-dir, AS_HELP_STRING([--with-check-lib-dir=PATH],[path to install unit tests for running later (defaults to $libdir)]),
|
|
||||||
checklibdir=$withval, checklibdir=$libdir)
|
|
||||||
AC_SUBST(checklibdir)
|
|
||||||
|
|
||||||
# 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 or readline, a required dependency.
|
|
||||||
# The the libeditline.pc file was added only in libeditline >= 1.15.2,
|
|
||||||
# see https://github.com/troglobit/editline/commit/0a8f2ef4203c3a4a4726b9dd1336869cd0da8607,
|
|
||||||
# Older versions are no longer supported.
|
|
||||||
AC_ARG_WITH(
|
|
||||||
[readline-flavor],
|
|
||||||
AS_HELP_STRING([--with-readline-flavor],[Which library to use for nice line editting with the Nix language REPL" [default=editline]]),
|
|
||||||
[readline_flavor=$withval],
|
|
||||||
[readline_flavor=editline])
|
|
||||||
AS_CASE(["$readline_flavor"],
|
|
||||||
[editline], [
|
|
||||||
readline_flavor_pc=libeditline
|
|
||||||
],
|
|
||||||
[readline], [
|
|
||||||
readline_flavor_pc=readline
|
|
||||||
AC_DEFINE([USE_READLINE], [1], [Use readline instead of editline])
|
|
||||||
],
|
|
||||||
[AC_MSG_ERROR([bad value "$readline_flavor" for --with-readline-flavor, must be one of: editline, readline])])
|
|
||||||
PKG_CHECK_MODULES([EDITLINE], [$readline_flavor_pc], [CXXFLAGS="$EDITLINE_CFLAGS $CXXFLAGS"])
|
|
||||||
|
|
||||||
# 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" CFLAGS="$LIBSECCOMP_CFLAGS $CFLAGS"])
|
|
||||||
have_seccomp=1
|
|
||||||
AC_DEFINE([HAVE_SECCOMP], [1], [Whether seccomp is available and should be used for sandboxing.])
|
|
||||||
AC_COMPILE_IFELSE([
|
|
||||||
AC_LANG_SOURCE([[
|
|
||||||
#include <seccomp.h>
|
|
||||||
#ifndef __SNR_fchmodat2
|
|
||||||
# error "Missing support for fchmodat2"
|
|
||||||
#endif
|
|
||||||
]])
|
|
||||||
], [], [
|
|
||||||
echo "libseccomp is missing __SNR_fchmodat2. Please provide libseccomp 2.5.5 or later"
|
|
||||||
exit 1
|
|
||||||
])
|
|
||||||
else
|
|
||||||
have_seccomp=
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
have_seccomp=
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
AC_SUBST(HAVE_SECCOMP, [$have_seccomp])
|
|
||||||
|
|
||||||
# Optional dependencies for better normalizing file system data
|
|
||||||
AC_CHECK_HEADERS([sys/xattr.h])
|
|
||||||
AS_IF([test "$ac_cv_header_sys_xattr_h" = "yes"],[
|
|
||||||
AC_CHECK_FUNCS([llistxattr lremovexattr])
|
|
||||||
AS_IF([test "$ac_cv_func_llistxattr" = "yes" && test "$ac_cv_func_lremovexattr" = "yes"],[
|
|
||||||
AC_DEFINE([HAVE_ACL_SUPPORT], [1], [Define if we can manipulate file system Access Control Lists])
|
|
||||||
])
|
|
||||||
])
|
|
||||||
|
|
||||||
# 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++)
|
|
||||||
|
|
||||||
|
|
||||||
# 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.])
|
|
||||||
|
|
||||||
# See `fixupBoehmStackPointer`, for the integration between Boehm GC
|
|
||||||
# and Boost coroutines.
|
|
||||||
old_CFLAGS="$CFLAGS"
|
|
||||||
# Temporary set `-pthread` just for the next check
|
|
||||||
CFLAGS="$CFLAGS -pthread"
|
|
||||||
AC_CHECK_FUNCS([pthread_attr_get_np pthread_getattr_np])
|
|
||||||
CFLAGS="$old_CFLAGS"
|
|
||||||
fi
|
|
||||||
|
|
||||||
AS_IF([test "$ENABLE_UNIT_TESTS" == "yes"],[
|
|
||||||
|
|
||||||
# Look for gtest.
|
|
||||||
PKG_CHECK_MODULES([GTEST], [gtest_main gmock_main])
|
|
||||||
|
|
||||||
# Look for rapidcheck.
|
|
||||||
PKG_CHECK_MODULES([RAPIDCHECK], [rapidcheck rapidcheck_gtest])
|
|
||||||
|
|
||||||
])
|
|
||||||
|
|
||||||
# Look for nlohmann/json.
|
|
||||||
PKG_CHECK_MODULES([NLOHMANN_JSON], [nlohmann_json >= 3.9])
|
|
||||||
|
|
||||||
|
|
||||||
# Look for lowdown library.
|
|
||||||
AC_ARG_ENABLE([markdown], AS_HELP_STRING([--enable-markdown], [Enable Markdown rendering in the Nix binary (requires lowdown) [default=auto]]),
|
|
||||||
enable_markdown=$enableval, enable_markdown=auto)
|
|
||||||
AS_CASE(["$enable_markdown"],
|
|
||||||
[yes | auto], [
|
|
||||||
PKG_CHECK_MODULES([LOWDOWN], [lowdown >= 0.9.0], [
|
|
||||||
CXXFLAGS="$LOWDOWN_CFLAGS $CXXFLAGS"
|
|
||||||
have_lowdown=1
|
|
||||||
AC_DEFINE(HAVE_LOWDOWN, 1, [Whether lowdown is available and should be used for Markdown rendering.])
|
|
||||||
], [
|
|
||||||
AS_IF([test "x$enable_markdown" == "xyes"], [AC_MSG_ERROR([--enable-markdown was specified, but lowdown was not found.])])
|
|
||||||
])
|
|
||||||
],
|
|
||||||
[no], [have_lowdown=],
|
|
||||||
[AC_MSG_ERROR([bad value "$enable_markdown" for --enable-markdown, must be one of: yes, no, auto])])
|
|
||||||
|
|
||||||
|
|
||||||
# Look for libgit2.
|
|
||||||
PKG_CHECK_MODULES([LIBGIT2], [libgit2])
|
|
||||||
|
|
||||||
|
|
||||||
# Look for toml11, a required dependency.
|
|
||||||
AC_LANG_PUSH(C++)
|
|
||||||
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
|
|
19
default.nix
19
default.nix
|
@ -1,10 +1,9 @@
|
||||||
(import
|
(import (
|
||||||
(
|
let
|
||||||
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
|
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
||||||
fetchTarball {
|
in
|
||||||
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
fetchTarball {
|
||||||
sha256 = lock.nodes.flake-compat.locked.narHash;
|
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
|
||||||
}
|
sha256 = lock.nodes.flake-compat.locked.narHash;
|
||||||
)
|
}
|
||||||
{ src = ./.; }
|
) { src = ./.; }).defaultNix
|
||||||
).defaultNix
|
|
||||||
|
|
1
doc/manual/.version
Symbolic link
1
doc/manual/.version
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../../.version
|
|
@ -1,5 +1,6 @@
|
||||||
[book]
|
[book]
|
||||||
title = "Determinate Nix Reference Manual"
|
title = "Determinate Nix Reference Manual"
|
||||||
|
src = "source"
|
||||||
|
|
||||||
[output.html]
|
[output.html]
|
||||||
additional-css = ["custom.css"]
|
additional-css = ["custom.css"]
|
||||||
|
@ -7,9 +8,21 @@ additional-js = ["redirects.js"]
|
||||||
edit-url-template = "https://github.com/NixOS/nix/tree/master/doc/manual/{path}"
|
edit-url-template = "https://github.com/NixOS/nix/tree/master/doc/manual/{path}"
|
||||||
git-repository-url = "https://github.com/NixOS/nix"
|
git-repository-url = "https://github.com/NixOS/nix"
|
||||||
|
|
||||||
|
# Handles replacing @docroot@ with a path to ./source 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 ./substitute.py"
|
||||||
|
before = ["anchors", "links"]
|
||||||
|
|
||||||
[preprocessor.anchors]
|
[preprocessor.anchors]
|
||||||
renderers = ["html"]
|
renderers = ["html"]
|
||||||
command = "jq --from-file doc/manual/anchors.jq"
|
command = "jq --from-file ./anchors.jq"
|
||||||
|
|
||||||
|
[output.markdown]
|
||||||
|
|
||||||
[output.linkcheck]
|
[output.linkcheck]
|
||||||
# no Internet during the build (in the sandbox)
|
# no Internet during the build (in the sandbox)
|
||||||
|
|
|
@ -12,8 +12,8 @@ h1.menu-title::before {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
h1.menu-title {
|
.menu-bar {
|
||||||
padding: 0.5em;
|
padding: 0.5em 0em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar .sidebar-scrollbox {
|
.sidebar .sidebar-scrollbox {
|
||||||
|
|
|
@ -5,7 +5,15 @@ in
|
||||||
|
|
||||||
builtinsInfo:
|
builtinsInfo:
|
||||||
let
|
let
|
||||||
showBuiltin = name: { doc, type ? null, args ? [ ], experimental-feature ? null, impure-only ? false }:
|
showBuiltin =
|
||||||
|
name:
|
||||||
|
{
|
||||||
|
doc,
|
||||||
|
type ? null,
|
||||||
|
args ? [ ],
|
||||||
|
experimental-feature ? null,
|
||||||
|
impure-only ? false,
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
type' = optionalString (type != null) " (${type})";
|
type' = optionalString (type != null) " (${type})";
|
||||||
|
|
||||||
|
|
22
doc/manual/generate-deps.py
Executable file
22
doc/manual/generate-deps.py
Executable file
|
@ -0,0 +1,22 @@
|
||||||
|
#!/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)
|
|
@ -32,7 +32,13 @@ let
|
||||||
|
|
||||||
commandInfo = fromJSON commandDump;
|
commandInfo = fromJSON commandDump;
|
||||||
|
|
||||||
showCommand = { command, details, filename, toplevel }:
|
showCommand =
|
||||||
|
{
|
||||||
|
command,
|
||||||
|
details,
|
||||||
|
filename,
|
||||||
|
toplevel,
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
|
|
||||||
result = ''
|
result = ''
|
||||||
|
@ -51,26 +57,27 @@ let
|
||||||
${maybeOptions}
|
${maybeOptions}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
showSynopsis = command: args:
|
showSynopsis =
|
||||||
|
command: args:
|
||||||
let
|
let
|
||||||
showArgument = arg: "*${arg.label}*" + optionalString (! arg ? arity) "...";
|
showArgument = arg: "*${arg.label}*" + optionalString (!arg ? arity) "...";
|
||||||
arguments = concatStringsSep " " (map showArgument args);
|
arguments = concatStringsSep " " (map showArgument args);
|
||||||
in ''
|
in
|
||||||
|
''
|
||||||
`${command}` [*option*...] ${arguments}
|
`${command}` [*option*...] ${arguments}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
maybeSubcommands = optionalString (details ? commands && details.commands != {})
|
maybeSubcommands = optionalString (details ? commands && details.commands != { }) ''
|
||||||
''
|
where *subcommand* is one of the following:
|
||||||
where *subcommand* is one of the following:
|
|
||||||
|
|
||||||
${subcommands}
|
${subcommands}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
subcommands = if length categories > 1
|
subcommands = if length categories > 1 then listCategories else listSubcommands details.commands;
|
||||||
then listCategories
|
|
||||||
else listSubcommands details.commands;
|
|
||||||
|
|
||||||
categories = sort (x: y: x.id < y.id) (unique (map (cmd: cmd.category) (attrValues details.commands)));
|
categories = sort (x: y: x.id < y.id) (
|
||||||
|
unique (map (cmd: cmd.category) (attrValues details.commands))
|
||||||
|
);
|
||||||
|
|
||||||
listCategories = concatStrings (map showCategory categories);
|
listCategories = concatStrings (map showCategory categories);
|
||||||
|
|
||||||
|
@ -94,38 +101,39 @@ let
|
||||||
|
|
||||||
${allStores}
|
${allStores}
|
||||||
'';
|
'';
|
||||||
index = replaceStrings
|
index =
|
||||||
[ "@store-types@" "./local-store.md" "./local-daemon-store.md" ]
|
replaceStrings
|
||||||
[ storesOverview "#local-store" "#local-daemon-store" ]
|
[ "@store-types@" "./local-store.md" "./local-daemon-store.md" ]
|
||||||
details.doc;
|
[ storesOverview "#local-store" "#local-daemon-store" ]
|
||||||
|
details.doc;
|
||||||
storesOverview =
|
storesOverview =
|
||||||
let
|
let
|
||||||
showEntry = store:
|
showEntry = store: "- [${store.name}](#${store.slug})";
|
||||||
"- [${store.name}](#${store.slug})";
|
|
||||||
in
|
in
|
||||||
concatStringsSep "\n" (map showEntry storesList) + "\n";
|
concatStringsSep "\n" (map showEntry storesList) + "\n";
|
||||||
allStores = concatStringsSep "\n" (attrValues storePages);
|
allStores = concatStringsSep "\n" (attrValues storePages);
|
||||||
storePages = listToAttrs
|
storePages = listToAttrs (
|
||||||
(map (s: { name = s.filename; value = s.page; }) storesList);
|
map (s: {
|
||||||
|
name = s.filename;
|
||||||
|
value = s.page;
|
||||||
|
}) storesList
|
||||||
|
);
|
||||||
storesList = showStoreDocs {
|
storesList = showStoreDocs {
|
||||||
storeInfo = commandInfo.stores;
|
storeInfo = commandInfo.stores;
|
||||||
inherit inlineHTML;
|
inherit inlineHTML;
|
||||||
};
|
};
|
||||||
hasInfix = infix: content:
|
hasInfix =
|
||||||
|
infix: content:
|
||||||
builtins.stringLength content != builtins.stringLength (replaceStrings [ infix ] [ "" ] content);
|
builtins.stringLength content != builtins.stringLength (replaceStrings [ infix ] [ "" ] content);
|
||||||
in
|
in
|
||||||
optionalString (details ? doc) (
|
optionalString (details ? doc) (
|
||||||
# An alternate implementation with builtins.match stack overflowed on some systems.
|
# An alternate implementation with builtins.match stack overflowed on some systems.
|
||||||
if hasInfix "@store-types@" details.doc
|
if hasInfix "@store-types@" details.doc then help-stores else details.doc
|
||||||
then help-stores
|
|
||||||
else details.doc
|
|
||||||
);
|
);
|
||||||
|
|
||||||
maybeOptions =
|
maybeOptions =
|
||||||
let
|
let
|
||||||
allVisibleOptions = filterAttrs
|
allVisibleOptions = filterAttrs (_: o: !o.hiddenCategory) (details.flags // toplevel.flags);
|
||||||
(_: o: ! o.hiddenCategory)
|
|
||||||
(details.flags // toplevel.flags);
|
|
||||||
in
|
in
|
||||||
optionalString (allVisibleOptions != { }) ''
|
optionalString (allVisibleOptions != { }) ''
|
||||||
# Options
|
# Options
|
||||||
|
@ -137,55 +145,73 @@ let
|
||||||
> See [`man nix.conf`](@docroot@/command-ref/conf-file.md#command-line-flags) for overriding configuration settings with command line flags.
|
> See [`man nix.conf`](@docroot@/command-ref/conf-file.md#command-line-flags) for overriding configuration settings with command line flags.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
showOptions = inlineHTML: allOptions:
|
showOptions =
|
||||||
|
inlineHTML: allOptions:
|
||||||
let
|
let
|
||||||
showCategory = cat: opts: ''
|
showCategory = cat: opts: ''
|
||||||
${optionalString (cat != "") "## ${cat}"}
|
${optionalString (cat != "") "## ${cat}"}
|
||||||
|
|
||||||
${concatStringsSep "\n" (attrValues (mapAttrs showOption opts))}
|
${concatStringsSep "\n" (attrValues (mapAttrs showOption opts))}
|
||||||
'';
|
'';
|
||||||
showOption = name: option:
|
showOption =
|
||||||
|
name: option:
|
||||||
let
|
let
|
||||||
result = trim ''
|
result = trim ''
|
||||||
- ${item}
|
- ${item}
|
||||||
|
|
||||||
${option.description}
|
${option.description}
|
||||||
'';
|
'';
|
||||||
item = if inlineHTML
|
item =
|
||||||
then ''<span id="opt-${name}">[`--${name}`](#opt-${name})</span> ${shortName} ${labels}''
|
if inlineHTML then
|
||||||
else "`--${name}` ${shortName} ${labels}";
|
''<span id="opt-${name}">[`--${name}`](#opt-${name})</span> ${shortName} ${labels}''
|
||||||
shortName = optionalString
|
else
|
||||||
(option ? shortName)
|
"`--${name}` ${shortName} ${labels}";
|
||||||
("/ `-${option.shortName}`");
|
shortName = optionalString (option ? shortName) ("/ `-${option.shortName}`");
|
||||||
labels = optionalString
|
labels = optionalString (option ? labels) (concatStringsSep " " (map (s: "*${s}*") option.labels));
|
||||||
(option ? labels)
|
in
|
||||||
(concatStringsSep " " (map (s: "*${s}*") option.labels));
|
result;
|
||||||
in result;
|
categories =
|
||||||
categories = mapAttrs
|
mapAttrs
|
||||||
# Convert each group from a list of key-value pairs back to an attrset
|
# Convert each group from a list of key-value pairs back to an attrset
|
||||||
(_: listToAttrs)
|
(_: listToAttrs)
|
||||||
(groupBy
|
(groupBy (cmd: cmd.value.category) (attrsToList allOptions));
|
||||||
(cmd: cmd.value.category)
|
in
|
||||||
(attrsToList allOptions));
|
concatStrings (attrValues (mapAttrs showCategory categories));
|
||||||
in concatStrings (attrValues (mapAttrs showCategory categories));
|
in
|
||||||
in squash result;
|
squash result;
|
||||||
|
|
||||||
appendName = filename: name: (if filename == "nix" then "nix3" else filename) + "-" + name;
|
appendName = filename: name: (if filename == "nix" then "nix3" else filename) + "-" + name;
|
||||||
|
|
||||||
processCommand = { command, details, filename, toplevel }:
|
processCommand =
|
||||||
|
{
|
||||||
|
command,
|
||||||
|
details,
|
||||||
|
filename,
|
||||||
|
toplevel,
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
cmd = {
|
cmd = {
|
||||||
inherit command;
|
inherit command;
|
||||||
name = filename + ".md";
|
name = filename + ".md";
|
||||||
value = showCommand { inherit command details filename toplevel; };
|
value = showCommand {
|
||||||
|
inherit
|
||||||
|
command
|
||||||
|
details
|
||||||
|
filename
|
||||||
|
toplevel
|
||||||
|
;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
subcommand = subCmd: processCommand {
|
subcommand =
|
||||||
command = command + " " + subCmd;
|
subCmd:
|
||||||
details = details.commands.${subCmd};
|
processCommand {
|
||||||
filename = appendName filename subCmd;
|
command = command + " " + subCmd;
|
||||||
inherit toplevel;
|
details = details.commands.${subCmd};
|
||||||
};
|
filename = appendName filename subCmd;
|
||||||
in [ cmd ] ++ concatMap subcommand (attrNames details.commands or {});
|
inherit toplevel;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
[ cmd ] ++ concatMap subcommand (attrNames details.commands or { });
|
||||||
|
|
||||||
manpages = processCommand {
|
manpages = processCommand {
|
||||||
command = "nix";
|
command = "nix";
|
||||||
|
@ -194,9 +220,11 @@ let
|
||||||
toplevel = commandInfo.args;
|
toplevel = commandInfo.args;
|
||||||
};
|
};
|
||||||
|
|
||||||
tableOfContents = let
|
tableOfContents =
|
||||||
showEntry = page:
|
let
|
||||||
" - [${page.command}](command-ref/new-cli/${page.name})";
|
showEntry = page: " - [${page.command}](command-ref/new-cli/${page.name})";
|
||||||
in concatStringsSep "\n" (map showEntry manpages) + "\n";
|
in
|
||||||
|
concatStringsSep "\n" (map showEntry manpages) + "\n";
|
||||||
|
|
||||||
in (listToAttrs manpages) // { "SUMMARY.md" = tableOfContents; }
|
in
|
||||||
|
(listToAttrs manpages) // { "SUMMARY.md" = tableOfContents; }
|
||||||
|
|
|
@ -1,67 +1,99 @@
|
||||||
let
|
let
|
||||||
inherit (builtins) attrValues concatStringsSep isAttrs isBool mapAttrs;
|
inherit (builtins)
|
||||||
inherit (import <nix/utils.nix>) concatStrings indent optionalString squash;
|
attrValues
|
||||||
|
concatStringsSep
|
||||||
|
isAttrs
|
||||||
|
isBool
|
||||||
|
mapAttrs
|
||||||
|
;
|
||||||
|
inherit (import <nix/utils.nix>)
|
||||||
|
concatStrings
|
||||||
|
indent
|
||||||
|
optionalString
|
||||||
|
squash
|
||||||
|
;
|
||||||
in
|
in
|
||||||
|
|
||||||
# `inlineHTML` is a hack to accommodate inconsistent output from `lowdown`
|
# `inlineHTML` is a hack to accommodate inconsistent output from `lowdown`
|
||||||
{ prefix, inlineHTML ? true }: settingsInfo:
|
{
|
||||||
|
prefix,
|
||||||
|
inlineHTML ? true,
|
||||||
|
}:
|
||||||
|
settingsInfo:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
showSetting = prefix: setting: { description, documentDefault, defaultValue, aliases, value, experimentalFeature }:
|
showSetting =
|
||||||
|
prefix: setting:
|
||||||
|
{
|
||||||
|
description,
|
||||||
|
documentDefault,
|
||||||
|
defaultValue,
|
||||||
|
aliases,
|
||||||
|
value,
|
||||||
|
experimentalFeature,
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
result = squash ''
|
result = squash ''
|
||||||
- ${item}
|
- ${item}
|
||||||
|
|
||||||
${indent " " body}
|
${indent " " body}
|
||||||
'';
|
'';
|
||||||
item = if inlineHTML
|
item =
|
||||||
then ''<span id="${prefix}-${setting}">[`${setting}`](#${prefix}-${setting})</span>''
|
if inlineHTML then
|
||||||
else "`${setting}`";
|
''<span id="${prefix}-${setting}">[`${setting}`](#${prefix}-${setting})</span>''
|
||||||
|
else
|
||||||
|
"`${setting}`";
|
||||||
# separate body to cleanly handle indentation
|
# separate body to cleanly handle indentation
|
||||||
body = ''
|
body = ''
|
||||||
${experimentalFeatureNote}
|
${experimentalFeatureNote}
|
||||||
|
|
||||||
${description}
|
${description}
|
||||||
|
|
||||||
**Default:** ${showDefault documentDefault defaultValue}
|
**Default:** ${showDefault documentDefault defaultValue}
|
||||||
|
|
||||||
${showAliases aliases}
|
${showAliases aliases}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
experimentalFeatureNote = optionalString (experimentalFeature != null) ''
|
experimentalFeatureNote = optionalString (experimentalFeature != null) ''
|
||||||
> **Warning**
|
> **Warning**
|
||||||
>
|
>
|
||||||
> This setting is part of an
|
> This setting is part of an
|
||||||
> [experimental feature](@docroot@/development/experimental-features.md).
|
> [experimental feature](@docroot@/development/experimental-features.md).
|
||||||
>
|
>
|
||||||
> To change this setting, make sure the
|
> To change this setting, make sure the
|
||||||
> [`${experimentalFeature}` experimental feature](@docroot@/development/experimental-features.md#xp-feature-${experimentalFeature})
|
> [`${experimentalFeature}` experimental feature](@docroot@/development/experimental-features.md#xp-feature-${experimentalFeature})
|
||||||
> is enabled.
|
> is enabled.
|
||||||
> For example, include the following in [`nix.conf`](@docroot@/command-ref/conf-file.md):
|
> For example, include the following in [`nix.conf`](@docroot@/command-ref/conf-file.md):
|
||||||
>
|
>
|
||||||
> ```
|
> ```
|
||||||
> extra-experimental-features = ${experimentalFeature}
|
> extra-experimental-features = ${experimentalFeature}
|
||||||
> ${setting} = ...
|
> ${setting} = ...
|
||||||
> ```
|
> ```
|
||||||
'';
|
'';
|
||||||
|
|
||||||
showDefault = documentDefault: defaultValue:
|
showDefault =
|
||||||
|
documentDefault: defaultValue:
|
||||||
if documentDefault then
|
if documentDefault then
|
||||||
# a StringMap value type is specified as a string, but
|
# a StringMap value type is specified as a string, but
|
||||||
# this shows the value type. The empty stringmap is `null` in
|
# this shows the value type. The empty stringmap is `null` in
|
||||||
# JSON, but that converts to `{ }` here.
|
# JSON, but that converts to `{ }` here.
|
||||||
if defaultValue == "" || defaultValue == [] || isAttrs defaultValue
|
if defaultValue == "" || defaultValue == [ ] || isAttrs defaultValue then
|
||||||
then "*empty*"
|
"*empty*"
|
||||||
else if isBool defaultValue then
|
else if isBool defaultValue then
|
||||||
if defaultValue then "`true`" else "`false`"
|
if defaultValue then "`true`" else "`false`"
|
||||||
else "`${toString defaultValue}`"
|
else
|
||||||
else "*machine-specific*";
|
"`${toString defaultValue}`"
|
||||||
|
else
|
||||||
|
"*machine-specific*";
|
||||||
|
|
||||||
showAliases = aliases:
|
showAliases =
|
||||||
optionalString (aliases != [])
|
aliases:
|
||||||
"**Deprecated alias:** ${(concatStringsSep ", " (map (s: "`${s}`") aliases))}";
|
optionalString (aliases != [ ])
|
||||||
|
"**Deprecated alias:** ${(concatStringsSep ", " (map (s: "`${s}`") aliases))}";
|
||||||
|
|
||||||
in result;
|
in
|
||||||
|
result;
|
||||||
|
|
||||||
in concatStrings (attrValues (mapAttrs (showSetting prefix) settingsInfo))
|
in
|
||||||
|
concatStrings (attrValues (mapAttrs (showSetting prefix) settingsInfo))
|
||||||
|
|
|
@ -1,6 +1,20 @@
|
||||||
let
|
let
|
||||||
inherit (builtins) attrNames listToAttrs concatStringsSep readFile replaceStrings;
|
inherit (builtins)
|
||||||
inherit (import <nix/utils.nix>) optionalString filterAttrs trim squash toLower unique indent;
|
attrNames
|
||||||
|
listToAttrs
|
||||||
|
concatStringsSep
|
||||||
|
readFile
|
||||||
|
replaceStrings
|
||||||
|
;
|
||||||
|
inherit (import <nix/utils.nix>)
|
||||||
|
optionalString
|
||||||
|
filterAttrs
|
||||||
|
trim
|
||||||
|
squash
|
||||||
|
toLower
|
||||||
|
unique
|
||||||
|
indent
|
||||||
|
;
|
||||||
showSettings = import <nix/generate-settings.nix>;
|
showSettings = import <nix/generate-settings.nix>;
|
||||||
in
|
in
|
||||||
|
|
||||||
|
@ -14,7 +28,13 @@ in
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
showStore = { name, slug }: { settings, doc, experimentalFeature }:
|
showStore =
|
||||||
|
{ name, slug }:
|
||||||
|
{
|
||||||
|
settings,
|
||||||
|
doc,
|
||||||
|
experimentalFeature,
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
result = squash ''
|
result = squash ''
|
||||||
# ${name}
|
# ${name}
|
||||||
|
@ -25,7 +45,10 @@ let
|
||||||
|
|
||||||
## Settings
|
## Settings
|
||||||
|
|
||||||
${showSettings { prefix = "store-${slug}"; inherit inlineHTML; } settings}
|
${showSettings {
|
||||||
|
prefix = "store-${slug}";
|
||||||
|
inherit inlineHTML;
|
||||||
|
} settings}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
experimentalFeatureNote = optionalString (experimentalFeature != null) ''
|
experimentalFeatureNote = optionalString (experimentalFeature != null) ''
|
||||||
|
@ -43,15 +66,15 @@ let
|
||||||
> extra-experimental-features = ${experimentalFeature}
|
> extra-experimental-features = ${experimentalFeature}
|
||||||
> ```
|
> ```
|
||||||
'';
|
'';
|
||||||
in result;
|
in
|
||||||
|
result;
|
||||||
|
|
||||||
storesList = map
|
storesList = map (name: rec {
|
||||||
(name: rec {
|
inherit name;
|
||||||
inherit name;
|
slug = replaceStrings [ " " ] [ "-" ] (toLower name);
|
||||||
slug = replaceStrings [ " " ] [ "-" ] (toLower name);
|
filename = "${slug}.md";
|
||||||
filename = "${slug}.md";
|
page = showStore { inherit name slug; } storeInfo.${name};
|
||||||
page = showStore { inherit name slug; } storeInfo.${name};
|
}) (attrNames storeInfo);
|
||||||
})
|
|
||||||
(attrNames storeInfo);
|
|
||||||
|
|
||||||
in storesList
|
in
|
||||||
|
storesList
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
let
|
let
|
||||||
inherit (builtins) attrNames listToAttrs concatStringsSep readFile replaceStrings;
|
inherit (builtins)
|
||||||
|
attrNames
|
||||||
|
listToAttrs
|
||||||
|
concatStringsSep
|
||||||
|
readFile
|
||||||
|
replaceStrings
|
||||||
|
;
|
||||||
showSettings = import <nix/generate-settings.nix>;
|
showSettings = import <nix/generate-settings.nix>;
|
||||||
showStoreDocs = import <nix/generate-store-info.nix>;
|
showStoreDocs = import <nix/generate-store-info.nix>;
|
||||||
in
|
in
|
||||||
|
@ -14,26 +20,28 @@ let
|
||||||
|
|
||||||
index =
|
index =
|
||||||
let
|
let
|
||||||
showEntry = store:
|
showEntry = store: "- [${store.name}](./${store.filename})";
|
||||||
"- [${store.name}](./${store.filename})";
|
|
||||||
in
|
in
|
||||||
concatStringsSep "\n" (map showEntry storesList);
|
concatStringsSep "\n" (map showEntry storesList);
|
||||||
|
|
||||||
"index.md" = replaceStrings
|
"index.md" =
|
||||||
[ "@store-types@" ] [ index ]
|
replaceStrings [ "@store-types@" ] [ index ]
|
||||||
(readFile ./src/store/types/index.md.in);
|
(readFile ./source/store/types/index.md.in);
|
||||||
|
|
||||||
tableOfContents =
|
tableOfContents =
|
||||||
let
|
let
|
||||||
showEntry = store:
|
showEntry = store: " - [${store.name}](store/types/${store.filename})";
|
||||||
" - [${store.name}](store/types/${store.filename})";
|
|
||||||
in
|
in
|
||||||
concatStringsSep "\n" (map showEntry storesList) + "\n";
|
concatStringsSep "\n" (map showEntry storesList) + "\n";
|
||||||
|
|
||||||
"SUMMARY.md" = tableOfContents;
|
"SUMMARY.md" = tableOfContents;
|
||||||
|
|
||||||
storePages = listToAttrs
|
storePages = listToAttrs (
|
||||||
(map (s: { name = s.filename; value = s.page; }) storesList);
|
map (s: {
|
||||||
|
name = s.filename;
|
||||||
|
value = s.page;
|
||||||
|
}) storesList
|
||||||
|
);
|
||||||
|
|
||||||
in
|
in
|
||||||
storePages // { inherit "index.md" "SUMMARY.md"; }
|
storePages // { inherit "index.md" "SUMMARY.md"; }
|
||||||
|
|
|
@ -2,8 +2,8 @@ with builtins;
|
||||||
with import <nix/utils.nix>;
|
with import <nix/utils.nix>;
|
||||||
|
|
||||||
let
|
let
|
||||||
showExperimentalFeature = name: doc:
|
showExperimentalFeature = name: doc: ''
|
||||||
''
|
- [`${name}`](@docroot@/development/experimental-features.md#xp-feature-${name})
|
||||||
- [`${name}`](@docroot@/development/experimental-features.md#xp-feature-${name})
|
'';
|
||||||
'';
|
in
|
||||||
in xps: indent " " (concatStrings (attrValues (mapAttrs showExperimentalFeature xps)))
|
xps: indent " " (concatStrings (attrValues (mapAttrs showExperimentalFeature xps)))
|
||||||
|
|
|
@ -2,7 +2,8 @@ with builtins;
|
||||||
with import <nix/utils.nix>;
|
with import <nix/utils.nix>;
|
||||||
|
|
||||||
let
|
let
|
||||||
showExperimentalFeature = name: doc:
|
showExperimentalFeature =
|
||||||
|
name: doc:
|
||||||
squash ''
|
squash ''
|
||||||
## [`${name}`]{#xp-feature-${name}}
|
## [`${name}`]{#xp-feature-${name}}
|
||||||
|
|
||||||
|
|
|
@ -1,231 +0,0 @@
|
||||||
# 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 \
|
|
||||||
, $(d)/$(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)), \
|
|
||||||
$(d)/$(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 -I nix=doc/manual --store dummy:// --impure --raw
|
|
||||||
|
|
||||||
# re-implement mdBook's include directive to make it usable for terminal output and for proper @docroot@ substitution
|
|
||||||
define process-includes
|
|
||||||
while read -r line; do \
|
|
||||||
set -euo pipefail; \
|
|
||||||
filename="$$(dirname $(1))/$$(sed 's/{{#include \(.*\)}}/\1/'<<< $$line)"; \
|
|
||||||
test -f "$$filename" || ( echo "#include-d file '$$filename' does not exist." >&2; exit 1; ); \
|
|
||||||
matchline="$$(sed 's|/|\\/|g' <<< $$line)"; \
|
|
||||||
sed -i "/$$matchline/r $$filename" $(2); \
|
|
||||||
sed -i "s/$$matchline//" $(2); \
|
|
||||||
done < <(grep '{{#include' $(1))
|
|
||||||
endef
|
|
||||||
|
|
||||||
$(d)/nix-env-%.1: $(d)/src/command-ref/nix-env/%.md
|
|
||||||
@printf "Title: %s\n\n" "$(subst nix-env-,nix-env --,$$(basename "$@" .1))" > $^.tmp
|
|
||||||
$(render-subcommand)
|
|
||||||
|
|
||||||
$(d)/nix-store-%.1: $(d)/src/command-ref/nix-store/%.md
|
|
||||||
@printf -- 'Title: %s\n\n' "$(subst nix-store-,nix-store --,$$(basename "$@" .1))" > $^.tmp
|
|
||||||
$(render-subcommand)
|
|
||||||
|
|
||||||
# FIXME: there surely is some more deduplication to be achieved here with even darker Make magic
|
|
||||||
define render-subcommand
|
|
||||||
@cat $^ >> $^.tmp
|
|
||||||
@$(call process-includes,$^,$^.tmp)
|
|
||||||
$(trace-gen) lowdown -sT man --nroff-nolinks -M section=1 $^.tmp -o $@
|
|
||||||
@# fix up `lowdown`'s automatic escaping of `--`
|
|
||||||
@# https://github.com/kristapsdz/lowdown/blob/edca6ce6d5336efb147321a43c47a698de41bb7c/entity.c#L202
|
|
||||||
@sed -i 's/\e\[u2013\]/--/' $@
|
|
||||||
@rm $^.tmp
|
|
||||||
endef
|
|
||||||
|
|
||||||
|
|
||||||
$(d)/%.1: $(d)/src/command-ref/%.md
|
|
||||||
@printf "Title: %s\n\n" "$$(basename $@ .1)" > $^.tmp
|
|
||||||
@cat $^ >> $^.tmp
|
|
||||||
@$(call process-includes,$^,$^.tmp)
|
|
||||||
$(trace-gen) lowdown -sT man --nroff-nolinks -M section=1 $^.tmp -o $@
|
|
||||||
@rm $^.tmp
|
|
||||||
|
|
||||||
$(d)/%.8: $(d)/src/command-ref/%.md
|
|
||||||
@printf "Title: %s\n\n" "$$(basename $@ .8)" > $^.tmp
|
|
||||||
@cat $^ >> $^.tmp
|
|
||||||
$(trace-gen) lowdown -sT man --nroff-nolinks -M section=8 $^.tmp -o $@
|
|
||||||
@rm $^.tmp
|
|
||||||
|
|
||||||
$(d)/nix.conf.5: $(d)/src/command-ref/conf-file.md
|
|
||||||
@printf "Title: %s\n\n" "$$(basename $@ .5)" > $^.tmp
|
|
||||||
@cat $^ >> $^.tmp
|
|
||||||
@$(call process-includes,$^,$^.tmp)
|
|
||||||
$(trace-gen) lowdown -sT man --nroff-nolinks -M section=5 $^.tmp -o $@
|
|
||||||
@rm $^.tmp
|
|
||||||
|
|
||||||
$(d)/nix-profiles.5: $(d)/src/command-ref/files/profiles.md
|
|
||||||
@printf "Title: %s\n\n" "$$(basename $@ .5)" > $^.tmp
|
|
||||||
@cat $^ >> $^.tmp
|
|
||||||
$(trace-gen) lowdown -sT man --nroff-nolinks -M section=5 $^.tmp -o $@
|
|
||||||
@rm $^.tmp
|
|
||||||
|
|
||||||
$(d)/src/SUMMARY.md: $(d)/src/SUMMARY.md.in $(d)/src/SUMMARY-rl-next.md $(d)/src/store/types $(d)/src/command-ref/new-cli $(d)/src/development/experimental-feature-descriptions.md
|
|
||||||
@cp $< $@
|
|
||||||
@$(call process-includes,$@,$@)
|
|
||||||
|
|
||||||
$(d)/src/store/types: $(d)/nix.json $(d)/utils.nix $(d)/generate-store-info.nix $(d)/generate-store-types.nix $(d)/src/store/types/index.md.in $(doc_nix)
|
|
||||||
@# FIXME: build out of tree!
|
|
||||||
@rm -rf $@.tmp
|
|
||||||
$(trace-gen) $(nix-eval) --write-to $@.tmp --expr 'import doc/manual/generate-store-types.nix (builtins.fromJSON (builtins.readFile $<)).stores'
|
|
||||||
@# do not destroy existing contents
|
|
||||||
@mv $@.tmp/* $@/
|
|
||||||
|
|
||||||
$(d)/src/command-ref/new-cli: $(d)/nix.json $(d)/utils.nix $(d)/generate-manpage.nix $(d)/generate-settings.nix $(d)/generate-store-info.nix $(doc_nix)
|
|
||||||
@rm -rf $@ $@.tmp
|
|
||||||
$(trace-gen) $(nix-eval) --write-to $@.tmp --expr 'import doc/manual/generate-manpage.nix true (builtins.readFile $<)'
|
|
||||||
@mv $@.tmp $@
|
|
||||||
|
|
||||||
$(d)/src/command-ref/conf-file.md: $(d)/conf-file.json $(d)/utils.nix $(d)/generate-settings.nix $(d)/src/command-ref/conf-file-prefix.md $(d)/src/command-ref/experimental-features-shortlist.md $(doc_nix)
|
|
||||||
@cat doc/manual/src/command-ref/conf-file-prefix.md > $@.tmp
|
|
||||||
$(trace-gen) $(nix-eval) --expr 'import doc/manual/generate-settings.nix { prefix = "conf"; } (builtins.fromJSON (builtins.readFile $<))' >> $@.tmp;
|
|
||||||
@mv $@.tmp $@
|
|
||||||
|
|
||||||
$(d)/nix.json: $(doc_nix)
|
|
||||||
$(trace-gen) $(dummy-env) $(doc_nix) __dump-cli > $@.tmp
|
|
||||||
@mv $@.tmp $@
|
|
||||||
|
|
||||||
$(d)/conf-file.json: $(doc_nix)
|
|
||||||
$(trace-gen) $(dummy-env) $(doc_nix) config show --json > $@.tmp
|
|
||||||
@mv $@.tmp $@
|
|
||||||
|
|
||||||
$(d)/src/development/experimental-feature-descriptions.md: $(d)/xp-features.json $(d)/utils.nix $(d)/generate-xp-features.nix $(doc_nix)
|
|
||||||
@rm -rf $@ $@.tmp
|
|
||||||
$(trace-gen) $(nix-eval) --write-to $@.tmp --expr 'import doc/manual/generate-xp-features.nix (builtins.fromJSON (builtins.readFile $<))'
|
|
||||||
@mv $@.tmp $@
|
|
||||||
|
|
||||||
$(d)/src/command-ref/experimental-features-shortlist.md: $(d)/xp-features.json $(d)/utils.nix $(d)/generate-xp-features-shortlist.nix $(doc_nix)
|
|
||||||
@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 $@
|
|
||||||
|
|
||||||
$(d)/xp-features.json: $(doc_nix)
|
|
||||||
$(trace-gen) $(dummy-env) $(doc_nix) __dump-xp-features > $@.tmp
|
|
||||||
@mv $@.tmp $@
|
|
||||||
|
|
||||||
$(d)/src/language/builtins.md: $(d)/language.json $(d)/generate-builtins.nix $(d)/src/language/builtins-prefix.md $(doc_nix)
|
|
||||||
@cat doc/manual/src/language/builtins-prefix.md > $@.tmp
|
|
||||||
$(trace-gen) $(nix-eval) --expr 'import doc/manual/generate-builtins.nix (builtins.fromJSON (builtins.readFile $<))' >> $@.tmp;
|
|
||||||
@cat doc/manual/src/language/builtins-suffix.md >> $@.tmp
|
|
||||||
@mv $@.tmp $@
|
|
||||||
|
|
||||||
$(d)/language.json: $(doc_nix)
|
|
||||||
$(trace-gen) $(dummy-env) $(doc_nix) __dump-language > $@.tmp
|
|
||||||
@mv $@.tmp $@
|
|
||||||
|
|
||||||
# Generate "Upcoming release" notes (or clear it and remove from menu)
|
|
||||||
$(d)/src/release-notes/rl-next.md: $(d)/rl-next $(d)/rl-next/*
|
|
||||||
@if type -p changelog-d > /dev/null; then \
|
|
||||||
echo " GEN " $@; \
|
|
||||||
changelog-d doc/manual/rl-next > $@; \
|
|
||||||
else \
|
|
||||||
echo " NULL " $@; \
|
|
||||||
true > $@; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
$(d)/src/SUMMARY-rl-next.md: $(d)/src/release-notes/rl-next.md
|
|
||||||
$(trace-gen) true
|
|
||||||
@if [ -s $< ]; then \
|
|
||||||
echo ' - [Upcoming release](release-notes/rl-next.md)' > $@; \
|
|
||||||
else \
|
|
||||||
true > $@; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Generate the HTML manual.
|
|
||||||
.PHONY: manual-html
|
|
||||||
manual-html: $(docdir)/manual/index.html
|
|
||||||
|
|
||||||
# Open the built HTML manual in the default browser.
|
|
||||||
manual-html-open: $(docdir)/manual/index.html
|
|
||||||
@echo " OPEN " $<; \
|
|
||||||
xdg-open $< \
|
|
||||||
|| open $< \
|
|
||||||
|| { \
|
|
||||||
echo "Could not open the manual in a browser. Please open '$<'" >&2; \
|
|
||||||
false; \
|
|
||||||
}
|
|
||||||
install: $(docdir)/manual/index.html
|
|
||||||
|
|
||||||
# Generate 'nix' manpages.
|
|
||||||
.PHONY: manpages
|
|
||||||
manpages: $(mandir)/man1/nix3-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: $(d)/src/command-ref/new-cli
|
|
||||||
@mkdir -p $(DESTDIR)$$(dirname $@)
|
|
||||||
$(trace-gen) for i in doc/manual/src/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 $@
|
|
||||||
|
|
||||||
# the `! -name 'documentation.md'` filter excludes the one place where
|
|
||||||
# `@docroot@` is to be preserved for documenting the mechanism
|
|
||||||
# FIXME: maybe contributing guides should live right next to the code
|
|
||||||
# instead of in the manual
|
|
||||||
$(docdir)/manual/index.html: $(MANUAL_SRCS) $(d)/book.toml $(d)/anchors.jq $(d)/custom.css $(d)/src/SUMMARY.md $(d)/src/store/types $(d)/src/command-ref/new-cli $(d)/src/development/experimental-feature-descriptions.md $(d)/src/command-ref/conf-file.md $(d)/src/language/builtins.md $(d)/src/release-notes/rl-next.md $(d)/src/figures $(d)/src/favicon.png $(d)/src/favicon.svg
|
|
||||||
$(trace-gen) \
|
|
||||||
tmp="$$(mktemp -d)"; \
|
|
||||||
cp -r doc/manual "$$tmp"; \
|
|
||||||
find "$$tmp" -name '*.md' | while read -r file; do \
|
|
||||||
$(call process-includes,$$file,$$file); \
|
|
||||||
done; \
|
|
||||||
find "$$tmp" -name '*.md' ! -name 'documentation.md' | while read -r file; do \
|
|
||||||
docroot="$$(realpath --relative-to="$$(dirname "$$file")" $$tmp/manual/src)"; \
|
|
||||||
sed -i "s,@docroot@,$$docroot,g" "$$file"; \
|
|
||||||
done; \
|
|
||||||
set -euo pipefail; \
|
|
||||||
RUST_LOG=warn mdbook build "$$tmp/manual" -d $(DESTDIR)$(docdir)/manual.tmp 2>&1 \
|
|
||||||
| { grep -Fv "because fragment resolution isn't implemented" || :; }; \
|
|
||||||
rm -rf "$$tmp/manual"
|
|
||||||
@rm -rf $(DESTDIR)$(docdir)/manual
|
|
||||||
@mv $(DESTDIR)$(docdir)/manual.tmp/html $(DESTDIR)$(docdir)/manual
|
|
||||||
@rm -rf $(DESTDIR)$(docdir)/manual.tmp
|
|
357
doc/manual/meson.build
Normal file
357
doc/manual/meson.build
Normal file
|
@ -0,0 +1,357 @@
|
||||||
|
project('nix-manual',
|
||||||
|
version : files('.version'),
|
||||||
|
meson_version : '>= 1.1',
|
||||||
|
license : 'LGPL-2.1-or-later',
|
||||||
|
)
|
||||||
|
|
||||||
|
nix = find_program('nix', native : true)
|
||||||
|
|
||||||
|
mdbook = find_program('mdbook', native : true)
|
||||||
|
bash = find_program('bash', native : true)
|
||||||
|
|
||||||
|
pymod = import('python')
|
||||||
|
python = pymod.find_installation('python3')
|
||||||
|
|
||||||
|
nix_env_for_docs = {
|
||||||
|
'HOME': '/dummy',
|
||||||
|
'NIX_CONF_DIR': '/dummy',
|
||||||
|
'NIX_SSL_CERT_FILE': '/dummy/no-ca-bundle.crt',
|
||||||
|
'NIX_STATE_DIR': '/dummy',
|
||||||
|
'NIX_CONFIG': 'cores = 0',
|
||||||
|
}
|
||||||
|
|
||||||
|
nix_for_docs = [nix]
|
||||||
|
nix_eval_for_docs_common = nix_for_docs + [
|
||||||
|
'eval',
|
||||||
|
'-I', 'nix=' + meson.current_source_dir(),
|
||||||
|
'--store', 'dummy://',
|
||||||
|
'--impure',
|
||||||
|
]
|
||||||
|
nix_eval_for_docs = nix_eval_for_docs_common + '--raw'
|
||||||
|
|
||||||
|
conf_file_json = custom_target(
|
||||||
|
command : nix_for_docs + ['config', 'show', '--json'],
|
||||||
|
capture : true,
|
||||||
|
output : 'conf-file.json',
|
||||||
|
env : nix_env_for_docs,
|
||||||
|
)
|
||||||
|
|
||||||
|
language_json = custom_target(
|
||||||
|
command: [nix, '__dump-language'],
|
||||||
|
output : 'language.json',
|
||||||
|
capture : true,
|
||||||
|
env : nix_env_for_docs,
|
||||||
|
)
|
||||||
|
|
||||||
|
nix3_cli_json = custom_target(
|
||||||
|
command : [nix, '__dump-cli'],
|
||||||
|
capture : true,
|
||||||
|
output : 'nix.json',
|
||||||
|
env : nix_env_for_docs,
|
||||||
|
)
|
||||||
|
|
||||||
|
generate_manual_deps = files(
|
||||||
|
'generate-deps.py',
|
||||||
|
)
|
||||||
|
|
||||||
|
# Generates types
|
||||||
|
subdir('source/store')
|
||||||
|
# Generates builtins.md and builtin-constants.md.
|
||||||
|
subdir('source/language')
|
||||||
|
# Generates new-cli pages, experimental-features-shortlist.md, and conf-file.md.
|
||||||
|
subdir('source/command-ref')
|
||||||
|
# Generates experimental-feature-descriptions.md.
|
||||||
|
subdir('source/development')
|
||||||
|
# Generates rl-next-generated.md.
|
||||||
|
subdir('source/release-notes')
|
||||||
|
subdir('source')
|
||||||
|
|
||||||
|
# Hacky way to figure out if `nix` is an `ExternalProgram` or
|
||||||
|
# `Exectuable`. Only the latter can occur in custom target input lists.
|
||||||
|
if nix.full_path().startswith(meson.build_root())
|
||||||
|
nix_input = nix
|
||||||
|
else
|
||||||
|
nix_input = []
|
||||||
|
endif
|
||||||
|
|
||||||
|
manual = custom_target(
|
||||||
|
'manual',
|
||||||
|
command : [
|
||||||
|
bash,
|
||||||
|
'-euo', 'pipefail',
|
||||||
|
'-c',
|
||||||
|
'''
|
||||||
|
@0@ @INPUT0@ @CURRENT_SOURCE_DIR@ > @DEPFILE@
|
||||||
|
@0@ @INPUT1@ summary @2@ < @CURRENT_SOURCE_DIR@/source/SUMMARY.md.in > @2@/source/SUMMARY.md
|
||||||
|
rsync -r --include='*.md' @CURRENT_SOURCE_DIR@/ @2@/
|
||||||
|
(cd @2@; RUST_LOG=warn @1@ build -d @2@ 3>&2 2>&1 1>&3) | { grep -Fv "because fragment resolution isn't implemented" || :; } 3>&2 2>&1 1>&3
|
||||||
|
rm -rf @2@/manual
|
||||||
|
mv @2@/html @2@/manual
|
||||||
|
find @2@/manual -iname meson.build -delete
|
||||||
|
'''.format(
|
||||||
|
python.full_path(),
|
||||||
|
mdbook.full_path(),
|
||||||
|
meson.current_build_dir(),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
input : [
|
||||||
|
generate_manual_deps,
|
||||||
|
'substitute.py',
|
||||||
|
'book.toml',
|
||||||
|
'anchors.jq',
|
||||||
|
'custom.css',
|
||||||
|
nix3_cli_files,
|
||||||
|
experimental_features_shortlist_md,
|
||||||
|
experimental_feature_descriptions_md,
|
||||||
|
types_dir,
|
||||||
|
conf_file_md,
|
||||||
|
builtins_md,
|
||||||
|
rl_next_generated,
|
||||||
|
summary_rl_next,
|
||||||
|
nix_input,
|
||||||
|
],
|
||||||
|
output : [
|
||||||
|
'manual',
|
||||||
|
'markdown',
|
||||||
|
],
|
||||||
|
depfile : 'manual.d',
|
||||||
|
env : {
|
||||||
|
'RUST_LOG': 'info',
|
||||||
|
'MDBOOK_SUBSTITUTE_SEARCH': meson.current_build_dir() / 'source',
|
||||||
|
},
|
||||||
|
)
|
||||||
|
manual_html = manual[0]
|
||||||
|
manual_md = manual[1]
|
||||||
|
|
||||||
|
install_subdir(
|
||||||
|
manual_html.full_path(),
|
||||||
|
install_dir : get_option('datadir') / 'doc/nix',
|
||||||
|
)
|
||||||
|
|
||||||
|
nix_nested_manpages = [
|
||||||
|
[ 'nix-env',
|
||||||
|
[
|
||||||
|
'delete-generations',
|
||||||
|
'install',
|
||||||
|
'list-generations',
|
||||||
|
'query',
|
||||||
|
'rollback',
|
||||||
|
'set-flag',
|
||||||
|
'set',
|
||||||
|
'switch-generation',
|
||||||
|
'switch-profile',
|
||||||
|
'uninstall',
|
||||||
|
'upgrade',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[ 'nix-store',
|
||||||
|
[
|
||||||
|
'add-fixed',
|
||||||
|
'add',
|
||||||
|
'delete',
|
||||||
|
'dump-db',
|
||||||
|
'dump',
|
||||||
|
'export',
|
||||||
|
'gc',
|
||||||
|
'generate-binary-cache-key',
|
||||||
|
'import',
|
||||||
|
'load-db',
|
||||||
|
'optimise',
|
||||||
|
'print-env',
|
||||||
|
'query',
|
||||||
|
'read-log',
|
||||||
|
'realise',
|
||||||
|
'repair-path',
|
||||||
|
'restore',
|
||||||
|
'serve',
|
||||||
|
'verify',
|
||||||
|
'verify-path',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
]
|
||||||
|
|
||||||
|
foreach command : nix_nested_manpages
|
||||||
|
foreach page : command[1]
|
||||||
|
title = command[0] + ' --' + page
|
||||||
|
section = '1'
|
||||||
|
custom_target(
|
||||||
|
command : [
|
||||||
|
bash,
|
||||||
|
files('./render-manpage.sh'),
|
||||||
|
'--out-no-smarty',
|
||||||
|
title,
|
||||||
|
section,
|
||||||
|
'@INPUT0@/command-ref' / command[0] / (page + '.md'),
|
||||||
|
'@OUTPUT0@',
|
||||||
|
],
|
||||||
|
input : [
|
||||||
|
manual_md,
|
||||||
|
nix_input,
|
||||||
|
],
|
||||||
|
output : command[0] + '-' + page + '.1',
|
||||||
|
install : true,
|
||||||
|
install_dir : get_option('mandir') / 'man1',
|
||||||
|
)
|
||||||
|
endforeach
|
||||||
|
endforeach
|
||||||
|
|
||||||
|
nix3_manpages = [
|
||||||
|
'nix3-build',
|
||||||
|
'nix3-bundle',
|
||||||
|
'nix3-config',
|
||||||
|
'nix3-config-check',
|
||||||
|
'nix3-config-show',
|
||||||
|
'nix3-copy',
|
||||||
|
'nix3-daemon',
|
||||||
|
'nix3-derivation-add',
|
||||||
|
'nix3-derivation',
|
||||||
|
'nix3-derivation-show',
|
||||||
|
'nix3-develop',
|
||||||
|
'nix3-edit',
|
||||||
|
'nix3-env-shell',
|
||||||
|
'nix3-eval',
|
||||||
|
'nix3-flake-archive',
|
||||||
|
'nix3-flake-check',
|
||||||
|
'nix3-flake-clone',
|
||||||
|
'nix3-flake-info',
|
||||||
|
'nix3-flake-init',
|
||||||
|
'nix3-flake-lock',
|
||||||
|
'nix3-flake',
|
||||||
|
'nix3-flake-metadata',
|
||||||
|
'nix3-flake-new',
|
||||||
|
'nix3-flake-prefetch',
|
||||||
|
'nix3-flake-show',
|
||||||
|
'nix3-flake-update',
|
||||||
|
'nix3-fmt',
|
||||||
|
'nix3-hash-file',
|
||||||
|
'nix3-hash',
|
||||||
|
'nix3-hash-convert',
|
||||||
|
'nix3-hash-path',
|
||||||
|
'nix3-hash-to-base16',
|
||||||
|
'nix3-hash-to-base32',
|
||||||
|
'nix3-hash-to-base64',
|
||||||
|
'nix3-hash-to-sri',
|
||||||
|
'nix3-help',
|
||||||
|
'nix3-help-stores',
|
||||||
|
'nix3-key-convert-secret-to-public',
|
||||||
|
'nix3-key-generate-secret',
|
||||||
|
'nix3-key',
|
||||||
|
'nix3-log',
|
||||||
|
'nix3-nar-cat',
|
||||||
|
'nix3-nar-dump-path',
|
||||||
|
'nix3-nar-ls',
|
||||||
|
'nix3-nar-pack',
|
||||||
|
'nix3-nar',
|
||||||
|
'nix3-path-info',
|
||||||
|
'nix3-print-dev-env',
|
||||||
|
'nix3-profile-diff-closures',
|
||||||
|
'nix3-profile-history',
|
||||||
|
'nix3-profile-install',
|
||||||
|
'nix3-profile-list',
|
||||||
|
'nix3-profile',
|
||||||
|
'nix3-profile-remove',
|
||||||
|
'nix3-profile-rollback',
|
||||||
|
'nix3-profile-upgrade',
|
||||||
|
'nix3-profile-wipe-history',
|
||||||
|
'nix3-realisation-info',
|
||||||
|
'nix3-realisation',
|
||||||
|
'nix3-registry-add',
|
||||||
|
'nix3-registry-list',
|
||||||
|
'nix3-registry',
|
||||||
|
'nix3-registry-pin',
|
||||||
|
'nix3-registry-remove',
|
||||||
|
'nix3-repl',
|
||||||
|
'nix3-run',
|
||||||
|
'nix3-search',
|
||||||
|
'nix3-store-add',
|
||||||
|
'nix3-store-add-file',
|
||||||
|
'nix3-store-add-path',
|
||||||
|
'nix3-store-cat',
|
||||||
|
'nix3-store-copy-log',
|
||||||
|
'nix3-store-copy-sigs',
|
||||||
|
'nix3-store-delete',
|
||||||
|
'nix3-store-diff-closures',
|
||||||
|
'nix3-store-dump-path',
|
||||||
|
'nix3-store-gc',
|
||||||
|
'nix3-store-info',
|
||||||
|
'nix3-store-ls',
|
||||||
|
'nix3-store-make-content-addressed',
|
||||||
|
'nix3-store',
|
||||||
|
'nix3-store-optimise',
|
||||||
|
'nix3-store-path-from-hash-part',
|
||||||
|
'nix3-store-ping',
|
||||||
|
'nix3-store-prefetch-file',
|
||||||
|
'nix3-store-repair',
|
||||||
|
'nix3-store-sign',
|
||||||
|
'nix3-store-verify',
|
||||||
|
'nix3-upgrade-nix',
|
||||||
|
'nix3-why-depends',
|
||||||
|
'nix',
|
||||||
|
]
|
||||||
|
|
||||||
|
foreach page : nix3_manpages
|
||||||
|
section = '1'
|
||||||
|
custom_target(
|
||||||
|
command : [
|
||||||
|
bash,
|
||||||
|
'@INPUT0@',
|
||||||
|
page,
|
||||||
|
section,
|
||||||
|
'@INPUT1@/command-ref/new-cli/@0@.md'.format(page),
|
||||||
|
'@OUTPUT@',
|
||||||
|
],
|
||||||
|
input : [
|
||||||
|
files('./render-manpage.sh'),
|
||||||
|
manual_md,
|
||||||
|
nix_input,
|
||||||
|
],
|
||||||
|
output : page + '.1',
|
||||||
|
install : true,
|
||||||
|
install_dir : get_option('mandir') / 'man1',
|
||||||
|
)
|
||||||
|
endforeach
|
||||||
|
|
||||||
|
nix_manpages = [
|
||||||
|
[ '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, conf_file_md.full_path() ],
|
||||||
|
[ 'nix-daemon', 8 ],
|
||||||
|
[ 'nix-profiles', 5, 'files/profiles.md' ],
|
||||||
|
]
|
||||||
|
|
||||||
|
foreach entry : nix_manpages
|
||||||
|
title = entry[0]
|
||||||
|
# nix.conf.5 and nix-profiles.5 are based off of conf-file.md and files/profiles.md,
|
||||||
|
# rather than a stem identical to its mdbook source.
|
||||||
|
# Therefore we use an optional third element of this array to override the name pattern
|
||||||
|
md_file = entry.get(2, title + '.md')
|
||||||
|
section = entry[1].to_string()
|
||||||
|
md_file_resolved = join_paths('@INPUT1@/command-ref/', md_file)
|
||||||
|
custom_target(
|
||||||
|
command : [
|
||||||
|
bash,
|
||||||
|
'@INPUT0@',
|
||||||
|
title,
|
||||||
|
section,
|
||||||
|
md_file_resolved,
|
||||||
|
'@OUTPUT@',
|
||||||
|
],
|
||||||
|
input : [
|
||||||
|
files('./render-manpage.sh'),
|
||||||
|
manual_md,
|
||||||
|
entry.get(3, []),
|
||||||
|
nix_input,
|
||||||
|
],
|
||||||
|
output : '@0@.@1@'.format(entry[0], entry[1]),
|
||||||
|
install : true,
|
||||||
|
install_dir : get_option('mandir') / 'man@0@'.format(entry[1]),
|
||||||
|
)
|
||||||
|
endforeach
|
75
doc/manual/package.nix
Normal file
75
doc/manual/package.nix
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
mkMesonDerivation,
|
||||||
|
|
||||||
|
meson,
|
||||||
|
ninja,
|
||||||
|
lowdown-unsandboxed,
|
||||||
|
mdbook,
|
||||||
|
mdbook-linkcheck,
|
||||||
|
jq,
|
||||||
|
python3,
|
||||||
|
rsync,
|
||||||
|
nix-cli,
|
||||||
|
|
||||||
|
# Configuration Options
|
||||||
|
|
||||||
|
version,
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) fileset;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkMesonDerivation (finalAttrs: {
|
||||||
|
pname = "nix-manual";
|
||||||
|
inherit version;
|
||||||
|
|
||||||
|
workDir = ./.;
|
||||||
|
fileset =
|
||||||
|
fileset.difference
|
||||||
|
(fileset.unions [
|
||||||
|
../../.version
|
||||||
|
# Too many different types of files to filter for now
|
||||||
|
../../doc/manual
|
||||||
|
./.
|
||||||
|
])
|
||||||
|
# Do a blacklist instead
|
||||||
|
../../doc/manual/package.nix;
|
||||||
|
|
||||||
|
# TODO the man pages should probably be separate
|
||||||
|
outputs = [
|
||||||
|
"out"
|
||||||
|
"man"
|
||||||
|
];
|
||||||
|
|
||||||
|
# Hack for sake of the dev shell
|
||||||
|
passthru.externalNativeBuildInputs = [
|
||||||
|
meson
|
||||||
|
ninja
|
||||||
|
(lib.getBin lowdown-unsandboxed)
|
||||||
|
mdbook
|
||||||
|
mdbook-linkcheck
|
||||||
|
jq
|
||||||
|
python3
|
||||||
|
rsync
|
||||||
|
];
|
||||||
|
|
||||||
|
nativeBuildInputs = finalAttrs.passthru.externalNativeBuildInputs ++ [
|
||||||
|
nix-cli
|
||||||
|
];
|
||||||
|
|
||||||
|
preConfigure = ''
|
||||||
|
chmod u+w ./.version
|
||||||
|
echo ${finalAttrs.version} > ./.version
|
||||||
|
'';
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
mkdir -p ''$out/nix-support
|
||||||
|
echo "doc manual ''$out/share/doc/nix/manual" >> ''$out/nix-support/hydra-build-products
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
platforms = lib.platforms.all;
|
||||||
|
};
|
||||||
|
})
|
|
@ -1,7 +1,7 @@
|
||||||
// redirect rules for URL fragments (client-side) to prevent link rot.
|
// redirect rules for URL fragments (client-side) to prevent link rot.
|
||||||
// this must be done on the client side, as web servers do not see the fragment part of the URL.
|
// this must be done on the client side, as web servers do not see the fragment part of the URL.
|
||||||
// it will only work with JavaScript enabled in the browser, but this is the best we can do here.
|
// it will only work with JavaScript enabled in the browser, but this is the best we can do here.
|
||||||
// see src/_redirects for path redirects (server-side)
|
// see source/_redirects for path redirects (server-side)
|
||||||
|
|
||||||
// redirects are declared as follows:
|
// redirects are declared as follows:
|
||||||
// each entry has as its key a path matching the requested URL path, relative to the mdBook document root.
|
// each entry has as its key a path matching the requested URL path, relative to the mdBook document root.
|
||||||
|
@ -344,6 +344,7 @@ const redirects = {
|
||||||
},
|
},
|
||||||
"language/syntax.html": {
|
"language/syntax.html": {
|
||||||
"scoping-rules": "scoping.html",
|
"scoping-rules": "scoping.html",
|
||||||
|
"string-literal": "string-literals.html",
|
||||||
},
|
},
|
||||||
"installation/installing-binary.html": {
|
"installation/installing-binary.html": {
|
||||||
"linux": "uninstall.html#linux",
|
"linux": "uninstall.html#linux",
|
||||||
|
|
33
doc/manual/remove_before_wrapper.py
Normal file
33
doc/manual/remove_before_wrapper.py
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import os
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
import shutil
|
||||||
|
import typing as t
|
||||||
|
|
||||||
|
def main():
|
||||||
|
if len(sys.argv) < 4 or '--' not in sys.argv:
|
||||||
|
print("Usage: remove-before-wrapper <output> -- <nix command...>")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
# Extract the parts
|
||||||
|
output: str = sys.argv[1]
|
||||||
|
nix_command_idx: int = sys.argv.index('--') + 1
|
||||||
|
nix_command: t.List[str] = sys.argv[nix_command_idx:]
|
||||||
|
|
||||||
|
output_temp: str = output + '.tmp'
|
||||||
|
|
||||||
|
# Remove the output and temp output in case they exist
|
||||||
|
shutil.rmtree(output, ignore_errors=True)
|
||||||
|
shutil.rmtree(output_temp, ignore_errors=True)
|
||||||
|
|
||||||
|
# Execute nix command with `--write-to` tempary output
|
||||||
|
nix_command_write_to = nix_command + ['--write-to', output_temp]
|
||||||
|
subprocess.run(nix_command_write_to, check=True)
|
||||||
|
|
||||||
|
# Move the temporary output to the intended location
|
||||||
|
os.rename(output_temp, output)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
25
doc/manual/render-manpage.sh
Executable file
25
doc/manual/render-manpage.sh
Executable file
|
@ -0,0 +1,25 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
lowdown_args=
|
||||||
|
|
||||||
|
if [ "$1" = --out-no-smarty ]; then
|
||||||
|
lowdown_args=--out-no-smarty
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
|
||||||
|
[ "$#" = 4 ] || {
|
||||||
|
echo "wrong number of args passed" >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
title="$1"
|
||||||
|
section="$2"
|
||||||
|
infile="$3"
|
||||||
|
outfile="$4"
|
||||||
|
|
||||||
|
(
|
||||||
|
printf "Title: %s\n\n" "$title"
|
||||||
|
cat "$infile"
|
||||||
|
) | lowdown -sT man --nroff-nolinks $lowdown_args -M section="$section" -o "$outfile"
|
|
@ -28,6 +28,8 @@
|
||||||
- [Data Types](language/types.md)
|
- [Data Types](language/types.md)
|
||||||
- [String context](language/string-context.md)
|
- [String context](language/string-context.md)
|
||||||
- [Syntax and semantics](language/syntax.md)
|
- [Syntax and semantics](language/syntax.md)
|
||||||
|
- [Variables](language/variables.md)
|
||||||
|
- [String literals](language/string-literals.md)
|
||||||
- [Identifiers](language/identifiers.md)
|
- [Identifiers](language/identifiers.md)
|
||||||
- [Scoping rules](language/scope.md)
|
- [Scoping rules](language/scope.md)
|
||||||
- [String interpolation](language/string-interpolation.md)
|
- [String interpolation](language/string-interpolation.md)
|
||||||
|
@ -119,6 +121,7 @@
|
||||||
- [Development](development/index.md)
|
- [Development](development/index.md)
|
||||||
- [Building](development/building.md)
|
- [Building](development/building.md)
|
||||||
- [Testing](development/testing.md)
|
- [Testing](development/testing.md)
|
||||||
|
- [Debugging](development/debugging.md)
|
||||||
- [Documentation](development/documentation.md)
|
- [Documentation](development/documentation.md)
|
||||||
- [CLI guideline](development/cli-guideline.md)
|
- [CLI guideline](development/cli-guideline.md)
|
||||||
- [JSON guideline](development/json-guideline.md)
|
- [JSON guideline](development/json-guideline.md)
|
||||||
|
@ -130,6 +133,8 @@
|
||||||
- [Release 1.0 (2024-11-??)](release-notes-determinate/rl-1.0.md)
|
- [Release 1.0 (2024-11-??)](release-notes-determinate/rl-1.0.md)
|
||||||
- [Nix Releases Notes](release-notes/index.md)
|
- [Nix Releases Notes](release-notes/index.md)
|
||||||
{{#include ./SUMMARY-rl-next.md}}
|
{{#include ./SUMMARY-rl-next.md}}
|
||||||
|
- [Release 2.26 (2025-01-22)](release-notes/rl-2.26.md)
|
||||||
|
- [Release 2.25 (2024-11-07)](release-notes/rl-2.25.md)
|
||||||
- [Release 2.24 (2024-07-31)](release-notes/rl-2.24.md)
|
- [Release 2.24 (2024-07-31)](release-notes/rl-2.24.md)
|
||||||
- [Release 2.23 (2024-06-03)](release-notes/rl-2.23.md)
|
- [Release 2.23 (2024-06-03)](release-notes/rl-2.23.md)
|
||||||
- [Release 2.22 (2024-04-23)](release-notes/rl-2.22.md)
|
- [Release 2.22 (2024-04-23)](release-notes/rl-2.22.md)
|
108
doc/manual/source/advanced-topics/distributed-builds.md
Normal file
108
doc/manual/source/advanced-topics/distributed-builds.md
Normal file
|
@ -0,0 +1,108 @@
|
||||||
|
# Remote Builds
|
||||||
|
|
||||||
|
A local Nix installation can forward Nix builds to other machines,
|
||||||
|
this allows multiple builds to be performed in parallel.
|
||||||
|
|
||||||
|
Remote builds also allow Nix to perform multi-platform builds in a
|
||||||
|
semi-transparent way. For example, if you perform a build for a
|
||||||
|
`x86_64-darwin` on an `i686-linux` machine, Nix can automatically
|
||||||
|
forward the build to a `x86_64-darwin` machine, if one is available.
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
For a local machine to forward a build to a remote machine, the remote machine must:
|
||||||
|
|
||||||
|
- Have Nix installed
|
||||||
|
- Be running an SSH server, e.g. `sshd`
|
||||||
|
- Be accessible via SSH from the local machine over the network
|
||||||
|
- Have the local machine's public SSH key in `/etc/ssh/authorized_keys.d/<username>`
|
||||||
|
- Have the username of the SSH user in the `trusted-users` setting in `nix.conf`
|
||||||
|
|
||||||
|
## Testing
|
||||||
|
|
||||||
|
To test connecting to a remote Nix instance (in this case `mac`), run:
|
||||||
|
|
||||||
|
```console
|
||||||
|
nix store info --store ssh://username@mac
|
||||||
|
```
|
||||||
|
|
||||||
|
To specify an SSH identity file as part of the remote store URI add a
|
||||||
|
query paramater, e.g.
|
||||||
|
|
||||||
|
```console
|
||||||
|
nix store info --store ssh://username@mac?ssh-key=/home/alice/my-key
|
||||||
|
```
|
||||||
|
|
||||||
|
Since builds should be non-interactive, the key should not have a
|
||||||
|
passphrase. Alternatively, you can load identities ahead of time into
|
||||||
|
`ssh-agent` or `gpg-agent`.
|
||||||
|
|
||||||
|
In a multi-user installation (default), builds are executed by the Nix
|
||||||
|
Daemon. The Nix Daemon cannot prompt for a passphrase via the terminal
|
||||||
|
or `ssh-agent`, so the SSH key must not have a passphrase.
|
||||||
|
|
||||||
|
In addition, the Nix Daemon's user (typically root) needs to have SSH
|
||||||
|
access to the remote builder.
|
||||||
|
|
||||||
|
Access can be verified by running `sudo su`, and then validating SSH
|
||||||
|
access, e.g. by running `ssh mac`. SSH identity files for root users
|
||||||
|
are usually stored in `/root/.ssh/` (Linux) or `/var/root/.ssh` (MacOS).
|
||||||
|
|
||||||
|
If you get the error
|
||||||
|
|
||||||
|
```console
|
||||||
|
bash: nix: command not found
|
||||||
|
error: cannot connect to 'mac'
|
||||||
|
```
|
||||||
|
|
||||||
|
then you need to ensure that the `PATH` of non-interactive login shells
|
||||||
|
contains Nix.
|
||||||
|
|
||||||
|
The [list of remote build machines](@docroot@/command-ref/conf-file.md#conf-builders) can be specified on the command line or in the Nix configuration file.
|
||||||
|
For example, the following command allows you to build a derivation for `x86_64-darwin` on a Linux machine:
|
||||||
|
|
||||||
|
```console
|
||||||
|
uname
|
||||||
|
```
|
||||||
|
|
||||||
|
```console
|
||||||
|
Linux
|
||||||
|
```
|
||||||
|
|
||||||
|
```console
|
||||||
|
nix build --impure \
|
||||||
|
--expr '(with import <nixpkgs> { system = "x86_64-darwin"; }; runCommand "foo" {} "uname > $out")' \
|
||||||
|
--builders 'ssh://mac x86_64-darwin'
|
||||||
|
```
|
||||||
|
|
||||||
|
```console
|
||||||
|
[1/0/1 built, 0.0 MiB DL] building foo on ssh://mac
|
||||||
|
```
|
||||||
|
|
||||||
|
```console
|
||||||
|
cat ./result
|
||||||
|
```
|
||||||
|
|
||||||
|
```console
|
||||||
|
Darwin
|
||||||
|
```
|
||||||
|
|
||||||
|
It is possible to specify multiple build machines separated by a semicolon or a newline, e.g.
|
||||||
|
|
||||||
|
```console
|
||||||
|
--builders 'ssh://mac x86_64-darwin ; ssh://beastie x86_64-freebsd'
|
||||||
|
```
|
||||||
|
|
||||||
|
Remote build machines can also be configured in [`nix.conf`](@docroot@/command-ref/conf-file.md), e.g.
|
||||||
|
|
||||||
|
builders = ssh://mac x86_64-darwin ; ssh://beastie x86_64-freebsd
|
||||||
|
|
||||||
|
After making changes to `nix.conf`, restart the Nix daemon for changes to take effect.
|
||||||
|
|
||||||
|
Finally, remote build machines can be configured in a separate configuration
|
||||||
|
file included in `builders` via the syntax `@/path/to/file`. For example,
|
||||||
|
|
||||||
|
builders = @/etc/nix/machines
|
||||||
|
|
||||||
|
causes the list of machines in `/etc/nix/machines` to be included.
|
||||||
|
(This is the default.)
|
|
@ -138,6 +138,19 @@ The following environment variables are used to determine locations of various s
|
||||||
- [`XDG_STATE_HOME`]{#env-XDG_STATE_HOME} (default `~/.local/state`)
|
- [`XDG_STATE_HOME`]{#env-XDG_STATE_HOME} (default `~/.local/state`)
|
||||||
- [`XDG_CACHE_HOME`]{#env-XDG_CACHE_HOME} (default `~/.cache`)
|
- [`XDG_CACHE_HOME`]{#env-XDG_CACHE_HOME} (default `~/.cache`)
|
||||||
|
|
||||||
|
|
||||||
[XDG Base Directory Specification]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
[XDG Base Directory Specification]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||||
[`use-xdg-base-directories`]: @docroot@/command-ref/conf-file.md#conf-use-xdg-base-directories
|
[`use-xdg-base-directories`]: @docroot@/command-ref/conf-file.md#conf-use-xdg-base-directories
|
||||||
|
|
||||||
|
In addition, setting the following environment variables overrides the XDG base directories:
|
||||||
|
|
||||||
|
- [`NIX_CONFIG_HOME`]{#env-NIX_CONFIG_HOME} (default `$XDG_CONFIG_HOME/nix`)
|
||||||
|
- [`NIX_STATE_HOME`]{#env-NIX_STATE_HOME} (default `$XDG_STATE_HOME/nix`)
|
||||||
|
- [`NIX_CACHE_HOME`]{#env-NIX_CACHE_HOME} (default `$XDG_CACHE_HOME/nix`)
|
||||||
|
|
||||||
|
When [`use-xdg-base-directories`] is enabled, the configuration directory is:
|
||||||
|
|
||||||
|
1. `$NIX_CONFIG_HOME`, if it is defined
|
||||||
|
2. Otherwise, `$XDG_CONFIG_HOME/nix`, if `XDG_CONFIG_HOME` is defined
|
||||||
|
3. Otherwise, `~/.config/nix`.
|
||||||
|
|
||||||
|
Likewise for the state and cache directories.
|
|
@ -1,6 +1,6 @@
|
||||||
## Default Nix expression
|
## Default Nix expression
|
||||||
|
|
||||||
The source for the default [Nix expressions](@docroot@/language/index.md) used by [`nix-env`]:
|
The source for the [Nix expressions](@docroot@/glossary.md#gloss-nix-expression) used by [`nix-env`] by default:
|
||||||
|
|
||||||
- `~/.nix-defexpr`
|
- `~/.nix-defexpr`
|
||||||
- `$XDG_STATE_HOME/nix/defexpr` if [`use-xdg-base-directories`] is set to `true`.
|
- `$XDG_STATE_HOME/nix/defexpr` if [`use-xdg-base-directories`] is set to `true`.
|
||||||
|
@ -18,24 +18,25 @@ Then, the resulting expression is interpreted like this:
|
||||||
- If the expression is an attribute set, it is used as the default Nix expression.
|
- If the expression is an attribute set, it is used as the default Nix expression.
|
||||||
- If the expression is a function, an empty set is passed as argument and the return value is used as the default Nix expression.
|
- If the expression is a function, an empty set is passed as argument and the return value is used as the default Nix expression.
|
||||||
|
|
||||||
|
> **Example**
|
||||||
For example, if the default expression contains two files, `foo.nix` and `bar.nix`, then the default Nix expression will be equivalent to
|
>
|
||||||
|
> If the default expression contains two files, `foo.nix` and `bar.nix`, then the default Nix expression will be equivalent to
|
||||||
```nix
|
>
|
||||||
{
|
> ```nix
|
||||||
foo = import ~/.nix-defexpr/foo.nix;
|
> {
|
||||||
bar = import ~/.nix-defexpr/bar.nix;
|
> foo = import ~/.nix-defexpr/foo.nix;
|
||||||
}
|
> bar = import ~/.nix-defexpr/bar.nix;
|
||||||
```
|
> }
|
||||||
|
> ```
|
||||||
|
|
||||||
The file [`manifest.nix`](@docroot@/command-ref/files/manifest.nix.md) is always ignored.
|
The file [`manifest.nix`](@docroot@/command-ref/files/manifest.nix.md) is always ignored.
|
||||||
|
|
||||||
The command [`nix-channel`] places a symlink to the user's current [channels profile](@docroot@/command-ref/files/channels.md) in this directory.
|
The command [`nix-channel`] places a symlink to the current user's [channels] in this directory, the [user channel link](#user-channel-link).
|
||||||
This makes all subscribed channels available as attributes in the default expression.
|
This makes all subscribed channels available as attributes in the default expression.
|
||||||
|
|
||||||
## User channel link
|
## User channel link
|
||||||
|
|
||||||
A symlink that ensures that [`nix-env`] can find your channels:
|
A symlink that ensures that [`nix-env`] can find the current user's [channels]:
|
||||||
|
|
||||||
- `~/.nix-defexpr/channels`
|
- `~/.nix-defexpr/channels`
|
||||||
- `$XDG_STATE_HOME/defexpr/channels` if [`use-xdg-base-directories`] is set to `true`.
|
- `$XDG_STATE_HOME/defexpr/channels` if [`use-xdg-base-directories`] is set to `true`.
|
||||||
|
@ -45,8 +46,9 @@ This symlink points to:
|
||||||
- `$XDG_STATE_HOME/profiles/channels` for regular users
|
- `$XDG_STATE_HOME/profiles/channels` for regular users
|
||||||
- `$NIX_STATE_DIR/profiles/per-user/root/channels` for `root`
|
- `$NIX_STATE_DIR/profiles/per-user/root/channels` for `root`
|
||||||
|
|
||||||
In a multi-user installation, you may also have `~/.nix-defexpr/channels_root`, which links to the channels of the root user.[`nix-env`]: ../nix-env.md
|
In a multi-user installation, you may also have `~/.nix-defexpr/channels_root`, which links to the channels of the root user.
|
||||||
|
|
||||||
[`nix-env`]: @docroot@/command-ref/nix-env.md
|
|
||||||
[`nix-channel`]: @docroot@/command-ref/nix-channel.md
|
[`nix-channel`]: @docroot@/command-ref/nix-channel.md
|
||||||
|
[`nix-env`]: @docroot@/command-ref/nix-env.md
|
||||||
[`use-xdg-base-directories`]: @docroot@/command-ref/conf-file.md#conf-use-xdg-base-directories
|
[`use-xdg-base-directories`]: @docroot@/command-ref/conf-file.md#conf-use-xdg-base-directories
|
||||||
|
[channels]: @docroot@/command-ref/files/channels.md
|
63
doc/manual/source/command-ref/meson.build
Normal file
63
doc/manual/source/command-ref/meson.build
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
xp_features_json = custom_target(
|
||||||
|
command : [nix, '__dump-xp-features'],
|
||||||
|
capture : true,
|
||||||
|
output : 'xp-features.json',
|
||||||
|
)
|
||||||
|
|
||||||
|
experimental_features_shortlist_md = custom_target(
|
||||||
|
command : nix_eval_for_docs + [
|
||||||
|
'--expr',
|
||||||
|
'import @INPUT0@ (builtins.fromJSON (builtins.readFile ./@INPUT1@))',
|
||||||
|
],
|
||||||
|
input : [
|
||||||
|
'../../generate-xp-features-shortlist.nix',
|
||||||
|
xp_features_json,
|
||||||
|
],
|
||||||
|
output : 'experimental-features-shortlist.md',
|
||||||
|
capture : true,
|
||||||
|
env : nix_env_for_docs,
|
||||||
|
)
|
||||||
|
|
||||||
|
nix3_cli_files = custom_target(
|
||||||
|
command : [
|
||||||
|
python.full_path(),
|
||||||
|
'@INPUT0@',
|
||||||
|
'@OUTPUT@',
|
||||||
|
'--'
|
||||||
|
] + nix_eval_for_docs + [
|
||||||
|
'--expr',
|
||||||
|
'import @INPUT1@ true (builtins.readFile ./@INPUT2@)',
|
||||||
|
],
|
||||||
|
input : [
|
||||||
|
'../../remove_before_wrapper.py',
|
||||||
|
'../../generate-manpage.nix',
|
||||||
|
nix3_cli_json,
|
||||||
|
],
|
||||||
|
output : 'new-cli',
|
||||||
|
env : nix_env_for_docs,
|
||||||
|
)
|
||||||
|
|
||||||
|
conf_file_md_body = custom_target(
|
||||||
|
command : [
|
||||||
|
nix_eval_for_docs,
|
||||||
|
'--expr',
|
||||||
|
'import @INPUT0@ { prefix = "conf"; } (builtins.fromJSON (builtins.readFile ./@INPUT1@))',
|
||||||
|
],
|
||||||
|
capture : true,
|
||||||
|
input : [
|
||||||
|
'../../generate-settings.nix',
|
||||||
|
conf_file_json,
|
||||||
|
],
|
||||||
|
output : 'conf-file.body.md',
|
||||||
|
env : nix_env_for_docs,
|
||||||
|
)
|
||||||
|
|
||||||
|
conf_file_md = custom_target(
|
||||||
|
command : [ 'cat', '@INPUT0@', '@INPUT1@' ],
|
||||||
|
capture : true,
|
||||||
|
input : [
|
||||||
|
'conf-file-prefix.md',
|
||||||
|
conf_file_md_body,
|
||||||
|
],
|
||||||
|
output : 'conf-file.md',
|
||||||
|
)
|
|
@ -36,7 +36,7 @@ Instead, it looks in a few locations, and acts on all profiles it finds there:
|
||||||
>
|
>
|
||||||
> Not stable; subject to change
|
> Not stable; subject to change
|
||||||
>
|
>
|
||||||
> Do not rely on this functionality; it just exists for migration purposes and is may change in the future.
|
> Do not rely on this functionality; it just exists for migration purposes and may change in the future.
|
||||||
> These deprecated paths remain a private implementation detail of Nix.
|
> These deprecated paths remain a private implementation detail of Nix.
|
||||||
|
|
||||||
`$NIX_STATE_DIR/profiles` and `$NIX_STATE_DIR/profiles/per-user`.
|
`$NIX_STATE_DIR/profiles` and `$NIX_STATE_DIR/profiles/per-user`.
|
||||||
|
@ -62,6 +62,15 @@ These options are for deleting old [profiles] prior to deleting unreachable [sto
|
||||||
This is the equivalent of invoking [`nix-env --delete-generations <period>`](@docroot@/command-ref/nix-env/delete-generations.md#generations-time) on each found profile.
|
This is the equivalent of invoking [`nix-env --delete-generations <period>`](@docroot@/command-ref/nix-env/delete-generations.md#generations-time) on each found profile.
|
||||||
See the documentation of that command for additional information about the *period* argument.
|
See the documentation of that command for additional information about the *period* argument.
|
||||||
|
|
||||||
|
- <span id="opt-max-freed">[`--max-freed`](#opt-max-freed)</span> *bytes*
|
||||||
|
|
||||||
|
<!-- duplication from https://github.com/NixOS/nix/blob/442a2623e48357ff72c77bb11cf2cf06d94d2f90/doc/manual/source/command-ref/nix-store/gc.md?plain=1#L39-L44 -->
|
||||||
|
|
||||||
|
Keep deleting paths until at least *bytes* bytes have been deleted,
|
||||||
|
then stop. The argument *bytes* can be followed by the
|
||||||
|
multiplicative suffix `K`, `M`, `G` or `T`, denoting KiB, MiB, GiB
|
||||||
|
or TiB units.
|
||||||
|
|
||||||
{{#include ./opt-common.md}}
|
{{#include ./opt-common.md}}
|
||||||
|
|
||||||
{{#include ./env-common.md}}
|
{{#include ./env-common.md}}
|
|
@ -84,7 +84,7 @@ When using public key authentication, you can avoid typing the passphrase with `
|
||||||
> Copy GNU Hello from a remote machine using a known store path, and run it:
|
> Copy GNU Hello from a remote machine using a known store path, and run it:
|
||||||
>
|
>
|
||||||
> ```shell-session
|
> ```shell-session
|
||||||
> $ storePath="$(nix-instantiate --eval '<nixpkgs>' -I nixpkgs=channel:nixpkgs-unstable -A hello.outPath | tr -d '"')"
|
> $ storePath="$(nix-instantiate --eval --raw '<nixpkgs>' -I nixpkgs=channel:nixpkgs-unstable -A hello.outPath)"
|
||||||
> $ nix-copy-closure --from alice@itchy.example.org "$storePath"
|
> $ nix-copy-closure --from alice@itchy.example.org "$storePath"
|
||||||
> $ "$storePath"/bin/hello
|
> $ "$storePath"/bin/hello
|
||||||
> Hello, world!
|
> Hello, world!
|
|
@ -62,7 +62,7 @@ These pages can be viewed offline:
|
||||||
|
|
||||||
Several operations, such as [`nix-env --query`](./nix-env/query.md) and [`nix-env --install`](./nix-env/install.md), take a list of *arguments* that specify the packages on which to operate.
|
Several operations, such as [`nix-env --query`](./nix-env/query.md) and [`nix-env --install`](./nix-env/install.md), take a list of *arguments* that specify the packages on which to operate.
|
||||||
|
|
||||||
Packages are identified based on a `name` part and a `version` part of a [symbolic derivation name](@docroot@/language/derivations.md#attr-names):
|
Packages are identified based on a `name` part and a `version` part of a [symbolic derivation name](@docroot@/language/derivations.md#attr-name):
|
||||||
|
|
||||||
- `name`: Everything up to but not including the first dash (`-`) that is *not* followed by a letter.
|
- `name`: Everything up to but not including the first dash (`-`) that is *not* followed by a letter.
|
||||||
- `version`: The rest, excluding the separating dash.
|
- `version`: The rest, excluding the separating dash.
|
|
@ -11,6 +11,7 @@
|
||||||
[`--from-profile` *path*]
|
[`--from-profile` *path*]
|
||||||
[`--preserve-installed` | `-P`]
|
[`--preserve-installed` | `-P`]
|
||||||
[`--remove-all` | `-r`]
|
[`--remove-all` | `-r`]
|
||||||
|
[`--priority` *priority*]
|
||||||
|
|
||||||
# Description
|
# Description
|
||||||
|
|
||||||
|
@ -61,6 +62,10 @@ The arguments *args* map to store paths in a number of possible ways:
|
||||||
The derivations returned by those function calls are installed.
|
The derivations returned by those function calls are installed.
|
||||||
This allows derivations to be specified in an unambiguous way, which is necessary if there are multiple derivations with the same name.
|
This allows derivations to be specified in an unambiguous way, which is necessary if there are multiple derivations with the same name.
|
||||||
|
|
||||||
|
- If `--priority` *priority* is given, the priority of the derivations being installed is set to *priority*.
|
||||||
|
This can be used to override the priority of the derivations being installed.
|
||||||
|
This is useful if *args* are [store paths], which don't have any priority information.
|
||||||
|
|
||||||
- If *args* are [store derivations](@docroot@/glossary.md#gloss-store-derivation), then these are [realised], and the resulting output paths are installed.
|
- If *args* are [store derivations](@docroot@/glossary.md#gloss-store-derivation), then these are [realised], and the resulting output paths are installed.
|
||||||
|
|
||||||
- If *args* are [store paths] that are not store derivations, then these are [realised] and installed.
|
- If *args* are [store paths] that are not store derivations, then these are [realised] and installed.
|
||||||
|
@ -235,4 +240,3 @@ channel:
|
||||||
```console
|
```console
|
||||||
$ nix-env --file https://github.com/NixOS/nixpkgs/archive/nixos-14.12.tar.gz --install --attr firefox
|
$ nix-env --file https://github.com/NixOS/nixpkgs/archive/nixos-14.12.tar.gz --install --attr firefox
|
||||||
```
|
```
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
# Synopsis
|
# Synopsis
|
||||||
|
|
||||||
`nix-instantiate`
|
`nix-instantiate`
|
||||||
[`--parse` | `--eval` [`--strict`] [`--json`] [`--xml`] ]
|
[`--parse` | `--eval` [`--strict`] [`--raw` | `--json` | `--xml`] ]
|
||||||
[`--read-write-mode`]
|
[`--read-write-mode`]
|
||||||
[`--arg` *name* *value*]
|
[`--arg` *name* *value*]
|
||||||
[{`--attr`| `-A`} *attrPath*]
|
[{`--attr`| `-A`} *attrPath*]
|
||||||
|
@ -102,6 +102,11 @@ standard input.
|
||||||
> This option can cause non-termination, because lazy data
|
> This option can cause non-termination, because lazy data
|
||||||
> structures can be infinitely large.
|
> structures can be infinitely large.
|
||||||
|
|
||||||
|
- `--raw`
|
||||||
|
|
||||||
|
When used with `--eval`, the evaluation result must be a string,
|
||||||
|
which is printed verbatim, without quoting, escaping or trailing newline.
|
||||||
|
|
||||||
- `--json`
|
- `--json`
|
||||||
|
|
||||||
When used with `--eval`, print the resulting value as an JSON
|
When used with `--eval`, print the resulting value as an JSON
|
|
@ -88,7 +88,9 @@ All options not listed here are passed to `nix-store
|
||||||
cleared before the interactive shell is started, so you get an
|
cleared before the interactive shell is started, so you get an
|
||||||
environment that more closely corresponds to the “real” Nix build. A
|
environment that more closely corresponds to the “real” Nix build. A
|
||||||
few variables, in particular `HOME`, `USER` and `DISPLAY`, are
|
few variables, in particular `HOME`, `USER` and `DISPLAY`, are
|
||||||
retained.
|
retained. Note that the shell used to run commands is obtained from
|
||||||
|
[`NIX_BUILD_SHELL`](#env-NIX_BUILD_SHELL) / `<nixpkgs>` from
|
||||||
|
`NIX_PATH`, and therefore not affected by `--pure`.
|
||||||
|
|
||||||
- `--packages` / `-p` *packages*…
|
- `--packages` / `-p` *packages*…
|
||||||
|
|
||||||
|
@ -112,11 +114,30 @@ All options not listed here are passed to `nix-store
|
||||||
|
|
||||||
# Environment variables
|
# Environment variables
|
||||||
|
|
||||||
- `NIX_BUILD_SHELL`
|
- <span id="env-NIX_BUILD_SHELL">[`NIX_BUILD_SHELL`](#env-NIX_BUILD_SHELL)</span>
|
||||||
|
|
||||||
Shell used to start the interactive environment. Defaults to the
|
Shell used to start the interactive environment.
|
||||||
`bash` found in `<nixpkgs>`, falling back to the `bash` found in
|
Defaults to the `bash` from `bashInteractive` found in `<nixpkgs>`, falling back to the `bash` found in `PATH` if not found.
|
||||||
`PATH` if not found.
|
|
||||||
|
> **Note**
|
||||||
|
>
|
||||||
|
> The shell obtained using this method may not necessarily be the same as any shells requested in *path*.
|
||||||
|
|
||||||
|
<!-- -->
|
||||||
|
|
||||||
|
> **Example
|
||||||
|
>
|
||||||
|
> Despite `--pure`, this invocation will not result in a fully reproducible shell environment:
|
||||||
|
>
|
||||||
|
> ```nix
|
||||||
|
> #!/usr/bin/env -S nix-shell --pure
|
||||||
|
> let
|
||||||
|
> pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/854fdc68881791812eddd33b2fed94b954979a8e.tar.gz") {};
|
||||||
|
> in
|
||||||
|
> pkgs.mkShell {
|
||||||
|
> buildInputs = pkgs.bashInteractive;
|
||||||
|
> }
|
||||||
|
> ```
|
||||||
|
|
||||||
{{#include ./env-common.md}}
|
{{#include ./env-common.md}}
|
||||||
|
|
|
@ -21,6 +21,9 @@ This operation has the following options:
|
||||||
Use recursive instead of flat hashing mode, used when adding
|
Use recursive instead of flat hashing mode, used when adding
|
||||||
directories to the store.
|
directories to the store.
|
||||||
|
|
||||||
|
*paths* that refer to symlinks are not dereferenced, but added to the store
|
||||||
|
as symlinks with the same target.
|
||||||
|
|
||||||
{{#include ./opt-common.md}}
|
{{#include ./opt-common.md}}
|
||||||
|
|
||||||
{{#include ../opt-common.md}}
|
{{#include ../opt-common.md}}
|
|
@ -11,6 +11,9 @@
|
||||||
The operation `--add` adds the specified paths to the Nix store. It
|
The operation `--add` adds the specified paths to the Nix store. It
|
||||||
prints the resulting paths in the Nix store on standard output.
|
prints the resulting paths in the Nix store on standard output.
|
||||||
|
|
||||||
|
*paths* that refer to symlinks are not dereferenced, but added to the store
|
||||||
|
as symlinks with the same target.
|
||||||
|
|
||||||
{{#include ./opt-common.md}}
|
{{#include ./opt-common.md}}
|
||||||
|
|
||||||
{{#include ../opt-common.md}}
|
{{#include ../opt-common.md}}
|
|
@ -104,7 +104,7 @@ symlink.
|
||||||
|
|
||||||
Prints a set of derivation files (`.drv`) which are supposed produce
|
Prints a set of derivation files (`.drv`) which are supposed produce
|
||||||
said paths when realized. Might print nothing, for example for source paths
|
said paths when realized. Might print nothing, for example for source paths
|
||||||
or paths subsituted from a binary cache.
|
or paths substituted from a binary cache.
|
||||||
|
|
||||||
- `--graph`
|
- `--graph`
|
||||||
|
|
||||||
|
@ -241,4 +241,3 @@ $ nix-store --query --roots $(which svn)
|
||||||
/nix/var/nix/profiles/default-82-link
|
/nix/var/nix/profiles/default-82-link
|
||||||
/home/eelco/.local/state/nix/profiles/profile-97-link
|
/home/eelco/.local/state/nix/profiles/profile-97-link
|
||||||
```
|
```
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue