diff --git a/third_party/nixpkgs/.github/CODEOWNERS b/third_party/nixpkgs/.github/CODEOWNERS
index ec4222a0d4..a64b6918c4 100644
--- a/third_party/nixpkgs/.github/CODEOWNERS
+++ b/third_party/nixpkgs/.github/CODEOWNERS
@@ -19,7 +19,7 @@
# Libraries
/lib @edolstra @nbp @infinisil
-/lib/systems @nbp @ericson2314 @matthewbauer
+/lib/systems @alyssais @nbp @ericson2314 @matthewbauer
/lib/generators.nix @edolstra @nbp @Profpatsch
/lib/cli.nix @edolstra @nbp @Profpatsch
/lib/debug.nix @edolstra @nbp @Profpatsch
@@ -42,6 +42,12 @@
# Nixpkgs build-support
/pkgs/build-support/writers @lassulus @Profpatsch
+# Nixpkgs documentation
+/maintainers/scripts/db-to-md.sh @jtojnar @ryantm
+/maintainers/scripts/doc @jtojnar @ryantm
+/doc/build-aux/pandoc-filters @jtojnar
+/doc/contributing/contributing-to-documentation.chapter.md @jtojnar
+
# NixOS Internals
/nixos/default.nix @nbp @infinisil
/nixos/lib/from-env.nix @nbp @infinisil
@@ -104,7 +110,7 @@
# Rust
/pkgs/development/compilers/rust @Mic92 @LnL7 @zowoq
-/pkgs/build-support/rust @andir @danieldk @zowoq
+/pkgs/build-support/rust @andir @zowoq
# Darwin-related
/pkgs/stdenv/darwin @NixOS/darwin-maintainers
diff --git a/third_party/nixpkgs/.github/workflows/basic-eval.yml b/third_party/nixpkgs/.github/workflows/basic-eval.yml
index 3d12eda314..b7bbbd40b4 100644
--- a/third_party/nixpkgs/.github/workflows/basic-eval.yml
+++ b/third_party/nixpkgs/.github/workflows/basic-eval.yml
@@ -15,6 +15,6 @@ jobs:
# we don't limit this action to only NixOS repo since the checks are cheap and useful developer feedback
steps:
- uses: actions/checkout@v2
- - uses: cachix/install-nix-action@v13
+ - uses: cachix/install-nix-action@v14
# explicit list of supportedSystems is needed until aarch64-darwin becomes part of the trunk jobset
- run: nix-build pkgs/top-level/release.nix -A tarball.nixpkgs-basic-release-checks --arg supportedSystems '[ "aarch64-darwin" "aarch64-linux" "x86_64-linux" "x86_64-darwin" ]'
diff --git a/third_party/nixpkgs/.github/workflows/editorconfig.yml b/third_party/nixpkgs/.github/workflows/editorconfig.yml
index 4960e9fd3d..1934a24c65 100644
--- a/third_party/nixpkgs/.github/workflows/editorconfig.yml
+++ b/third_party/nixpkgs/.github/workflows/editorconfig.yml
@@ -28,7 +28,7 @@ jobs:
# pull_request_target checks out the base branch by default
ref: refs/pull/${{ github.event.pull_request.number }}/merge
if: env.PR_DIFF
- - uses: cachix/install-nix-action@v13
+ - uses: cachix/install-nix-action@v14
if: env.PR_DIFF
with:
# nixpkgs commit is pinned so that it doesn't break
diff --git a/third_party/nixpkgs/.github/workflows/manual-nixos.yml b/third_party/nixpkgs/.github/workflows/manual-nixos.yml
index edd2755302..01bbe1b12b 100644
--- a/third_party/nixpkgs/.github/workflows/manual-nixos.yml
+++ b/third_party/nixpkgs/.github/workflows/manual-nixos.yml
@@ -18,7 +18,7 @@ jobs:
with:
# pull_request_target checks out the base branch by default
ref: refs/pull/${{ github.event.pull_request.number }}/merge
- - uses: cachix/install-nix-action@v13
+ - uses: cachix/install-nix-action@v14
with:
# explicitly enable sandbox
extra_nix_config: sandbox = true
diff --git a/third_party/nixpkgs/.github/workflows/manual-nixpkgs.yml b/third_party/nixpkgs/.github/workflows/manual-nixpkgs.yml
index e27a281a93..d0c3f59591 100644
--- a/third_party/nixpkgs/.github/workflows/manual-nixpkgs.yml
+++ b/third_party/nixpkgs/.github/workflows/manual-nixpkgs.yml
@@ -18,7 +18,7 @@ jobs:
with:
# pull_request_target checks out the base branch by default
ref: refs/pull/${{ github.event.pull_request.number }}/merge
- - uses: cachix/install-nix-action@v13
+ - uses: cachix/install-nix-action@v14
with:
# explicitly enable sandbox
extra_nix_config: sandbox = true
diff --git a/third_party/nixpkgs/.github/workflows/nixos-manual.yml b/third_party/nixpkgs/.github/workflows/nixos-manual.yml
index 2a1c1c2973..70f61a1a3a 100644
--- a/third_party/nixpkgs/.github/workflows/nixos-manual.yml
+++ b/third_party/nixpkgs/.github/workflows/nixos-manual.yml
@@ -19,7 +19,7 @@ jobs:
with:
# pull_request_target checks out the base branch by default
ref: refs/pull/${{ github.event.pull_request.number }}/merge
- - uses: cachix/install-nix-action@v12
+ - uses: cachix/install-nix-action@v14
- name: Check DocBook files generated from Markdown are consistent
run: |
nixos/doc/manual/md-to-db.sh
diff --git a/third_party/nixpkgs/.github/workflows/periodic-merge-24h.yml b/third_party/nixpkgs/.github/workflows/periodic-merge-24h.yml
index 341656d939..81c5694f43 100644
--- a/third_party/nixpkgs/.github/workflows/periodic-merge-24h.yml
+++ b/third_party/nixpkgs/.github/workflows/periodic-merge-24h.yml
@@ -33,7 +33,7 @@ jobs:
- uses: actions/checkout@v2
- name: ${{ matrix.pairs.from }} → ${{ matrix.pairs.into }}
- uses: devmasx/merge-branch@v1.3.1
+ uses: devmasx/merge-branch@1.4.0
with:
type: now
from_branch: ${{ matrix.pairs.from }}
diff --git a/third_party/nixpkgs/.github/workflows/periodic-merge-6h.yml b/third_party/nixpkgs/.github/workflows/periodic-merge-6h.yml
index 8ec4da1d87..68fde857f8 100644
--- a/third_party/nixpkgs/.github/workflows/periodic-merge-6h.yml
+++ b/third_party/nixpkgs/.github/workflows/periodic-merge-6h.yml
@@ -39,7 +39,7 @@ jobs:
- uses: actions/checkout@v2
- name: ${{ matrix.pairs.from }} → ${{ matrix.pairs.into }}
- uses: devmasx/merge-branch@v1.3.1
+ uses: devmasx/merge-branch@1.4.0
with:
type: now
from_branch: ${{ matrix.pairs.from }}
diff --git a/third_party/nixpkgs/.gitignore b/third_party/nixpkgs/.gitignore
index b166a78d7d..1a41704c9b 100644
--- a/third_party/nixpkgs/.gitignore
+++ b/third_party/nixpkgs/.gitignore
@@ -2,6 +2,7 @@
,*
.*.swp
.*.swo
+.idea/
result
result-*
/doc/NEWS.html
diff --git a/third_party/nixpkgs/doc/Makefile b/third_party/nixpkgs/doc/Makefile
index 1d3a0e7ccb..f8d2d7248f 100644
--- a/third_party/nixpkgs/doc/Makefile
+++ b/third_party/nixpkgs/doc/Makefile
@@ -3,12 +3,17 @@ MD_TARGETS=$(addsuffix .xml, $(basename $(shell find . -type f -regex '.*\.md$$'
PANDOC ?= pandoc
pandoc_media_dir = media
-# NOTE: Keep in sync with NixOS manual (/nixos/doc/manual/md-to-db.sh).
+# NOTE: Keep in sync with NixOS manual (/nixos/doc/manual/md-to-db.sh) and conversion script (/maintainers/scripts/db-to-md.sh).
# TODO: Remove raw-attribute when we can get rid of DocBook altogether.
pandoc_commonmark_enabled_extensions = +attributes+fenced_divs+footnotes+bracketed_spans+definition_lists+pipe_tables+raw_attribute
+# Not needed:
+# - docbook-reader/citerefentry-to-rst-role.lua (only relevant for DocBook → MarkDown/rST/MyST)
pandoc_flags = --extract-media=$(pandoc_media_dir) \
--lua-filter=$(PANDOC_LUA_FILTERS_DIR)/diagram-generator.lua \
- --lua-filter=labelless-link-is-xref.lua \
+ --lua-filter=build-aux/pandoc-filters/myst-reader/roles.lua \
+ --lua-filter=build-aux/pandoc-filters/link-unix-man-references.lua \
+ --lua-filter=build-aux/pandoc-filters/docbook-writer/rst-roles.lua \
+ --lua-filter=build-aux/pandoc-filters/docbook-writer/labelless-link-is-xref.lua \
-f commonmark$(pandoc_commonmark_enabled_extensions)+smart
.PHONY: all
diff --git a/third_party/nixpkgs/doc/build-aux/pandoc-filters/docbook-reader/citerefentry-to-rst-role.lua b/third_party/nixpkgs/doc/build-aux/pandoc-filters/docbook-reader/citerefentry-to-rst-role.lua
new file mode 100644
index 0000000000..281e85af27
--- /dev/null
+++ b/third_party/nixpkgs/doc/build-aux/pandoc-filters/docbook-reader/citerefentry-to-rst-role.lua
@@ -0,0 +1,23 @@
+--[[
+Converts Code AST nodes produced by pandoc’s DocBook reader
+from citerefentry elements into AST for corresponding role
+for reStructuredText.
+
+We use subset of MyST syntax (CommonMark with features from rST)
+so let’s use the rST AST for rST features.
+
+Reference: https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-manpage
+]]
+
+function Code(elem)
+ elem.classes = elem.classes:map(function (x)
+ if x == 'citerefentry' then
+ elem.attributes['role'] = 'manpage'
+ return 'interpreted-text'
+ else
+ return x
+ end
+ end)
+
+ return elem
+end
diff --git a/third_party/nixpkgs/doc/labelless-link-is-xref.lua b/third_party/nixpkgs/doc/build-aux/pandoc-filters/docbook-writer/labelless-link-is-xref.lua
similarity index 69%
rename from third_party/nixpkgs/doc/labelless-link-is-xref.lua
rename to third_party/nixpkgs/doc/build-aux/pandoc-filters/docbook-writer/labelless-link-is-xref.lua
index 67569b0209..fa97729a28 100644
--- a/third_party/nixpkgs/doc/labelless-link-is-xref.lua
+++ b/third_party/nixpkgs/doc/build-aux/pandoc-filters/docbook-writer/labelless-link-is-xref.lua
@@ -1,3 +1,13 @@
+--[[
+Converts Link AST nodes with empty label to DocBook xref elements.
+
+This is a temporary script to be able use cross-references conveniently
+using syntax taken from MyST, while we still use docbook-xsl
+for generating the documentation.
+
+Reference: https://myst-parser.readthedocs.io/en/latest/using/syntax.html#targets-and-cross-referencing
+]]
+
local function starts_with(start, str)
return str:sub(1, #start) == start
end
diff --git a/third_party/nixpkgs/doc/build-aux/pandoc-filters/docbook-writer/rst-roles.lua b/third_party/nixpkgs/doc/build-aux/pandoc-filters/docbook-writer/rst-roles.lua
new file mode 100644
index 0000000000..92dc689575
--- /dev/null
+++ b/third_party/nixpkgs/doc/build-aux/pandoc-filters/docbook-writer/rst-roles.lua
@@ -0,0 +1,36 @@
+--[[
+Converts AST for reStructuredText roles into corresponding
+DocBook elements.
+
+Currently, only a subset of roles is supported.
+
+Reference:
+ List of roles:
+ https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html
+ manpage:
+ https://tdg.docbook.org/tdg/5.1/citerefentry.html
+ file:
+ https://tdg.docbook.org/tdg/5.1/filename.html
+]]
+
+function Code(elem)
+ if elem.classes:includes('interpreted-text') then
+ local tag = nil
+ local content = elem.text
+ if elem.attributes['role'] == 'manpage' then
+ tag = 'citerefentry'
+ local title, volnum = content:match('^(.+)%((%w+)%)$')
+ if title == nil then
+ -- No volnum in parentheses.
+ title = content
+ end
+ content = '' .. title .. '' .. (volnum ~= nil and ('' .. volnum .. '') or '')
+ elseif elem.attributes['role'] == 'file' then
+ tag = 'filename'
+ end
+
+ if tag ~= nil then
+ return pandoc.RawInline('docbook', '<' .. tag .. '>' .. content .. '' .. tag .. '>')
+ end
+ end
+end
diff --git a/third_party/nixpkgs/doc/build-aux/pandoc-filters/link-unix-man-references.lua b/third_party/nixpkgs/doc/build-aux/pandoc-filters/link-unix-man-references.lua
new file mode 100644
index 0000000000..12431f140f
--- /dev/null
+++ b/third_party/nixpkgs/doc/build-aux/pandoc-filters/link-unix-man-references.lua
@@ -0,0 +1,18 @@
+--[[
+Turns a manpage reference into a link, when a mapping is defined
+in the unix-man-urls.lua file.
+]]
+
+local man_urls = {
+ ["tmpfiles.d(5)"] = "https://www.freedesktop.org/software/systemd/man/tmpfiles.d.html",
+ ["nix.conf(5)"] = "https://nixos.org/manual/nix/stable/#sec-conf-file",
+ ["systemd.time(7)"] = "https://www.freedesktop.org/software/systemd/man/systemd.time.html",
+ ["systemd.timer(5)"] = "https://www.freedesktop.org/software/systemd/man/systemd.timer.html",
+}
+
+function Code(elem)
+ local is_man_role = elem.classes:includes('interpreted-text') and elem.attributes['role'] == 'manpage'
+ if is_man_role and man_urls[elem.text] ~= nil then
+ return pandoc.Link(elem, man_urls[elem.text])
+ end
+end
diff --git a/third_party/nixpkgs/doc/build-aux/pandoc-filters/myst-reader/roles.lua b/third_party/nixpkgs/doc/build-aux/pandoc-filters/myst-reader/roles.lua
new file mode 100644
index 0000000000..c33a688eeb
--- /dev/null
+++ b/third_party/nixpkgs/doc/build-aux/pandoc-filters/myst-reader/roles.lua
@@ -0,0 +1,29 @@
+--[[
+Replaces Str AST nodes containing {role}, followed by a Code node
+by a Code node with attrs that would be produced by rST reader
+from the role syntax.
+
+This is to emulate MyST syntax in Pandoc.
+(MyST is a CommonMark flavour with rST features mixed in.)
+
+Reference: https://myst-parser.readthedocs.io/en/latest/syntax/syntax.html#roles-an-in-line-extension-point
+]]
+
+function Inlines(inlines)
+ for i = #inlines-1,1,-1 do
+ local first = inlines[i]
+ local second = inlines[i+1]
+ local correct_tags = first.tag == 'Str' and second.tag == 'Code'
+ if correct_tags then
+ -- docutils supports alphanumeric strings separated by [-._:]
+ -- We are slightly more liberal for simplicity.
+ local role = first.text:match('^{([-._+:%w]+)}$')
+ if role ~= nil then
+ inlines:remove(i)
+ second.attributes['role'] = role
+ second.classes:insert('interpreted-text')
+ end
+ end
+ end
+ return inlines
+end
diff --git a/third_party/nixpkgs/doc/build-aux/pandoc-filters/myst-writer/roles.lua b/third_party/nixpkgs/doc/build-aux/pandoc-filters/myst-writer/roles.lua
new file mode 100644
index 0000000000..0136bc5506
--- /dev/null
+++ b/third_party/nixpkgs/doc/build-aux/pandoc-filters/myst-writer/roles.lua
@@ -0,0 +1,25 @@
+--[[
+Replaces Code nodes with attrs that would be produced by rST reader
+from the role syntax by a Str AST node containing {role}, followed by a Code node.
+
+This is to emulate MyST syntax in Pandoc.
+(MyST is a CommonMark flavour with rST features mixed in.)
+
+Reference: https://myst-parser.readthedocs.io/en/latest/syntax/syntax.html#roles-an-in-line-extension-point
+]]
+
+function Code(elem)
+ local role = elem.attributes['role']
+
+ if elem.classes:includes('interpreted-text') and role ~= nil then
+ elem.classes = elem.classes:filter(function (c)
+ return c ~= 'interpreted-text'
+ end)
+ elem.attributes['role'] = nil
+
+ return {
+ pandoc.Str('{' .. role .. '}'),
+ elem,
+ }
+ end
+end
diff --git a/third_party/nixpkgs/doc/builders/packages/linux.section.md b/third_party/nixpkgs/doc/builders/packages/linux.section.md
index 1b8d6eda74..d8f0d0ad44 100644
--- a/third_party/nixpkgs/doc/builders/packages/linux.section.md
+++ b/third_party/nixpkgs/doc/builders/packages/linux.section.md
@@ -16,7 +16,7 @@ How to add a new (major) version of the Linux kernel to Nixpkgs:
1. Copy the old Nix expression (e.g. `linux-2.6.21.nix`) to the new one (e.g. `linux-2.6.22.nix`) and update it.
-2. Add the new kernel to `all-packages.nix` (e.g., create an attribute `kernel_2_6_22`).
+2. Add the new kernel to the `kernels` attribute set in `linux-kernels.nix` (e.g., create an attribute `kernel_2_6_22`).
3. Now we’re going to update the kernel configuration. First unpack the kernel. Then for each supported platform (`i686`, `x86_64`, `uml`) do the following:
@@ -36,6 +36,6 @@ How to add a new (major) version of the Linux kernel to Nixpkgs:
5. Copy `.config` over the new config file (e.g. `config-2.6.22-i686-smp`).
-4. Test building the kernel: `nix-build -A kernel_2_6_22`. If it compiles, ship it! For extra credit, try booting NixOS with it.
+4. Test building the kernel: `nix-build -A linuxKernel.kernels.kernel_2_6_22`. If it compiles, ship it! For extra credit, try booting NixOS with it.
-5. It may be that the new kernel requires updating the external kernel modules and kernel-dependent packages listed in the `linuxPackagesFor` function in `all-packages.nix` (such as the NVIDIA drivers, AUFS, etc.). If the updated packages aren’t backwards compatible with older kernels, you may need to keep the older versions around.
+5. It may be that the new kernel requires updating the external kernel modules and kernel-dependent packages listed in the `linuxPackagesFor` function in `linux-kernels.nix` (such as the NVIDIA drivers, AUFS, etc.). If the updated packages aren’t backwards compatible with older kernels, you may need to keep the older versions around.
diff --git a/third_party/nixpkgs/doc/contributing/contributing-to-documentation.chapter.md b/third_party/nixpkgs/doc/contributing/contributing-to-documentation.chapter.md
index 2f7ae32259..178fdb3626 100644
--- a/third_party/nixpkgs/doc/contributing/contributing-to-documentation.chapter.md
+++ b/third_party/nixpkgs/doc/contributing/contributing-to-documentation.chapter.md
@@ -52,6 +52,13 @@ Additionally, the following syntax extensions are currently used:
This syntax is taken from [MyST](https://myst-parser.readthedocs.io/en/latest/using/syntax.html#targets-and-cross-referencing).
+- []{#ssec-contributing-markup-inline-roles}
+ If you want to link to a man page, you can use `` {manpage}`nix.conf(5)` ``, which will turn into {manpage}`nix.conf(5)`.
+
+ The references will turn into links when a mapping exists in {file}`doc/build-aux/pandoc-filters/unix-man-urls.lua`.
+
+ This syntax is taken from [MyST](https://myst-parser.readthedocs.io/en/latest/syntax/syntax.html#roles-an-in-line-extension-point). Though, the feature originates from [reStructuredText](https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-manpage) with slightly different syntax.
+
- []{#ssec-contributing-markup-admonitions}
**Admonitions**, set off from the text to bring attention to something.
diff --git a/third_party/nixpkgs/doc/languages-frameworks/beam.section.md b/third_party/nixpkgs/doc/languages-frameworks/beam.section.md
index 08abd4588c..fb608932df 100644
--- a/third_party/nixpkgs/doc/languages-frameworks/beam.section.md
+++ b/third_party/nixpkgs/doc/languages-frameworks/beam.section.md
@@ -68,27 +68,107 @@ Erlang.mk functions similarly to Rebar3, except we use `buildErlangMk` instead o
`mixRelease` is used to make a release in the mix sense. Dependencies will need to be fetched with `fetchMixDeps` and passed to it.
-#### mixRelease - Elixir Phoenix example {#mixrelease---elixir-phoenix-example}
+#### mixRelease - Elixir Phoenix example {#mix-release-elixir-phoenix-example}
-Here is how your `default.nix` file would look.
+there are 3 steps, frontend dependencies (javascript), backend dependencies (elixir) and the final derivation that puts both of those together
+
+##### mixRelease - Frontend dependencies (javascript) {#mix-release-javascript-deps}
+
+for phoenix projects, inside of nixpkgs you can either use yarn2nix (mkYarnModule) or node2nix. An example with yarn2nix can be found [here](https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/web-apps/plausible/default.nix#L39). An example with node2nix will follow. To package something outside of nixpkgs, you have alternatives like [npmlock2nix](https://github.com/nix-community/npmlock2nix) or [nix-npm-buildpackage](https://github.com/serokell/nix-npm-buildpackage)
+
+##### mixRelease - backend dependencies (mix) {#mix-release-mix-deps}
+
+There are 2 ways to package backend dependencies. With mix2nix and with a fixed-output-derivation (FOD).
+
+###### mix2nix {#mix2nix}
+
+mix2nix is a cli tool available in nixpkgs. it will generate a nix expression from a mix.lock file. It is quite standard in the 2nix tool series.
+
+Note that currently mix2nix can't handle git dependencies inside the mix.lock file. If you have git dependencies, you can either add them manually (see [example](https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/pleroma/default.nix#L20)) or use the FOD method.
+
+The advantage of using mix2nix is that nix will know your whole dependency graph. On a dependency update, this won't trigger a full rebuild and download of all the dependencies, where FOD will do so.
+
+practical steps:
+
+- run `mix2nix > mix_deps.nix` in the upstream repo.
+- pass `mixNixDeps = with pkgs; import ./mix_deps.nix { inherit lib beamPackages; };` as an argument to mixRelease.
+
+If there are git depencencies.
+
+- You'll need to fix the version artificially in mix.exs and regenerate the mix.lock with fixed version (on upstream). This will enable you to run `mix2nix > mix_deps.nix`.
+- From the mix_deps.nix file, remove the dependencies that had git versions and pass them as an override to the import function.
+
+```nix
+ mixNixDeps = import ./mix.nix {
+ inherit beamPackages lib;
+ overrides = (final: prev: {
+ # mix2nix does not support git dependencies yet,
+ # so we need to add them manually
+ prometheus_ex = beamPackages.buildMix rec {
+ name = "prometheus_ex";
+ version = "3.0.5";
+
+ # Change the argument src with the git src that you actually need
+ src = fetchFromGitLab {
+ domain = "git.pleroma.social";
+ group = "pleroma";
+ owner = "elixir-libraries";
+ repo = "prometheus.ex";
+ rev = "a4e9beb3c1c479d14b352fd9d6dd7b1f6d7deee5";
+ sha256 = "1v0q4bi7sb253i8q016l7gwlv5562wk5zy3l2sa446csvsacnpjk";
+ };
+ # you can re-use the same beamDeps argument as generated
+ beamDeps = with final; [ prometheus ];
+ };
+ });
+};
+```
+
+You will need to run the build process once to fix the sha256 to correspond to your new git src.
+
+###### FOD {#fixed-output-derivation}
+
+A fixed output derivation will download mix dependencies from the internet. To ensure reproducibility, a hash will be supplied. Note that mix is relatively reproducible. An FOD generating a different hash on each run hasn't been observed (as opposed to npm where the chances are relatively high). See [elixir_ls](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/beam-modules/elixir_ls.nix) for a usage example of FOD.
+
+Practical steps
+
+- start with the following argument to mixRelease
+
+```nix
+ mixFodDeps = fetchMixDeps {
+ pname = "mix-deps-${pname}";
+ inherit src version;
+ sha256 = lib.fakeSha256;
+ };
+```
+
+The first build will complain about the sha256 value, you can replace with the suggested value after that.
+
+Note that if after you've replaced the value, nix suggests another sha256, then mix is not fetching the dependencies reproducibly. An FOD will not work in that case and you will have to use mix2nix.
+
+##### mixRelease - example {#mix-release-example}
+
+Here is how your `default.nix` file would look for a phoenix project.
```nix
with import { };
let
+ # beam.interpreters.erlangR23 is available if you need a particular version
packages = beam.packagesWith beam.interpreters.erlang;
+
+ pname = "your_project";
+ version = "0.0.1";
+
src = builtins.fetchgit {
url = "ssh://git@github.com/your_id/your_repo";
rev = "replace_with_your_commit";
};
- pname = "your_project";
- version = "0.0.1";
- mixEnv = "prod";
-
+ # if using mix2nix you can use the mixNixDeps attribute
mixFodDeps = packages.fetchMixDeps {
pname = "mix-deps-${pname}";
- inherit src mixEnv version;
+ inherit src version;
# nix will complain and tell you the right value to replace this with
sha256 = lib.fakeSha256;
# if you have build time environment variables add them here
@@ -97,45 +177,19 @@ let
nodeDependencies = (pkgs.callPackage ./assets/default.nix { }).shell.nodeDependencies;
- frontEndFiles = stdenvNoCC.mkDerivation {
- pname = "frontend-${pname}";
-
- nativeBuildInputs = [ nodejs ];
-
- inherit version src;
-
- buildPhase = ''
- cp -r ./assets $TEMPDIR
-
- mkdir -p $TEMPDIR/assets/node_modules/.cache
- cp -r ${nodeDependencies}/lib/node_modules $TEMPDIR/assets
- export PATH="${nodeDependencies}/bin:$PATH"
-
- cd $TEMPDIR/assets
- webpack --config ./webpack.config.js
- cd ..
- '';
-
- installPhase = ''
- cp -r ./priv/static $out/
- '';
-
- outputHashAlgo = "sha256";
- outputHashMode = "recursive";
- # nix will complain and tell you the right value to replace this with
- outputHash = lib.fakeSha256;
-
- impureEnvVars = lib.fetchers.proxyImpureEnvVars;
- };
-
-
in packages.mixRelease {
- inherit src pname version mixEnv mixFodDeps;
+ inherit src pname version mixFodDeps;
# if you have build time environment variables add them here
MY_ENV_VAR="my_value";
- preInstall = ''
- mkdir -p ./priv/static
- cp -r ${frontEndFiles} ./priv/static
+
+ postBuild = ''
+ ln -sf ${nodeDependencies}/lib/node_modules assets/node_modules
+ npm run deploy --prefix ./assets
+
+ # for external task you need a workaround for the no deps check flag
+ # https://github.com/phoenixframework/phoenix/issues/2690
+ mix do deps.loadpaths --no-deps-check, phx.digest
+ mix phx.digest --no-deps-check
'';
}
```
@@ -165,6 +219,8 @@ in
systemd.services.${release_name} = {
wantedBy = [ "multi-user.target" ];
after = [ "network.target" "postgresql.service" ];
+ # note that if you are connecting to a postgres instance on a different host
+ # postgresql.service should not be included in the requires.
requires = [ "network-online.target" "postgresql.service" ];
description = "my app";
environment = {
@@ -201,6 +257,7 @@ in
path = [ pkgs.bash ];
};
+ # in case you have migration scripts or you want to use a remote shell
environment.systemPackages = [ release ];
}
```
@@ -215,16 +272,11 @@ Usually, we need to create a `shell.nix` file and do our development inside of t
{ pkgs ? import {} }:
with pkgs;
-
let
-
- elixir = beam.packages.erlangR22.elixir_1_9;
-
+ elixir = beam.packages.erlangR24.elixir_1_12;
in
mkShell {
buildInputs = [ elixir ];
-
- ERL_INCLUDE_PATH="${erlang}/lib/erlang/usr/include";
}
```
@@ -264,6 +316,7 @@ let
# TODO: not sure how to make hex available without installing it afterwards.
mix local.hex --if-missing
export LANG=en_US.UTF-8
+ # keep your shell history in iex
export ERL_AFLAGS="-kernel shell_history enabled"
# postges related
diff --git a/third_party/nixpkgs/doc/languages-frameworks/javascript.section.md b/third_party/nixpkgs/doc/languages-frameworks/javascript.section.md
index c75bc23542..bf5742d685 100644
--- a/third_party/nixpkgs/doc/languages-frameworks/javascript.section.md
+++ b/third_party/nixpkgs/doc/languages-frameworks/javascript.section.md
@@ -2,7 +2,7 @@
## Introduction {#javascript-introduction}
-This contains instructions on how to package javascript applications. For instructions on how to add a cli package from npm please consult the #node.js section
+This contains instructions on how to package javascript applications.
The various tools available will be listed in the [tools-overview](#javascript-tools-overview). Some general principles for packaging will follow. Finally some tool specific instructions will be given.
diff --git a/third_party/nixpkgs/doc/languages-frameworks/python.section.md b/third_party/nixpkgs/doc/languages-frameworks/python.section.md
index 987ea1af9d..cc1a7083dc 100644
--- a/third_party/nixpkgs/doc/languages-frameworks/python.section.md
+++ b/third_party/nixpkgs/doc/languages-frameworks/python.section.md
@@ -1513,7 +1513,7 @@ If you need to change a package's attribute(s) from `configuration.nix` you coul
python = super.python.override {
packageOverrides = python-self: python-super: {
twisted = python-super.twisted.overrideAttrs (oldAttrs: {
- src = super.fetchPipy {
+ src = super.fetchPypi {
pname = "twisted";
version = "19.10.0";
sha256 = "7394ba7f272ae722a74f3d969dcf599bc4ef093bc392038748a490f1724a515d";
diff --git a/third_party/nixpkgs/doc/using/overlays.chapter.md b/third_party/nixpkgs/doc/using/overlays.chapter.md
index 037580583b..d2e3b49a6a 100644
--- a/third_party/nixpkgs/doc/using/overlays.chapter.md
+++ b/third_party/nixpkgs/doc/using/overlays.chapter.md
@@ -138,6 +138,8 @@ All programs that are built with [MPI](https://en.wikipedia.org/wiki/Message_Pas
- [MPICH](https://www.mpich.org/), attribute name `mpich`
+- [MVAPICH](https://mvapich.cse.ohio-state.edu/), attribute name `mvapich`
+
To provide MPI enabled applications that use `MPICH`, instead of the default `Open MPI`, simply use the following overlay:
```nix
diff --git a/third_party/nixpkgs/lib/generators.nix b/third_party/nixpkgs/lib/generators.nix
index bcb0f371a9..0cec4d2dd6 100644
--- a/third_party/nixpkgs/lib/generators.nix
+++ b/third_party/nixpkgs/lib/generators.nix
@@ -35,6 +35,8 @@ rec {
("generators.mkValueStringDefault: " +
"${t} not supported: ${toPretty {} v}");
in if isInt v then toString v
+ # convert derivations to store paths
+ else if lib.isDerivation v then toString v
# we default to not quoting strings
else if isString v then v
# isString returns "1", which is not a good default
@@ -169,7 +171,7 @@ rec {
# converts { a.b.c = 5; } to { "a.b".c = 5; } for toINI
gitFlattenAttrs = let
recurse = path: value:
- if isAttrs value then
+ if isAttrs value && !lib.isDerivation value then
lib.mapAttrsToList (name: value: recurse ([ name ] ++ path) value) value
else if length path > 1 then {
${concatStringsSep "." (lib.reverseList (tail path))}.${head path} = value;
diff --git a/third_party/nixpkgs/lib/sources.nix b/third_party/nixpkgs/lib/sources.nix
index 407829b547..ae2df72352 100644
--- a/third_party/nixpkgs/lib/sources.nix
+++ b/third_party/nixpkgs/lib/sources.nix
@@ -43,7 +43,9 @@ let
lib.hasSuffix ".o" baseName ||
lib.hasSuffix ".so" baseName ||
# Filter out nix-build result symlinks
- (type == "symlink" && lib.hasPrefix "result" baseName)
+ (type == "symlink" && lib.hasPrefix "result" baseName) ||
+ # Filter out sockets and other types of files we can't have in the store.
+ (type == "unknown")
);
# Filters a source tree removing version control files and directories using cleanSourceWith
diff --git a/third_party/nixpkgs/lib/strings.nix b/third_party/nixpkgs/lib/strings.nix
index 86c92bdaa1..a111e1e259 100644
--- a/third_party/nixpkgs/lib/strings.nix
+++ b/third_party/nixpkgs/lib/strings.nix
@@ -89,7 +89,7 @@ rec {
=> "usr/local/bin"
*/
concatStringsSep = builtins.concatStringsSep or (separator: list:
- concatStrings (intersperse separator list));
+ lib.foldl' (x: y: x + y) "" (intersperse separator list));
/* Maps a function over a list of strings and then concatenates the
result with the specified separator interspersed between
diff --git a/third_party/nixpkgs/lib/systems/default.nix b/third_party/nixpkgs/lib/systems/default.nix
index 70ec98b03c..ef609859ab 100644
--- a/third_party/nixpkgs/lib/systems/default.nix
+++ b/third_party/nixpkgs/lib/systems/default.nix
@@ -107,6 +107,7 @@ rec {
else if final.isMips then "mips"
else if final.isPower then "powerpc"
else if final.isRiscV then "riscv"
+ else if final.isS390 then "s390"
else final.parsed.cpu.name;
qemuArch =
diff --git a/third_party/nixpkgs/lib/systems/doubles.nix b/third_party/nixpkgs/lib/systems/doubles.nix
index e577059687..8af3377fb5 100644
--- a/third_party/nixpkgs/lib/systems/doubles.nix
+++ b/third_party/nixpkgs/lib/systems/doubles.nix
@@ -28,7 +28,7 @@ let
"aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7a-linux"
"armv7l-linux" "i686-linux" "m68k-linux" "mipsel-linux"
"powerpc64-linux" "powerpc64le-linux" "riscv32-linux"
- "riscv64-linux" "s390-linux" "x86_64-linux"
+ "riscv64-linux" "s390-linux" "s390x-linux" "x86_64-linux"
# MMIXware
"mmix-mmixware"
@@ -41,7 +41,8 @@ let
# none
"aarch64-none" "arm-none" "armv6l-none" "avr-none" "i686-none"
"msp430-none" "or1k-none" "m68k-none" "powerpc-none"
- "riscv32-none" "riscv64-none" "s390-none" "vc4-none" "x86_64-none"
+ "riscv32-none" "riscv64-none" "s390-none" "s390x-none" "vc4-none"
+ "x86_64-none"
# OpenBSD
"i686-openbsd" "x86_64-openbsd"
diff --git a/third_party/nixpkgs/lib/systems/examples.nix b/third_party/nixpkgs/lib/systems/examples.nix
index 32b236d696..8dfa22ac78 100644
--- a/third_party/nixpkgs/lib/systems/examples.nix
+++ b/third_party/nixpkgs/lib/systems/examples.nix
@@ -152,6 +152,10 @@ rec {
config = "s390-unknown-linux-gnu";
};
+ s390x = {
+ config = "s390x-unknown-linux-gnu";
+ };
+
arm-embedded = {
config = "arm-none-eabi";
libc = "newlib";
diff --git a/third_party/nixpkgs/lib/systems/parse.nix b/third_party/nixpkgs/lib/systems/parse.nix
index 77e941a913..8a88d8cfbe 100644
--- a/third_party/nixpkgs/lib/systems/parse.nix
+++ b/third_party/nixpkgs/lib/systems/parse.nix
@@ -106,6 +106,7 @@ rec {
riscv64 = { bits = 64; significantByte = littleEndian; family = "riscv"; };
s390 = { bits = 32; significantByte = bigEndian; family = "s390"; };
+ s390x = { bits = 64; significantByte = bigEndian; family = "s390"; };
sparc = { bits = 32; significantByte = bigEndian; family = "sparc"; };
sparc64 = { bits = 64; significantByte = bigEndian; family = "sparc"; };
diff --git a/third_party/nixpkgs/lib/tests/systems.nix b/third_party/nixpkgs/lib/tests/systems.nix
index 661b9bc869..2646e79268 100644
--- a/third_party/nixpkgs/lib/tests/systems.nix
+++ b/third_party/nixpkgs/lib/tests/systems.nix
@@ -28,7 +28,7 @@ with lib.systems.doubles; lib.runTests {
testredox = mseteq redox [ "x86_64-redox" ];
testgnu = mseteq gnu (linux /* ++ kfreebsd ++ ... */);
testillumos = mseteq illumos [ "x86_64-solaris" ];
- testlinux = mseteq linux [ "aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7a-linux" "armv7l-linux" "i686-linux" "mipsel-linux" "riscv32-linux" "riscv64-linux" "x86_64-linux" "powerpc64-linux" "powerpc64le-linux" "m68k-linux" "s390-linux" ];
+ testlinux = mseteq linux [ "aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7a-linux" "armv7l-linux" "i686-linux" "mipsel-linux" "riscv32-linux" "riscv64-linux" "x86_64-linux" "powerpc64-linux" "powerpc64le-linux" "m68k-linux" "s390-linux" "s390x-linux" ];
testnetbsd = mseteq netbsd [ "aarch64-netbsd" "armv6l-netbsd" "armv7a-netbsd" "armv7l-netbsd" "i686-netbsd" "m68k-netbsd" "mipsel-netbsd" "powerpc-netbsd" "riscv32-netbsd" "riscv64-netbsd" "x86_64-netbsd" ];
testopenbsd = mseteq openbsd [ "i686-openbsd" "x86_64-openbsd" ];
testwindows = mseteq windows [ "i686-cygwin" "x86_64-cygwin" "i686-windows" "x86_64-windows" ];
diff --git a/third_party/nixpkgs/maintainers/maintainer-list.nix b/third_party/nixpkgs/maintainers/maintainer-list.nix
index 43968e4d80..be13f14bc5 100644
--- a/third_party/nixpkgs/maintainers/maintainer-list.nix
+++ b/third_party/nixpkgs/maintainers/maintainer-list.nix
@@ -80,6 +80,12 @@
githubId = 791309;
name = "Jan Hrnko";
};
+ _1000teslas = {
+ name = "Kevin Tran";
+ email = "47207223+1000teslas@users.noreply.github.com";
+ github = "1000teslas";
+ githubId = 47207223;
+ };
_3699n = {
email = "nicholas@nvk.pm";
github = "3699n";
@@ -348,6 +354,12 @@
githubId = 4732885;
name = "Ivan Jager";
};
+ airwoodix = {
+ email = "airwoodix@posteo.me";
+ github = "airwoodix";
+ githubId = 44871469;
+ name = "Etienne Wodey";
+ };
ajs124 = {
email = "nix@ajs124.de";
github = "ajs124";
@@ -450,6 +462,12 @@
githubId = 2335822;
name = "Alexandre Esteves";
};
+ alexnortung = {
+ name = "alexnortung";
+ email = "alex_nortung@live.dk";
+ github = "alexnortung";
+ githubId = 1552267;
+ };
alexvorobiev = {
email = "alexander.vorobiev@gmail.com";
github = "alexvorobiev";
@@ -526,6 +544,16 @@
fingerprint = "B422 CFB1 C9EF 73F7 E1E2 698D F53E 3233 42F7 A6D3A";
}];
};
+ alyaeanyx = {
+ email = "alexandra.hollmeier@mailbox.org";
+ github = "alyaeanyx";
+ githubId = 74795488;
+ name = "Alexandra Hollmeier";
+ keys = [{
+ longkeyid = "rsa3072/0x87D1AADCD25B8DEE";
+ fingerprint = "1F73 8879 5E5A 3DFC E2B3 FA32 87D1 AADC D25B 8DEE";
+ }];
+ };
amanjeev = {
email = "aj@amanjeev.com";
github = "amanjeev";
@@ -1318,6 +1346,12 @@
githubId = 7346933;
name = "betaboon";
};
+ bew = {
+ email = "benoit.dechezelles@gmail.com";
+ github = "bew";
+ githubId = 9730330;
+ name = "Benoit de Chezelles";
+ };
bfortz = {
email = "bernard.fortz@gmail.com";
github = "bfortz";
@@ -1348,6 +1382,12 @@
githubId = 28444296;
name = "Benjamin Hougland";
};
+ billewanick = {
+ email = "bill@ewanick.com";
+ github = "billewanick";
+ githubId = 13324165;
+ name = "Bill Ewanick";
+ };
binarin = {
email = "binarin@binarin.ru";
github = "binarin";
@@ -1508,12 +1548,6 @@
githubId = 355401;
name = "Brian Hicks";
};
- bricewge = {
- email = "bricewge@gmail.com";
- github = "bricewge";
- githubId = 5525646;
- name = "Brice Waegeneire";
- };
Br1ght0ne = {
email = "brightone@protonmail.com";
github = "Br1ght0ne";
@@ -1671,6 +1705,12 @@
githubId = 7435854;
name = "Victor Calvert";
};
+ cameronnemo = {
+ email = "cnemo@tutanota.com";
+ github = "cameronnemo";
+ githubId = 3212452;
+ name = "Cameron Nemo";
+ };
campadrenalin = {
email = "campadrenalin@gmail.com";
github = "campadrenalin";
@@ -1869,6 +1909,12 @@
githubId = 3086255;
name = "Barry Moore II";
};
+ chisui = {
+ email = "chisui.pd@gmail.com";
+ github = "chisui";
+ githubId = 4526429;
+ name = "Philipp Dargel";
+ };
chivay = {
email = "hubert.jasudowicz@gmail.com";
github = "chivay";
@@ -2257,6 +2303,12 @@
githubId = 1382175;
name = "Oliver Matthews";
};
+ cyounkins = {
+ name = "Craig Younkins";
+ email = "cyounkins@gmail.com";
+ github = "cyounkins";
+ githubId = 346185;
+ };
cypherpunk2140 = {
email = "stefan.mihaila@pm.me";
github = "stefan-mihaila";
@@ -3621,6 +3673,12 @@
fingerprint = "2F93 661D AC17 EA98 A104 F780 ECC7 55EE 583C 1672";
}];
};
+ flexagoon = {
+ email = "flexagoon@pm.me";
+ github = "flexagoon";
+ githubId = 66178592;
+ name = "Pavel Zolotarevskiy";
+ };
flexw = {
email = "felix.weilbach@t-online.de";
github = "FlexW";
@@ -4235,6 +4293,12 @@
githubId = 731722;
name = "Ryan Scheel";
};
+ hawkw = {
+ email = "eliza@elizas.website";
+ github = "hawkw";
+ githubId = 2796466;
+ name = "Eliza Weisman";
+ };
hax404 = {
email = "hax404foogit@hax404.de";
github = "hax404";
@@ -4621,6 +4685,12 @@
githubId = 993484;
name = "Greg Hale";
};
+ imgabe = {
+ email = "gabrielpmonte@hotmail.com";
+ github = "imgabe";
+ githubId = 24387926;
+ name = "Gabriel Pereira";
+ };
imlonghao = {
email = "nixos@esd.cc";
github = "imlonghao";
@@ -4747,6 +4817,12 @@
githubId = 26877687;
name = "Yurii Izorkin";
};
+ j0xaf = {
+ email = "j0xaf@j0xaf.de";
+ name = "Jörn Gersdorf";
+ github = "j0xaf";
+ githubId = 932697;
+ };
j0hax = {
name = "Johannes Arnold";
email = "johannes.arnold@stud.uni-hannover.de";
@@ -5408,6 +5484,12 @@
githubId = 39434424;
name = "Felix Springer";
};
+ junjihashimoto = {
+ email = "junji.hashimoto@gmail.com";
+ github = "junjihashimoto";
+ githubId = 2469618;
+ name = "Junji Hashimoto";
+ };
justinas = {
email = "justinas@justinas.org";
github = "justinas";
@@ -5472,6 +5554,12 @@
githubId = 66669;
name = "Jeff Zellner";
};
+ k4leg = {
+ name = "k4leg";
+ email = "python.bogdan@gmail.com";
+ github = "k4leg";
+ githubId = 39882583;
+ };
kaction = {
name = "Dmitry Bogatov";
email = "KAction@disroot.org";
@@ -6694,6 +6782,12 @@
githubId = 775189;
name = "Jordi Masip";
};
+ MaskedBelgian = {
+ email = "michael.colicchia@imio.be";
+ github = "MaskedBelgian";
+ githubId = 29855073;
+ name = "Michael Colicchia";
+ };
matdsoupe = {
github = "matdsoupe";
githubId = 44469426;
@@ -7445,6 +7539,16 @@
name = "Maxim Schuwalow";
email = "maxim.schuwalow@gmail.com";
};
+ msfjarvis = {
+ github = "msfjarvis";
+ githubId = 3348378;
+ name = "Harsh Shandilya";
+ email = "nixos@msfjarvis.dev";
+ keys = [{
+ longkeyid = "rsa4096/0xB7843F823355E9B9";
+ fingerprint = "8F87 050B 0F9C B841 1515 7399 B784 3F82 3355 E9B9";
+ }];
+ };
msiedlarek = {
email = "mikolaj@siedlarek.pl";
github = "msiedlarek";
@@ -7649,6 +7753,12 @@
githubId = 2590830;
name = "Sage Raflik";
};
+ neosimsim = {
+ email = "me@abn.sh";
+ github = "neosimsim";
+ githubId = 1771772;
+ name = "Alexander Ben Nasrallah";
+ };
nequissimus = {
email = "tim@nequissimus.com";
github = "nequissimus";
@@ -8514,7 +8624,7 @@
githubId = 1719781;
name = "Pablo Ovelleiro Corral";
keys = [{
- longkeyid = "sa4096/0x823A6154426408D3";
+ longkeyid = "rsa4096/0x823A6154426408D3";
fingerprint = "D03B 218C AE77 1F77 D7F9 20D9 823A 6154 4264 08D3";
}];
};
@@ -8772,6 +8882,12 @@
githubId = 33375;
name = "Peter Sanford";
};
+ pshirshov = {
+ email = "pshirshov@eml.cc";
+ github = "pshirshov";
+ githubId = 295225;
+ name = "Pavel Shirshov";
+ };
psibi = {
email = "sibi@psibi.in";
github = "psibi";
@@ -9526,6 +9642,12 @@
github = "s1341";
githubId = 5682183;
};
+ samalws = {
+ email = "sam@samalws.com";
+ name = "Sam Alws";
+ github = "samalws";
+ githubId = 20981725;
+ };
samb96 = {
email = "samb96@gmail.com";
github = "samb96";
@@ -9560,6 +9682,12 @@
githubId = 115821;
name = "Sam Rose";
};
+ samuela = {
+ email = "skainsworth@gmail.com";
+ github = "samuela";
+ githubId = 226872;
+ name = "Samuel Ainsworth";
+ };
samueldr = {
email = "samuel@dionne-riel.com";
github = "samueldr";
@@ -10250,6 +10378,12 @@
githubId = 8668915;
name = "Stephane Schitter";
};
+ staccato = {
+ name = "staccato";
+ email = "moveq@riseup.net";
+ github = "staccato";
+ githubId = 86573128;
+ };
steell = {
email = "steve@steellworks.com";
github = "Steell";
@@ -11024,6 +11158,12 @@
githubId = 10110;
name = "Travis B. Hartwell";
};
+ travisdavis-ops = {
+ email = "travisdavismedia@gmail.com";
+ github = "travisdavis-ops";
+ githubId = 52011418;
+ name = "Travis Davis";
+ };
TredwellGit = {
email = "tredwell@tutanota.com";
github = "TredwellGit";
@@ -11281,10 +11421,14 @@
name = "Jos van den Oever";
};
vanilla = {
- email = "neko@hydev.org";
+ email = "osu_vanilla@126.com";
github = "VergeDX";
githubId = 25173827;
name = "Vanilla";
+ keys = [{
+ longkeyid = "rsa4096/0x4DFA2BDD7305E739";
+ fingerprint = "5C16 5178 7DE2 EE5A AF98 3EA3 4DFA 2BDD 7305 E739";
+ }];
};
vanschelven = {
email = "klaas@vanschelven.com";
@@ -11736,6 +11880,12 @@
githubId = 3992240;
name = "Elijah Rum";
};
+ x3ro = {
+ name = "^x3ro";
+ email = "nix@x3ro.dev";
+ github = "x3rAx";
+ githubId = 2268851;
+ };
xaverdh = {
email = "hoe.dom@gmx.de";
github = "xaverdh";
@@ -12362,6 +12512,16 @@
fingerprint = "61AE D40F 368B 6F26 9DAE 3892 6861 6B2D 8AC4 DCC5";
}];
};
+ zenithal = {
+ name = "zenithal";
+ email = "i@zenithal.me";
+ github = "ZenithalHourlyRate";
+ githubId = 19512674;
+ keys = [{
+ longkeyid = "rsa4096/0x87E17EEF9B18B6C9";
+ fingerprint = "1127 F188 280A E312 3619 3329 87E1 7EEF 9B18 B6C9";
+ }];
+ };
zeri = {
name = "zeri";
email = "68825133+zeri42@users.noreply.github.com";
@@ -12390,4 +12550,11 @@
github = "rski";
githubId = 2960312;
};
+ mbprtpmnr = {
+ name = "mbprtpmnr";
+ email = "mbprtpmnr@pm.me";
+ github = "mbprtpmnr";
+ githubId = 88109321;
+ };
+
}
diff --git a/third_party/nixpkgs/maintainers/scripts/db-to-md.sh b/third_party/nixpkgs/maintainers/scripts/db-to-md.sh
new file mode 100755
index 0000000000..01357d1e24
--- /dev/null
+++ b/third_party/nixpkgs/maintainers/scripts/db-to-md.sh
@@ -0,0 +1,88 @@
+#! /usr/bin/env nix-shell
+#! nix-shell -I nixpkgs=. -i bash -p pandoc
+
+# This script is temporarily needed while we transition the manual to
+# CommonMark. It converts DocBook files into our CommonMark flavour.
+
+debug=
+files=()
+
+while [ "$#" -gt 0 ]; do
+ i="$1"; shift 1
+ case "$i" in
+ --debug)
+ debug=1
+ ;;
+ *)
+ files+=("$i")
+ ;;
+ esac
+done
+
+echo "WARNING: This is an experimental script and might not preserve all formatting." > /dev/stderr
+echo "Please report any issues you discover." > /dev/stderr
+
+outExtension="md"
+if [[ $debug ]]; then
+ outExtension="json"
+fi
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+
+# NOTE: Keep in sync with Nixpkgs manual (/doc/Makefile).
+# TODO: Remove raw-attribute when we can get rid of DocBook altogether.
+pandoc_commonmark_enabled_extensions=+attributes+fenced_divs+footnotes+bracketed_spans+definition_lists+pipe_tables+raw_attribute
+targetLang="commonmark${pandoc_commonmark_enabled_extensions}+smart"
+if [[ $debug ]]; then
+ targetLang=json
+fi
+pandoc_flags=(
+ # Not needed:
+ # - diagram-generator.lua (we do not support that in NixOS manual to limit dependencies)
+ # - media extraction (was only required for diagram generator)
+ # - myst-reader/roles.lua (only relevant for MyST → DocBook)
+ # - link-unix-man-references.lua (links should only be added to display output)
+ # - docbook-writer/rst-roles.lua (only relevant for → DocBook)
+ # - docbook-writer/labelless-link-is-xref.lua (only relevant for → DocBook)
+ "--lua-filter=$DIR/../../doc/build-aux/pandoc-filters/docbook-reader/citerefentry-to-rst-role.lua"
+ "--lua-filter=$DIR/../../doc/build-aux/pandoc-filters/myst-writer/roles.lua"
+ "--lua-filter=$DIR/doc/unknown-code-language.lua"
+ -f docbook
+ -t "$targetLang"
+ --tab-stop=2
+ --wrap=none
+)
+
+for file in "${files[@]}"; do
+ if [[ ! -f "$file" ]]; then
+ echo "db-to-md.sh: $file does not exist" > /dev/stderr
+ exit 1
+ else
+ rootElement=$(xmllint --xpath 'name(//*)' "$file")
+
+ if [[ $rootElement = chapter ]]; then
+ extension=".chapter.$outExtension"
+ elif [[ $rootElement = section ]]; then
+ extension=".section.$outExtension"
+ else
+ echo "db-to-md.sh: $file contains an unsupported root element $rootElement" > /dev/stderr
+ exit 1
+ fi
+
+ outFile="${file%".section.xml"}"
+ outFile="${outFile%".chapter.xml"}"
+ outFile="${outFile%".xml"}$extension"
+ temp1=$(mktemp)
+ $DIR/doc/escape-code-markup.py "$file" "$temp1"
+ if [[ $debug ]]; then
+ echo "Converted $file to $temp1" > /dev/stderr
+ fi
+ temp2=$(mktemp)
+ $DIR/doc/replace-xrefs-by-empty-links.py "$temp1" "$temp2"
+ if [[ $debug ]]; then
+ echo "Converted $temp1 to $temp2" > /dev/stderr
+ fi
+ pandoc "$temp2" -o "$outFile" "${pandoc_flags[@]}"
+ echo "Converted $file to $outFile" > /dev/stderr
+ fi
+done
diff --git a/third_party/nixpkgs/maintainers/scripts/doc/escape-code-markup.py b/third_party/nixpkgs/maintainers/scripts/doc/escape-code-markup.py
new file mode 100755
index 0000000000..015435b698
--- /dev/null
+++ b/third_party/nixpkgs/maintainers/scripts/doc/escape-code-markup.py
@@ -0,0 +1,97 @@
+#! /usr/bin/env nix-shell
+#! nix-shell -I nixpkgs=channel:nixos-unstable -i python3 -p python3 -p python3.pkgs.lxml
+
+"""
+Pandoc will strip any markup within code elements so
+let’s escape them so that they can be handled manually.
+"""
+
+import lxml.etree as ET
+import re
+import sys
+
+def replace_element_by_text(el: ET.Element, text: str) -> None:
+ """
+ Author: bernulf
+ Source: https://stackoverflow.com/a/10520552/160386
+ SPDX-License-Identifier: CC-BY-SA-3.0
+ """
+ text = text + (el.tail or "")
+ parent = el.getparent()
+ if parent is not None:
+ previous = el.getprevious()
+ if previous is not None:
+ previous.tail = (previous.tail or "") + text
+ else:
+ parent.text = (parent.text or "") + text
+ parent.remove(el)
+
+DOCBOOK_NS = "http://docbook.org/ns/docbook"
+
+# List of elements that pandoc’s DocBook reader strips markup from.
+# https://github.com/jgm/pandoc/blob/master/src/Text/Pandoc/Readers/DocBook.hs
+code_elements = [
+ # CodeBlock
+ "literallayout",
+ "screen",
+ "programlisting",
+ # Code (inline)
+ "classname",
+ "code",
+ "filename",
+ "envar",
+ "literal",
+ "computeroutput",
+ "prompt",
+ "parameter",
+ "option",
+ "markup",
+ "wordasword",
+ "command",
+ "varname",
+ "function",
+ "type",
+ "symbol",
+ "constant",
+ "userinput",
+ "systemitem",
+]
+
+XMLNS_REGEX = re.compile(r'\s+xmlns(?::[^=]+)?="[^"]*"')
+ROOT_ELEMENT_REGEX = re.compile(r'^\s*<[^>]+>')
+
+def remove_xmlns(match: re.Match) -> str:
+ """
+ Removes xmlns attributes.
+
+ Expects a match containing an opening tag.
+ """
+ return XMLNS_REGEX.sub('', match.group(0))
+
+if __name__ == '__main__':
+ assert len(sys.argv) >= 3, "usage: escape-code-markup.py