+UVJpSD0B18DJt~PllJVcfWJafq0}=kNIO3^{Kn_VB^N5ZYIiDaA9UVx3pjV
zM~@VhJt4{-9w5KY$xXc`nAc#yJ0Xbg0v={U8h_281y5nbOkCD@$fB;8tphs7uf;5R
z+{kOQ#F@{iH
z%+I!0O|7;(PQ6#X_EhWpAx>Yf^$MZZq&+yDJ&vv}oroyU2
zs+hA(?m56TplQN6TNc7S;p7fqWP|py)A0
zDRX*R%vUs?S!pwy?Rgf-Mgiyvtje!DV(HU28*n$U>41^I;yyatyOHPRftf(@1GuoD
z(6MZBA(3mF|G|w{^IN#R+pXIFVK%`$+iYfWAO8MhwSQ8~O$aMz1MS?l%gp>)?RiF~
z=RaCx^TKQL2(Hb7$zz+%U%flL^@K%FwfNqkIj}9M2qbIpjA$!&Qlm6xS7rq;%+%vP
zI%);UA1ZPh`|&UdyWVE@=-Uro7PqGQPcA(M>H269w`b=bGWP8^&+`&W58aLDB>*sj
z=Lst?QAuZx#>x
zAjN@@zW@^tTK;hsy127|&G`l4y>8V$Yw+aKeh4I?+i*!eb=ul60S>F_Z4NXwQ)%_^x{D!=i$i(*`>F$vG|hd@
zvnyg4OA(g_)%t#*4pMiCrh&`#BN@^^Yjqu87GOdD=H7z-&F13=?DK%$2AkskJwoAz5z3;p
zZdOak(He*sVsEBjx)8HVehmPEdDuWsm&RSC)1=v*FIg(5$8c^RPADdaQ{QV}TpQQd
z)K=$zXJ$RafQ?xRGrK20SCAHQ8zTf)L@Xo?>@76Jih2
zV*s=6t@6>eFRpzZ)IPZWx`;-BJNCu1p_sKcqbg<|FypX52&jcVX7-_xm*23rq#3*6aP&c|dEhmKdk|<5)8N5d|ec%CIouLU21U
z``2D^YyRrG69j+#Wmo27hW>C{MC7zwm~3hMJn3OOA^`bN?M
zq!p6ZB7KbbXCz2LL%Hyw$wFz?b&GX%XTBU;Xq`jc8
z<+MU_3*PU0!%w*#-=N=|-k=`7_ws=YfLMcc%RAlbZ^%xzEj%>}n!X)NUNac_~sMcw85lL;#tcOH7ETZACI1T!V;;lrUUzaO4
zAk4ryGb6LGf{^Dm=F9ILbte8zaYKP}J_X^$l^LZQ%wOLP8FG!Zd>^~>$ErFoZke0`Cmnn{%{IS_S8bc2FgEqg^BFXrN}
zF~Idnt9yzcQyk;fdOc^9EOa2O9+AF7SQ9f_LBf|8H?yUCY8r|o^
z=UeT=tgD%QeW*ZqL2cmg=jCh_o)?1A@yZ@=o?R&Ggf%1X+y-24*wi44>0UK`MEPt$
zz*>taI4?jD^!tZ#B4HI?!YUGAl)$WOp)J>OZj)$|dSA}9>CXpqh+AZPLW
z+1yh$tMIadQ4+Hjg_^clJ-oetN4zo2%+3PlRZSmR6JYs^t$#46X~q?pbu}1;**7^^
zfO%fLVK}RM3S&jCU|4cY`rQ_52a_u8hZhIlM%0nC6V!Iqu(soK;FwAaHXxNvD(E7M
zH`%%=!u`U+jmVuk{vgXGsxRo@+$)rp5V43oz-<_t&Fna^H>#$Oe7tJ<$Rf!!s%j{C}cWvIeNVXy9LW@jI78{`$4m!`r`YSieXycNMU_YWm1}KCNxl
zF-uEWfR~NhNTi^KdEP#ZDVS}F?DGp|?Fs_``2xXrIrKMdF7dk;?G#{o)%1~d%s4-(
z`i8>+!r0j7&3Yvv|-g%`qxsq+|AynKfPXREw1q63I7ZT)ExLrvu9+oe~MM
z-w5VNY8z)xiLV`OL8>L`JKznVwxqu;eeU)bDCBZjynU5+!>%_pRZ=Vggg!T}s_YGA1O;
z-!NMpUum=C?|3k?^)kCZrRrbN5&$l4JG3gWSYbm~Jk8`6Nms5K*6zcUs()Qez&!6G
z%)UruMP6tXy;1-iT+$AAfD2o{AdJC=RrLKo{&$7II|hSNDlPyJFj^UQmm>Eo3$_@v
zUpq2=e@ev%m)PMPd_l{Ma0EFtaX#($S`0uz5nGQmQS0
z?5N^x&y|$;3RK#!)51IPx%~e|bzGfNZ9!Oq*;NLm!wNazhQ@p}`rZ@(1qFhcHB1V|
zVz(K6QYtObm|)ezd&uQ~<=v~FjJfa2lu8Q-gbKGjb1cR=VL@QV9-*gG>MY2L*|R@j
z-tmcVbF@jHywUlqlsXI05`>k*;_<-9<5%6M*A$US;WRrN*O@qME<1Y%DYMMM{lFCp#)1#N=t~Cw5D@qJp-B
z^3D3EfmQQ6=9FSekA@|f*;QtC2CyG2RUsF&C7gdl-%5BkJorVc9l-9C3Jcm2%w7UJ
zJ!t0LmIC1@SVH&>>A{zVtlco}QA???fGt608zZ+j%}uHAXjp>TPd;72eqdHgeFba@
z=QZweJZ5zQFjjAv(ev|^`U=_-jCTI71DYWXOsVduxFb70_$8>HAn(7Nl#(Opj?8R2
zW|?3+{l}CPI0*lm^Y|)*56tXDGgC@+N3U4xOOU3f
Date: Tue, 11 Jun 2024 22:30:12 +0200
Subject: [PATCH 14/67] don't integrate toc
---
docs/mkdocs.yml | 1 -
1 file changed, 1 deletion(-)
diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml
index e5f5e94224..d94407ab92 100644
--- a/docs/mkdocs.yml
+++ b/docs/mkdocs.yml
@@ -62,7 +62,6 @@ theme:
- navigation.path
- navigation.top
- toc.follow
- - toc.integrate
- content.code.annotate
extra:
From c1e70d4528fff9fe3e6487ce17104ef8048a113b Mon Sep 17 00:00:00 2001
From: phaer
Date: Tue, 11 Jun 2024 22:30:30 +0200
Subject: [PATCH 15/67] remove unecessary font declaration
---
docs/mkdocs.yml | 3 ---
1 file changed, 3 deletions(-)
diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml
index d94407ab92..eda0daf11a 100644
--- a/docs/mkdocs.yml
+++ b/docs/mkdocs.yml
@@ -48,9 +48,6 @@ theme:
name: material
favicon: favicon.png
logo: favicon.png
- font:
- text: Roboto
- code: Roboto Mono
features:
- search.suggest
- search.highlight
From 6ff41abd61f0992ea1139f5938a15433e72da755 Mon Sep 17 00:00:00 2001
From: phaer
Date: Thu, 13 Jun 2024 11:54:11 +0200
Subject: [PATCH 16/67] docs: fix devshell
---
modules/flake-parts/reference-website/default.nix | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/modules/flake-parts/reference-website/default.nix b/modules/flake-parts/reference-website/default.nix
index 78a0263cce..43bdff2ea2 100644
--- a/modules/flake-parts/reference-website/default.nix
+++ b/modules/flake-parts/reference-website/default.nix
@@ -106,11 +106,9 @@
in {
packages.reference = referenceDocs;
packages.website = website;
- devShells.mkdocs = let
+ devShells.website = let
pythonWithDeps = pkgs.python3.withPackages (
ps: [
- self.packages.${system}.mkdocs
- self.packages.${system}.mkdocs-material
ps.ipython
ps.black
ps.pytest
@@ -119,6 +117,7 @@
);
in
pkgs.mkShell {
+ inputsFrom = [self.packages.${system}.website];
packages = [
pythonWithDeps
];
From 5c6e0e5e9a9f23014e69c2dd08949ba1621fa9f7 Mon Sep 17 00:00:00 2001
From: phaer
Date: Thu, 13 Jun 2024 13:05:36 +0200
Subject: [PATCH 17/67] docs: add mkdocs-awesome-pages-plugin
---
docs/mkdocs.yml | 15 +----
docs/src/.pages | 14 +++++
docs/src/v1-api/.pages | 3 +
.../flake-parts/reference-website/default.nix | 21 +++++++
.../mkdocs-awesome-pages-plugin.nix | 56 +++++++++++++++++++
5 files changed, 95 insertions(+), 14 deletions(-)
create mode 100644 docs/src/.pages
create mode 100644 docs/src/v1-api/.pages
create mode 100644 modules/flake-parts/reference-website/mkdocs-awesome-pages-plugin.nix
diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml
index eda0daf11a..199044d3f2 100644
--- a/docs/mkdocs.yml
+++ b/docs/mkdocs.yml
@@ -5,6 +5,7 @@ site_dir: !ENV out
plugins:
- search
+ - awesome-pages
hooks:
- hooks/render_options.py
@@ -12,20 +13,6 @@ hooks:
extra_css:
- style.css
-
-nav:
- - "Home": index.md
- - "Getting Started": gettingstarted.md
- - Concepts:
- - "Modules": modules.md
- - "Overriding Dependencies": overrides.md
- - Examples:
- - "👉 example repository": https://github.com/nix-community/dream2nix/tree/main/examples/repo-with-packages
- - "👉 example repository using flakes": https://github.com/nix-community/dream2nix/tree/main/examples/repo-with-packages-flake)
- - "👉 example packages": https://github.com/nix-community/dream2nix/tree/main/examples/packages)
- - Reference:
- - "pip": reference/pip/index.md
-
markdown_extensions:
- tables
- admonition
diff --git a/docs/src/.pages b/docs/src/.pages
new file mode 100644
index 0000000000..a6cbad31ef
--- /dev/null
+++ b/docs/src/.pages
@@ -0,0 +1,14 @@
+nav:
+ - "Home": index.md
+ - "Getting Started": gettingstarted.md
+ - Concepts:
+ - "Modules": modules.md
+ - "Overriding Dependencies": overrides.md
+ - Reference: reference
+ - Examples:
+ - "👉 example repository": https://github.com/nix-community/dream2nix/tree/main/examples/repo-with-packages
+ - "👉 example repository using flakes": https://github.com/nix-community/dream2nix/tree/main/examples/repo-with-packages-flake)
+ - "👉 example packages": https://github.com/nix-community/dream2nix/tree/main/examples/packages)
+ - Notes:
+ - "v1 API design docs": v1-api
+ - development-roundups
diff --git a/docs/src/v1-api/.pages b/docs/src/v1-api/.pages
new file mode 100644
index 0000000000..eef6efe11d
--- /dev/null
+++ b/docs/src/v1-api/.pages
@@ -0,0 +1,3 @@
+nav:
+ - summary.md
+ - ...
diff --git a/modules/flake-parts/reference-website/default.nix b/modules/flake-parts/reference-website/default.nix
index 43bdff2ea2..9d2e47aeeb 100644
--- a/modules/flake-parts/reference-website/default.nix
+++ b/modules/flake-parts/reference-website/default.nix
@@ -84,6 +84,11 @@
mkdir -p "$target_dir"
ln -s ${sourcePath}/README.md "$target_dir/index.md"
ln -s ${options.docs.${name}.optionsJSON}/share/doc/nixos/options.json "$target_dir"
+ cat > "$target_dir/.pages" <
Date: Thu, 13 Jun 2024 13:37:45 +0200
Subject: [PATCH 18/67] docs: add devShell hook
---
modules/flake-parts/reference-website/default.nix | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/modules/flake-parts/reference-website/default.nix b/modules/flake-parts/reference-website/default.nix
index 9d2e47aeeb..4db5ec03ce 100644
--- a/modules/flake-parts/reference-website/default.nix
+++ b/modules/flake-parts/reference-website/default.nix
@@ -142,6 +142,15 @@
packages = [
pythonWithDeps
];
+
+ shellHook = ''
+ cd $PRJ_ROOT/docs
+ if [ ! -d src/reference ]; then
+ echo "linking .#reference to src/reference, you need to update this manually\
+ and remove it before a production build"
+ ln -s $(nix build ..#reference --no-link --print-out-paths) src/reference
+ fi
+ '';
};
};
}
From 66d8e84cee772dede4466989627a961704e27c85 Mon Sep 17 00:00:00 2001
From: phaer
Date: Thu, 13 Jun 2024 13:38:03 +0200
Subject: [PATCH 19/67] docs: remove anchors warning
...because it's not yet supported in our mkdocs version
---
docs/mkdocs.yml | 1 -
1 file changed, 1 deletion(-)
diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml
index 199044d3f2..11f22b3b2e 100644
--- a/docs/mkdocs.yml
+++ b/docs/mkdocs.yml
@@ -29,7 +29,6 @@ validation:
omitted_files: warn
absolute_links: warn
unrecognized_links: warn
- anchors: warn
theme:
name: material
From 318a87ff5550b6b4de35705e00f0b0f7940dd072 Mon Sep 17 00:00:00 2001
From: Yorick van Pelt
Date: Wed, 18 Oct 2023 11:46:13 +0200
Subject: [PATCH 20/67] filter-pypi-responses: stream package requests that hit
the proxy
mitmproxy was buffering all requests (except pythonhosted.*), causing
pip to time out when getting big packages from custom URLs.
Setting flow.response.stream in the responseheaders hook fixes this.
---
pkgs/fetchPipMetadata/filter-pypi-responses.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/pkgs/fetchPipMetadata/filter-pypi-responses.py b/pkgs/fetchPipMetadata/filter-pypi-responses.py
index eea126be0f..4c188568d2 100644
--- a/pkgs/fetchPipMetadata/filter-pypi-responses.py
+++ b/pkgs/fetchPipMetadata/filter-pypi-responses.py
@@ -85,6 +85,11 @@ def get_files_to_hide(pname, max_ts):
"""
+def responseheaders(flow: http.HTTPFlow) -> None:
+ if "/simple/" not in flow.request.url:
+ flow.response.stream = True
+
+
def response(flow: http.HTTPFlow) -> None:
if not "/simple/" in flow.request.url:
return
From b6bae07d51822c3ba2fceed14b4997fe5537f66e Mon Sep 17 00:00:00 2001
From: phaer
Date: Thu, 13 Jun 2024 14:39:22 +0200
Subject: [PATCH 21/67] docs move options reference template to own file
---
docs/hooks/render_options.py | 58 ++++---------------------------
docs/mkdocs.yml | 1 +
docs/theme/reference_options.html | 37 ++++++++++++++++++++
3 files changed, 44 insertions(+), 52 deletions(-)
create mode 100644 docs/theme/reference_options.html
diff --git a/docs/hooks/render_options.py b/docs/hooks/render_options.py
index 5f81352a67..e166acd6e2 100644
--- a/docs/hooks/render_options.py
+++ b/docs/hooks/render_options.py
@@ -38,7 +38,9 @@ def preprocess_options(options):
return tree
-def on_page_markdown(markdown: str, page: Page, config: MkDocsConfig, files: Files):
+def on_page_markdown(
+ markdown: str, page: Page, config: MkDocsConfig, files: Files
+) -> str | None:
if not is_reference_page(page):
return markdown
@@ -47,57 +49,9 @@ def on_page_markdown(markdown: str, page: Page, config: MkDocsConfig, files: Fil
if not options_path.exists():
log.error(f"{options_path} does not exist")
- jinja = config.theme.get_env()
- jinja.filters["slugify"] = slugify
- options_template = jinja.from_string(
- """
-## Options
-{%- for name, children in options.items() recursive %}
-
-##{{loop.depth * "#"}} {{ name }}
-
-{% if "type" in children -%}
-
-{{ children.description }}
-
-
-
- type |
- {{ children.type }} {{ "(read only)" if children.readOnly else "" }} |
-
-
- source |
- {%- for d in children.declarations -%}{{d.name}}{{ ", " if not loop.last else "" }}{%- endfor -%} |
-
- {%- if children.default -%}
-
- default |
- {{(children.default | default({})).text}} |
-
- {%- endif -%}
- {%- if children.exampl -%}
-
- example |
-
- {{(children.example | default({})).text | replace("\n", "\\n")}}
- |
-
- {%- endif -%}
-
-
-{#
-```json
-{{ children | tojson(indent=2)}}
-```
-#}
-
-{%- else -%}
-{{ loop(children.items()) }}
-{%- endif %}
-{%- endfor %}
-"""
- )
-
+ env = config.theme.get_env()
+ env.filters["slugify"] = slugify
+ options_template = env.get_template("reference_options.html")
with open(options_path, "r") as f:
options = json.load(f)
diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml
index 11f22b3b2e..025673b222 100644
--- a/docs/mkdocs.yml
+++ b/docs/mkdocs.yml
@@ -31,6 +31,7 @@ validation:
unrecognized_links: warn
theme:
+ custom_dir: theme
name: material
favicon: favicon.png
logo: favicon.png
diff --git a/docs/theme/reference_options.html b/docs/theme/reference_options.html
new file mode 100644
index 0000000000..38f6e84738
--- /dev/null
+++ b/docs/theme/reference_options.html
@@ -0,0 +1,37 @@
+## Options
+{%- for name, children in options.items() recursive %}
+
+##{{loop.depth * "#"}} {{ name }}
+
+{% if "type" in children -%}
+
+{{ children.description }}
+
+
+
+ type |
+ {{ children.type }} {{ "(read only)" if children.readOnly else "" }} |
+
+
+ source |
+ {%- for d in children.declarations -%}{{d.name}}{{ ", " if not loop.last else "" }}{%- endfor -%} |
+
+ {%- if children.default -%}
+
+ default |
+ {{(children.default | default({})).text}} |
+
+ {%- endif -%}
+ {%- if children.exampl -%}
+
+ example |
+
+ {{(children.example | default({})).text | replace("\n", "\\n")}}
+ |
+
+ {%- endif -%}
+
+{%- else -%}
+{{ loop(children.items()) }}
+{%- endif %}
+{%- endfor %}
From 9dba824ae8ef323dc7ec0ff8ec6d8d0ad330befa Mon Sep 17 00:00:00 2001
From: phaer
Date: Thu, 13 Jun 2024 15:23:15 +0200
Subject: [PATCH 22/67] docs: add reference header
---
docs/hooks/render_options.py | 17 ++++++++---------
docs/theme/reference_header.html | 16 ++++++++++++++++
modules/dream2nix/pip/README.md | 6 +++---
3 files changed, 27 insertions(+), 12 deletions(-)
create mode 100644 docs/theme/reference_header.html
diff --git a/docs/hooks/render_options.py b/docs/hooks/render_options.py
index e166acd6e2..ddc7dbc55a 100644
--- a/docs/hooks/render_options.py
+++ b/docs/hooks/render_options.py
@@ -43,18 +43,17 @@ def on_page_markdown(
) -> str | None:
if not is_reference_page(page):
return markdown
-
src_path = Path(config.docs_dir) / page.file.src_path
+ env = config.theme.get_env()
+
+ header = env.get_template("reference_header.html").render(meta=page.meta)
+
options_path = src_path.parent / "options.json"
if not options_path.exists():
log.error(f"{options_path} does not exist")
-
- env = config.theme.get_env()
- env.filters["slugify"] = slugify
- options_template = env.get_template("reference_options.html")
+ return None
with open(options_path, "r") as f:
- options = json.load(f)
+ options = preprocess_options(json.load(f))
+ reference = env.get_template("reference_options.html").render(options=options)
- tree = preprocess_options(options)
- rendered = options_template.render(options=tree)
- return markdown + rendered
+ return "\n\n".join([header, markdown, reference])
diff --git a/docs/theme/reference_header.html b/docs/theme/reference_header.html
new file mode 100644
index 0000000000..7e9b39618f
--- /dev/null
+++ b/docs/theme/reference_header.html
@@ -0,0 +1,16 @@
+
+
+ state: |
+ {{ meta.state | default("experimental") }} |
+
+
+ maintainers: |
+
+ {% if meta.maintainers -%}
+ {% for m in meta.maintainers -%}@{{m}}{{ ", " if not loop.last else "" }}{%- endfor -%}
+ {%- else -%}
+ noone, maybe you?
+ {% endif %}
+ |
+
+
diff --git a/modules/dream2nix/pip/README.md b/modules/dream2nix/pip/README.md
index 94db4aedc3..d5f05f5be4 100644
--- a/modules/dream2nix/pip/README.md
+++ b/modules/dream2nix/pip/README.md
@@ -1,8 +1,8 @@
---
+title: "pip"
state: released
-maintainers: @phaer
+maintainers:
+ - phaer
---
-# pip
-
Python packaging via [pip](https://pip.pypa.io/).
From a35e43c84c8acff4ae1aeb948b7651e64567f017 Mon Sep 17 00:00:00 2001
From: phaer
Date: Thu, 13 Jun 2024 15:47:32 +0200
Subject: [PATCH 23/67] docs: add missing readmes
(auto generated)
---
modules/dream2nix/WIP-groups/README.md | 7 +++++++
modules/dream2nix/WIP-haskell-cabal/README.md | 6 ++++++
modules/dream2nix/WIP-nodejs-builder-v3/README.md | 6 ++++++
modules/dream2nix/WIP-python-pdm/README.md | 6 ++++++
modules/dream2nix/WIP-python-pyproject/README.md | 6 ++++++
modules/dream2nix/WIP-spago/README.md | 6 ++++++
modules/dream2nix/buildPythonPackage/README.md | 6 ++++++
modules/dream2nix/buildRustPackage/README.md | 6 ++++++
modules/dream2nix/builtins-derivation/README.md | 6 ++++++
modules/dream2nix/core/README.md | 6 ++++++
modules/dream2nix/mkDerivation/README.md | 7 +++++++
modules/dream2nix/multi-derivation-package/README.md | 6 ++++++
modules/dream2nix/nixpkgs-overrides/README.md | 6 ++++++
modules/dream2nix/nodejs-devshell-v3/README.md | 6 ++++++
modules/dream2nix/nodejs-devshell/README.md | 6 ++++++
modules/dream2nix/nodejs-granular-v3/README.md | 6 ++++++
modules/dream2nix/nodejs-granular/README.md | 6 ++++++
modules/dream2nix/nodejs-node-modules-v3/README.md | 6 ++++++
modules/dream2nix/nodejs-node-modules/README.md | 6 ++++++
modules/dream2nix/nodejs-package-json-v3/README.md | 6 ++++++
modules/dream2nix/nodejs-package-json/README.md | 6 ++++++
modules/dream2nix/nodejs-package-lock-v3/README.md | 6 ++++++
modules/dream2nix/nodejs-package-lock/README.md | 6 ++++++
modules/dream2nix/overrides/README.md | 6 ++++++
modules/dream2nix/package-func/README.md | 6 ++++++
modules/dream2nix/php-composer-lock/README.md | 6 ++++++
modules/dream2nix/php-granular/README.md | 6 ++++++
modules/dream2nix/rust-cargo-lock/README.md | 6 ++++++
modules/dream2nix/rust-crane/README.md | 6 ++++++
29 files changed, 176 insertions(+)
create mode 100644 modules/dream2nix/WIP-haskell-cabal/README.md
create mode 100644 modules/dream2nix/WIP-nodejs-builder-v3/README.md
create mode 100644 modules/dream2nix/WIP-python-pdm/README.md
create mode 100644 modules/dream2nix/WIP-python-pyproject/README.md
create mode 100644 modules/dream2nix/WIP-spago/README.md
create mode 100644 modules/dream2nix/buildPythonPackage/README.md
create mode 100644 modules/dream2nix/buildRustPackage/README.md
create mode 100644 modules/dream2nix/builtins-derivation/README.md
create mode 100644 modules/dream2nix/core/README.md
create mode 100644 modules/dream2nix/multi-derivation-package/README.md
create mode 100644 modules/dream2nix/nixpkgs-overrides/README.md
create mode 100644 modules/dream2nix/nodejs-devshell-v3/README.md
create mode 100644 modules/dream2nix/nodejs-devshell/README.md
create mode 100644 modules/dream2nix/nodejs-granular-v3/README.md
create mode 100644 modules/dream2nix/nodejs-granular/README.md
create mode 100644 modules/dream2nix/nodejs-node-modules-v3/README.md
create mode 100644 modules/dream2nix/nodejs-node-modules/README.md
create mode 100644 modules/dream2nix/nodejs-package-json-v3/README.md
create mode 100644 modules/dream2nix/nodejs-package-json/README.md
create mode 100644 modules/dream2nix/nodejs-package-lock-v3/README.md
create mode 100644 modules/dream2nix/nodejs-package-lock/README.md
create mode 100644 modules/dream2nix/overrides/README.md
create mode 100644 modules/dream2nix/package-func/README.md
create mode 100644 modules/dream2nix/php-composer-lock/README.md
create mode 100644 modules/dream2nix/php-granular/README.md
create mode 100644 modules/dream2nix/rust-cargo-lock/README.md
create mode 100644 modules/dream2nix/rust-crane/README.md
diff --git a/modules/dream2nix/WIP-groups/README.md b/modules/dream2nix/WIP-groups/README.md
index d3d0b75f7a..08981c2831 100644
--- a/modules/dream2nix/WIP-groups/README.md
+++ b/modules/dream2nix/WIP-groups/README.md
@@ -1,3 +1,10 @@
+---
+title: "groups"
+state: experimental
+maintainers:
+ - DavHau
+---
+
Module to deal with package sets (so called groups in dream2nix)
## Separate different kinds of dependencies
diff --git a/modules/dream2nix/WIP-haskell-cabal/README.md b/modules/dream2nix/WIP-haskell-cabal/README.md
new file mode 100644
index 0000000000..791aa78c08
--- /dev/null
+++ b/modules/dream2nix/WIP-haskell-cabal/README.md
@@ -0,0 +1,6 @@
+---
+title: "haskell-cabal"
+state: "experimental"
+maintainers:
+ - DavHau
+---
diff --git a/modules/dream2nix/WIP-nodejs-builder-v3/README.md b/modules/dream2nix/WIP-nodejs-builder-v3/README.md
new file mode 100644
index 0000000000..2389e1ed72
--- /dev/null
+++ b/modules/dream2nix/WIP-nodejs-builder-v3/README.md
@@ -0,0 +1,6 @@
+---
+title: "nodejs-builder-v3"
+state: "experimental"
+maintainers:
+ - DavHau
+---
diff --git a/modules/dream2nix/WIP-python-pdm/README.md b/modules/dream2nix/WIP-python-pdm/README.md
new file mode 100644
index 0000000000..d58ad83d4b
--- /dev/null
+++ b/modules/dream2nix/WIP-python-pdm/README.md
@@ -0,0 +1,6 @@
+---
+title: "python-pdm"
+state: "experimental"
+maintainers:
+ - DavHau
+---
diff --git a/modules/dream2nix/WIP-python-pyproject/README.md b/modules/dream2nix/WIP-python-pyproject/README.md
new file mode 100644
index 0000000000..f74954af00
--- /dev/null
+++ b/modules/dream2nix/WIP-python-pyproject/README.md
@@ -0,0 +1,6 @@
+---
+title: "python-pyproject"
+state: "experimental"
+maintainers:
+ - DavHau
+---
diff --git a/modules/dream2nix/WIP-spago/README.md b/modules/dream2nix/WIP-spago/README.md
new file mode 100644
index 0000000000..2ed0df89d5
--- /dev/null
+++ b/modules/dream2nix/WIP-spago/README.md
@@ -0,0 +1,6 @@
+---
+title: "spago"
+state: "experimental"
+maintainers:
+ - DavHau
+---
diff --git a/modules/dream2nix/buildPythonPackage/README.md b/modules/dream2nix/buildPythonPackage/README.md
new file mode 100644
index 0000000000..d8cd414e40
--- /dev/null
+++ b/modules/dream2nix/buildPythonPackage/README.md
@@ -0,0 +1,6 @@
+---
+title: "buildPythonPackage"
+state: "released"
+maintainers:
+ - DavHau
+---
diff --git a/modules/dream2nix/buildRustPackage/README.md b/modules/dream2nix/buildRustPackage/README.md
new file mode 100644
index 0000000000..d3d9d32329
--- /dev/null
+++ b/modules/dream2nix/buildRustPackage/README.md
@@ -0,0 +1,6 @@
+---
+title: "buildRustPackage"
+state: "released"
+maintainers:
+ - DavHau
+---
diff --git a/modules/dream2nix/builtins-derivation/README.md b/modules/dream2nix/builtins-derivation/README.md
new file mode 100644
index 0000000000..06c573c5ba
--- /dev/null
+++ b/modules/dream2nix/builtins-derivation/README.md
@@ -0,0 +1,6 @@
+---
+title: "builtins-derivation"
+state: "released"
+maintainers:
+ - DavHau
+---
diff --git a/modules/dream2nix/core/README.md b/modules/dream2nix/core/README.md
new file mode 100644
index 0000000000..5fc91cc0ef
--- /dev/null
+++ b/modules/dream2nix/core/README.md
@@ -0,0 +1,6 @@
+---
+title: "core"
+state: "released"
+maintainers:
+ - DavHau
+---
diff --git a/modules/dream2nix/mkDerivation/README.md b/modules/dream2nix/mkDerivation/README.md
index afec0723dc..2367d7a687 100644
--- a/modules/dream2nix/mkDerivation/README.md
+++ b/modules/dream2nix/mkDerivation/README.md
@@ -1 +1,8 @@
+---
+title: "mkDerivation"
+state: released
+maintainers:
+ - DavHau
+---
+
A package module based on the mkDerivation builder from nixpkgs
diff --git a/modules/dream2nix/multi-derivation-package/README.md b/modules/dream2nix/multi-derivation-package/README.md
new file mode 100644
index 0000000000..7c4da57ee6
--- /dev/null
+++ b/modules/dream2nix/multi-derivation-package/README.md
@@ -0,0 +1,6 @@
+---
+title: "multi-derivation-package"
+state: "released"
+maintainers:
+ - DavHau
+---
diff --git a/modules/dream2nix/nixpkgs-overrides/README.md b/modules/dream2nix/nixpkgs-overrides/README.md
new file mode 100644
index 0000000000..97b1458f58
--- /dev/null
+++ b/modules/dream2nix/nixpkgs-overrides/README.md
@@ -0,0 +1,6 @@
+---
+title: "nixpkgs-overrides"
+state: "released"
+maintainers:
+ - DavHau
+---
diff --git a/modules/dream2nix/nodejs-devshell-v3/README.md b/modules/dream2nix/nodejs-devshell-v3/README.md
new file mode 100644
index 0000000000..6c2abeec73
--- /dev/null
+++ b/modules/dream2nix/nodejs-devshell-v3/README.md
@@ -0,0 +1,6 @@
+---
+title: "nodejs-devshell-v3"
+state: "released"
+maintainers:
+ - DavHau
+---
diff --git a/modules/dream2nix/nodejs-devshell/README.md b/modules/dream2nix/nodejs-devshell/README.md
new file mode 100644
index 0000000000..cb91d6e6b1
--- /dev/null
+++ b/modules/dream2nix/nodejs-devshell/README.md
@@ -0,0 +1,6 @@
+---
+title: "nodejs-devshell"
+state: "released"
+maintainers:
+ - DavHau
+---
diff --git a/modules/dream2nix/nodejs-granular-v3/README.md b/modules/dream2nix/nodejs-granular-v3/README.md
new file mode 100644
index 0000000000..01a661b67b
--- /dev/null
+++ b/modules/dream2nix/nodejs-granular-v3/README.md
@@ -0,0 +1,6 @@
+---
+title: "nodejs-granular-v3"
+state: "released"
+maintainers:
+ - DavHau
+---
diff --git a/modules/dream2nix/nodejs-granular/README.md b/modules/dream2nix/nodejs-granular/README.md
new file mode 100644
index 0000000000..7ec20d0e46
--- /dev/null
+++ b/modules/dream2nix/nodejs-granular/README.md
@@ -0,0 +1,6 @@
+---
+title: "nodejs-granular"
+state: "released"
+maintainers:
+ - DavHau
+---
diff --git a/modules/dream2nix/nodejs-node-modules-v3/README.md b/modules/dream2nix/nodejs-node-modules-v3/README.md
new file mode 100644
index 0000000000..487413ef35
--- /dev/null
+++ b/modules/dream2nix/nodejs-node-modules-v3/README.md
@@ -0,0 +1,6 @@
+---
+title: "nodejs-node-modules-v3"
+state: "released"
+maintainers:
+ - DavHau
+---
diff --git a/modules/dream2nix/nodejs-node-modules/README.md b/modules/dream2nix/nodejs-node-modules/README.md
new file mode 100644
index 0000000000..a89169a129
--- /dev/null
+++ b/modules/dream2nix/nodejs-node-modules/README.md
@@ -0,0 +1,6 @@
+---
+title: "nodejs-node-modules"
+state: "released"
+maintainers:
+ - DavHau
+---
diff --git a/modules/dream2nix/nodejs-package-json-v3/README.md b/modules/dream2nix/nodejs-package-json-v3/README.md
new file mode 100644
index 0000000000..6dd6744972
--- /dev/null
+++ b/modules/dream2nix/nodejs-package-json-v3/README.md
@@ -0,0 +1,6 @@
+---
+title: "nodejs-package-json-v3"
+state: "released"
+maintainers:
+ - DavHau
+---
diff --git a/modules/dream2nix/nodejs-package-json/README.md b/modules/dream2nix/nodejs-package-json/README.md
new file mode 100644
index 0000000000..e3d657af91
--- /dev/null
+++ b/modules/dream2nix/nodejs-package-json/README.md
@@ -0,0 +1,6 @@
+---
+title: "nodejs-package-json"
+state: "released"
+maintainers:
+ - DavHau
+---
diff --git a/modules/dream2nix/nodejs-package-lock-v3/README.md b/modules/dream2nix/nodejs-package-lock-v3/README.md
new file mode 100644
index 0000000000..51bb23d3d7
--- /dev/null
+++ b/modules/dream2nix/nodejs-package-lock-v3/README.md
@@ -0,0 +1,6 @@
+---
+title: "nodejs-package-lock-v3"
+state: "released"
+maintainers:
+ - DavHau
+---
diff --git a/modules/dream2nix/nodejs-package-lock/README.md b/modules/dream2nix/nodejs-package-lock/README.md
new file mode 100644
index 0000000000..afd6b2e691
--- /dev/null
+++ b/modules/dream2nix/nodejs-package-lock/README.md
@@ -0,0 +1,6 @@
+---
+title: "nodejs-package-lock"
+state: "released"
+maintainers:
+ - DavHau
+---
diff --git a/modules/dream2nix/overrides/README.md b/modules/dream2nix/overrides/README.md
new file mode 100644
index 0000000000..21561c3de5
--- /dev/null
+++ b/modules/dream2nix/overrides/README.md
@@ -0,0 +1,6 @@
+---
+title: "overrides"
+state: "released"
+maintainers:
+ - DavHau
+---
diff --git a/modules/dream2nix/package-func/README.md b/modules/dream2nix/package-func/README.md
new file mode 100644
index 0000000000..3075eb8700
--- /dev/null
+++ b/modules/dream2nix/package-func/README.md
@@ -0,0 +1,6 @@
+---
+title: "package-func"
+state: "released"
+maintainers:
+ - DavHau
+---
diff --git a/modules/dream2nix/php-composer-lock/README.md b/modules/dream2nix/php-composer-lock/README.md
new file mode 100644
index 0000000000..3b88720773
--- /dev/null
+++ b/modules/dream2nix/php-composer-lock/README.md
@@ -0,0 +1,6 @@
+---
+title: "php-composer-lock"
+state: "released"
+maintainers:
+ - DavHau
+---
diff --git a/modules/dream2nix/php-granular/README.md b/modules/dream2nix/php-granular/README.md
new file mode 100644
index 0000000000..f8a3818644
--- /dev/null
+++ b/modules/dream2nix/php-granular/README.md
@@ -0,0 +1,6 @@
+---
+title: "php-granular"
+state: "released"
+maintainers:
+ - DavHau
+---
diff --git a/modules/dream2nix/rust-cargo-lock/README.md b/modules/dream2nix/rust-cargo-lock/README.md
new file mode 100644
index 0000000000..a027d6fd75
--- /dev/null
+++ b/modules/dream2nix/rust-cargo-lock/README.md
@@ -0,0 +1,6 @@
+---
+title: "rust-cargo-lock"
+state: "released"
+maintainers:
+ - DavHau
+---
diff --git a/modules/dream2nix/rust-crane/README.md b/modules/dream2nix/rust-crane/README.md
new file mode 100644
index 0000000000..20ea5fcf6d
--- /dev/null
+++ b/modules/dream2nix/rust-crane/README.md
@@ -0,0 +1,6 @@
+---
+title: "rust-crane"
+state: "released"
+maintainers:
+ - DavHau
+---
From 8aa4a44eaf2df83f504e9fd56809f8407f642672 Mon Sep 17 00:00:00 2001
From: phaer
Date: Fri, 14 Jun 2024 12:23:10 +0200
Subject: [PATCH 24/67] docs: link github repo
---
docs/mkdocs.yml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml
index 025673b222..9ad333266d 100644
--- a/docs/mkdocs.yml
+++ b/docs/mkdocs.yml
@@ -3,6 +3,10 @@ docs_dir: "src"
site_url: "https://nix-community.github.io/dream2nix"
site_dir: !ENV out
+repo_url: https://github.com/nix-community/dream2nix
+repo_name: nix-community/dream2nix
+edit_uri: edit/main/docs/src/
+
plugins:
- search
- awesome-pages
From 32023d41ed6e8daee6910996b2c84dad5f04388b Mon Sep 17 00:00:00 2001
From: phaer
Date: Fri, 14 Jun 2024 13:39:41 +0200
Subject: [PATCH 25/67] docs: enable permalink links for headings
---
docs/mkdocs.yml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml
index 9ad333266d..e0b0ec09d6 100644
--- a/docs/mkdocs.yml
+++ b/docs/mkdocs.yml
@@ -18,6 +18,8 @@ extra_css:
- style.css
markdown_extensions:
+ - toc:
+ permalink: true
- tables
- admonition
- pymdownx.escapeall
From ea02037ba9c4c3e7e1722b784c961acb2aca6a9c Mon Sep 17 00:00:00 2001
From: phaer
Date: Fri, 14 Jun 2024 13:40:08 +0200
Subject: [PATCH 26/67] docs: force symlinks for src/reference
---
modules/flake-parts/reference-website/default.nix | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/flake-parts/reference-website/default.nix b/modules/flake-parts/reference-website/default.nix
index 4db5ec03ce..a513a832d9 100644
--- a/modules/flake-parts/reference-website/default.nix
+++ b/modules/flake-parts/reference-website/default.nix
@@ -106,7 +106,7 @@
];
} ''
cp -rL --no-preserve=mode ${dream2nixRoot}/docs/* .
- ln -s ${referenceDocs} ./src/reference
+ ln -sfT ${referenceDocs} ./src/reference
mkdocs build
'';
in {
@@ -148,7 +148,7 @@
if [ ! -d src/reference ]; then
echo "linking .#reference to src/reference, you need to update this manually\
and remove it before a production build"
- ln -s $(nix build ..#reference --no-link --print-out-paths) src/reference
+ ln -sfT $(nix build ..#reference --no-link --print-out-paths) src/reference
fi
'';
};
From 361f402625a2fde1e0d57690378633bfb9a5dde0 Mon Sep 17 00:00:00 2001
From: phaer
Date: Fri, 14 Jun 2024 14:27:49 +0200
Subject: [PATCH 27/67] docs: s/reference(Docs)?/optionsReference/
---
modules/flake-parts/reference-website/default.nix | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/modules/flake-parts/reference-website/default.nix b/modules/flake-parts/reference-website/default.nix
index a513a832d9..f6720a9b32 100644
--- a/modules/flake-parts/reference-website/default.nix
+++ b/modules/flake-parts/reference-website/default.nix
@@ -74,7 +74,7 @@
inherit modules;
};
- referenceDocs = let
+ optionsReference = let
publicModules =
lib.filterAttrs
(n: v: lib.pathExists (v + "/README.md"))
@@ -102,11 +102,11 @@
pkgs.python3.pkgs.mkdocs
pkgs.python3.pkgs.mkdocs-material
self.packages.${system}.mkdocs-awesome-pages-plugin
- referenceDocs
+ optionsReference
];
} ''
cp -rL --no-preserve=mode ${dream2nixRoot}/docs/* .
- ln -sfT ${referenceDocs} ./src/reference
+ ln -sfT ${optionsReference} ./src/reference
mkdocs build
'';
in {
@@ -125,7 +125,7 @@
pythonOlder
;
};
- packages.reference = referenceDocs;
+ packages.optionsReference = optionsReference;
packages.website = website;
devShells.website = let
pythonWithDeps = pkgs.python3.withPackages (
From b80a263443d9dc7b755645f3db3b62efb85b2ab0 Mon Sep 17 00:00:00 2001
From: phaer
Date: Fri, 14 Jun 2024 14:28:30 +0200
Subject: [PATCH 28/67] add docs/README.md
---
docs/README.md | 67 ++++++++++++++++++++++++++++++++++++++++++++++++
docs/src/.pages | 1 +
docs/src/docs.md | 1 +
3 files changed, 69 insertions(+)
create mode 100644 docs/README.md
create mode 120000 docs/src/docs.md
diff --git a/docs/README.md b/docs/README.md
new file mode 100644
index 0000000000..ac59c30283
--- /dev/null
+++ b/docs/README.md
@@ -0,0 +1,67 @@
+# About this Documentation
+
+Dream2nix documentation is generated from markdown via
+[mkdocs](https://www.mkdocs.org/) and [mkdocs-material](https://squidfunk.github.io/mkdocs-material/).
+
+## Build
+
+You can build and server it locally with, i.e.:
+
+``` shellsession
+nix build .#website
+python3 -m http.server -d ./result
+```
+
+# Development shell
+
+Or alternatively run a development environment with:
+
+``` shellsession
+nix develop .#website
+```
+
+Upon entering the devshell, it will change into
+`./docs` and symlink a build of the [options reference](#options-reference)
+into `./docs/src/reference`.
+
+Normal builds will always use an up-to-date options reference,
+but during development you need to update this symlink yourself
+and remove it after use.
+
+i.e. from inside the shell in `./docs`:
+
+``` shellsession
+# update
+ln -sfT $(nix build --print-out-paths --no-link ..#reference) ./src/reference
+# remove
+rm ./src/reference
+```
+
+## Options Reference
+
+The reference documentation for [modules](./modules.md) is auto-generated via
+a custom hook in `docs/hooks/render_options.py` and a derivation in
+`.#optionsReference`.
+
+The derivation includes, for each module, an `options.json` file as generated by nix via `pkgs.nixosOptionsDoc` as well as a `README.md` file, copied from the modules source directory. The existence of such a `README.md` is used as an indicator on whether to include a module in the reference documentation.
+
+The hook runs whenever mkdocs renders one of the `README.md`s. Each of them gets concatenated with header and options reference, after the latter are run through jinja templates in `./docs/theme`.
+
+
+## Notes on Markdown
+
+Mkdocs uses a markdown dialect from [Python-Markdown](https://python-markdown.github.io/) with various, optional extensions listed in `./docs/mkdocs.yml`.
+
+This is different from the CommonMark dialect, as implemented by [markdown-it-py](https://pypi.org/project/markdown-it-py/) and used in NixOS official documentation.
+
+The differences between both don't seem to be too relevant for the markdown features used in our [options reference](#options-reference), but it's good
+to be aware of them when writing longer prose.
+
+[mkdocs-materials reference](https://squidfunk.github.io/mkdocs-material/reference) provides a
+good overview on useful extensions.
+
+## CI
+
+The documentation is published on GitHub pages via a GitHub action, defined in [.github/workflows/pages.yml](https://github.com/nix-community/dream2nix/blob/main/.github/workflows/pages.yml)
+
+
diff --git a/docs/src/.pages b/docs/src/.pages
index a6cbad31ef..717f945aab 100644
--- a/docs/src/.pages
+++ b/docs/src/.pages
@@ -9,6 +9,7 @@ nav:
- "👉 example repository": https://github.com/nix-community/dream2nix/tree/main/examples/repo-with-packages
- "👉 example repository using flakes": https://github.com/nix-community/dream2nix/tree/main/examples/repo-with-packages-flake)
- "👉 example packages": https://github.com/nix-community/dream2nix/tree/main/examples/packages)
+ - Documentation: docs.md
- Notes:
- "v1 API design docs": v1-api
- development-roundups
diff --git a/docs/src/docs.md b/docs/src/docs.md
new file mode 120000
index 0000000000..32d46ee883
--- /dev/null
+++ b/docs/src/docs.md
@@ -0,0 +1 @@
+../README.md
\ No newline at end of file
From d8100dc310dc967acfd76271c94afeec2a5fa1fc Mon Sep 17 00:00:00 2001
From: phaer
Date: Fri, 14 Jun 2024 14:28:40 +0200
Subject: [PATCH 29/67] add docs/src/reference to .gitignore
---
.gitignore | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/.gitignore b/.gitignore
index 61d8e51f4b..baa520fbb6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,4 +5,6 @@
result
interpreter
__pycache__
-*.egg-info
\ No newline at end of file
+*.egg-info
+# symlink for devshell
+docs/src/reference
From 4266fcc0abd67af6f4a5aa11a77fe81c64a00437 Mon Sep 17 00:00:00 2001
From: phaer
Date: Fri, 14 Jun 2024 15:31:43 +0200
Subject: [PATCH 30/67] docs: fix typo
---
docs/theme/reference_options.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/theme/reference_options.html b/docs/theme/reference_options.html
index 38f6e84738..65aed7668c 100644
--- a/docs/theme/reference_options.html
+++ b/docs/theme/reference_options.html
@@ -22,7 +22,7 @@
{{(children.default | default({})).text}} |
{%- endif -%}
- {%- if children.exampl -%}
+ {%- if children.example -%}
example |
From d4c77a62d66a2df512b2bd5259fea3275a1db4e5 Mon Sep 17 00:00:00 2001
From: phaer
Date: Fri, 14 Jun 2024 15:32:42 +0200
Subject: [PATCH 31/67] docs: children -> option
---
docs/README.md | 2 +-
docs/theme/reference_options.html | 20 ++++++++++----------
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/docs/README.md b/docs/README.md
index ac59c30283..7f02c62d69 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -32,7 +32,7 @@ i.e. from inside the shell in `./docs`:
``` shellsession
# update
-ln -sfT $(nix build --print-out-paths --no-link ..#reference) ./src/reference
+ln -sfT $(nix build --print-out-paths --no-link ..#optionsReference) ./src/reference
# remove
rm ./src/reference
```
diff --git a/docs/theme/reference_options.html b/docs/theme/reference_options.html
index 65aed7668c..178b2005ce 100644
--- a/docs/theme/reference_options.html
+++ b/docs/theme/reference_options.html
@@ -1,37 +1,37 @@
## Options
-{%- for name, children in options.items() recursive %}
+{%- for name, option in options.items() recursive %}
##{{loop.depth * "#"}} {{ name }}
-{% if "type" in children -%}
+{% if "type" in option -%}
-{{ children.description }}
+{{ option.description }}
type |
- {{ children.type }} {{ "(read only)" if children.readOnly else "" }} |
+ {{ option.type }} {{ "(read only)" if option.readOnly else "" }} |
source |
- {%- for d in children.declarations -%}{{d.name}}{{ ", " if not loop.last else "" }}{%- endfor -%} |
+ {%- for d in option.declarations -%}{{d.name}}{{ ", " if not loop.last else "" }}{%- endfor -%} |
- {%- if children.default -%}
+ {%- if option.default -%}
default |
- {{(children.default | default({})).text}} |
+ {{(option.default | default({})).text}} |
{%- endif -%}
- {%- if children.example -%}
+ {%- if option.example -%}
example |
- {{(children.example | default({})).text | replace("\n", "\\n")}}
+ {{(option.example | default({})).text | replace("\n", "\\n")}}
|
{%- endif -%}
{%- else -%}
-{{ loop(children.items()) }}
+{{ loop(option.items()) }}
{%- endif %}
{%- endfor %}
From f2f428f7584951a2ca5e0fa07ff02be9120729a9 Mon Sep 17 00:00:00 2001
From: phaer
Date: Sat, 15 Jun 2024 11:53:27 +0200
Subject: [PATCH 32/67] docs: add extra header to reference docs
---
docs/theme/reference_header.html | 2 ++
1 file changed, 2 insertions(+)
diff --git a/docs/theme/reference_header.html b/docs/theme/reference_header.html
index 7e9b39618f..9ab861bafe 100644
--- a/docs/theme/reference_header.html
+++ b/docs/theme/reference_header.html
@@ -14,3 +14,5 @@
|
+
+## Introduction
From 8cf6639c8ba67caff0e19efd979aafc24c7ff83d Mon Sep 17 00:00:00 2001
From: phaer
Date: Sat, 15 Jun 2024 20:34:53 +0200
Subject: [PATCH 33/67] docs: fix missing options of submodules
---
docs/hooks/render_options.py | 9 ++++-----
docs/theme/reference_options.html | 10 +++++-----
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/docs/hooks/render_options.py b/docs/hooks/render_options.py
index ddc7dbc55a..be3f194c02 100644
--- a/docs/hooks/render_options.py
+++ b/docs/hooks/render_options.py
@@ -19,7 +19,7 @@ def slugify(name: str) -> str:
def preprocess_options(options):
- tree = {}
+ tree = dict()
for name, option in options.items():
if name.startswith("_module"):
continue
@@ -28,13 +28,12 @@ def preprocess_options(options):
for index, part in enumerate(parts):
if part not in cursor:
if index + 1 == len(parts):
- cursor[part] = option
+ cursor[part] = dict(**option, children={})
else:
- cursor[part] = dict()
+ cursor[part] = dict(children=dict())
cursor = cursor[part]
else:
- cursor = cursor[part]
-
+ cursor = cursor[part]["children"]
return tree
diff --git a/docs/theme/reference_options.html b/docs/theme/reference_options.html
index 178b2005ce..de3c9a2538 100644
--- a/docs/theme/reference_options.html
+++ b/docs/theme/reference_options.html
@@ -3,10 +3,9 @@
##{{loop.depth * "#"}} {{ name }}
-{% if "type" in option -%}
-
-{{ option.description }}
+{{ option.description or '' }}
+{% if "type" in option %}
type |
@@ -31,7 +30,8 @@
{%- endif -%}
-{%- else -%}
-{{ loop(option.items()) }}
+{% endif %}
+{%- if option.children -%}
+{{ loop(option.children.items()) }}
{%- endif %}
{%- endfor %}
From 7aca3e34ff2dce7810e5662c8224ad123c41a812 Mon Sep 17 00:00:00 2001
From: phaer
Date: Sun, 16 Jun 2024 13:35:07 +0200
Subject: [PATCH 34/67] docs: fix rendering of examples
---
docs/theme/reference_options.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/theme/reference_options.html b/docs/theme/reference_options.html
index de3c9a2538..c236be8356 100644
--- a/docs/theme/reference_options.html
+++ b/docs/theme/reference_options.html
@@ -25,7 +25,7 @@
example |
- {{(option.example | default({})).text | replace("\n", "\\n")}}
+ {{(option.example | default({})).text}}
|
{%- endif -%}
From df887721f78c460ae33542a3c7febc68e7524721 Mon Sep 17 00:00:00 2001
From: phaer
Date: Sun, 16 Jun 2024 14:39:21 +0200
Subject: [PATCH 35/67] reference options: escape < and >
---
docs/theme/reference_options.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/theme/reference_options.html b/docs/theme/reference_options.html
index c236be8356..a176efc6b3 100644
--- a/docs/theme/reference_options.html
+++ b/docs/theme/reference_options.html
@@ -1,7 +1,7 @@
## Options
{%- for name, option in options.items() recursive %}
-##{{loop.depth * "#"}} {{ name }}
+##{{loop.depth * "#"}} {{ name.replace("<", "<").replace(">", ">") }}
{{ option.description or '' }}
From e62c7b759abc563ec6b26c5fbdcefdce82e2876c Mon Sep 17 00:00:00 2001
From: phaer
Date: Sun, 16 Jun 2024 14:39:49 +0200
Subject: [PATCH 36/67] docs: custom sort for rendered options
---
docs/hooks/render_options.py | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/docs/hooks/render_options.py b/docs/hooks/render_options.py
index be3f194c02..a4d4a218a6 100644
--- a/docs/hooks/render_options.py
+++ b/docs/hooks/render_options.py
@@ -1,6 +1,8 @@
import logging
import json
from pathlib import Path
+from collections import OrderedDict
+from typing import Dict, Tuple
from mkdocs.structure.pages import Page
from mkdocs.structure.files import Files
@@ -18,6 +20,20 @@ def slugify(name: str) -> str:
return name.lower().replace(".", "-")
+def sort_options(item: Tuple[str, Dict]):
+ """
+ Sort the modules. First the one the page is about,
+ then single options, then the rest, alphabetically
+ """
+ name, option = item
+ if name == "pip":
+ return -1
+ elif len(option["children"]) == 0:
+ return 0
+ else:
+ return ord(name[0])
+
+
def preprocess_options(options):
tree = dict()
for name, option in options.items():
@@ -34,7 +50,7 @@ def preprocess_options(options):
cursor = cursor[part]
else:
cursor = cursor[part]["children"]
- return tree
+ return OrderedDict(sorted(tree.items(), key=sort_options))
def on_page_markdown(
From 4175449e9380c0f7f433ca78bce5fd0918c0fac1 Mon Sep 17 00:00:00 2001
From: phaer
Date: Tue, 18 Jun 2024 09:10:48 +0200
Subject: [PATCH 37/67] docs: syntax highlighting in reference
---
docs/hooks/render_options.py | 10 ++++++++--
docs/theme/reference_options.html | 4 ++--
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/docs/hooks/render_options.py b/docs/hooks/render_options.py
index a4d4a218a6..64b1f9d538 100644
--- a/docs/hooks/render_options.py
+++ b/docs/hooks/render_options.py
@@ -9,6 +9,11 @@
from mkdocs.config.defaults import MkDocsConfig
+from pygments import highlight
+from pygments.lexers import get_lexer_by_name
+from pygments.formatters import HtmlFormatter
+
+
log = logging.getLogger("mkdocs")
@@ -16,8 +21,8 @@ def is_reference_page(page: Page) -> bool:
return page.file.src_path.startswith("reference/")
-def slugify(name: str) -> str:
- return name.lower().replace(".", "-")
+def pygments(code: str, lang: str) -> str:
+ return highlight(code, get_lexer_by_name(lang), HtmlFormatter())
def sort_options(item: Tuple[str, Dict]):
@@ -60,6 +65,7 @@ def on_page_markdown(
return markdown
src_path = Path(config.docs_dir) / page.file.src_path
env = config.theme.get_env()
+ env.filters["pygments"] = pygments
header = env.get_template("reference_header.html").render(meta=page.meta)
diff --git a/docs/theme/reference_options.html b/docs/theme/reference_options.html
index a176efc6b3..bcf9149009 100644
--- a/docs/theme/reference_options.html
+++ b/docs/theme/reference_options.html
@@ -18,14 +18,14 @@
{%- if option.default -%}
default |
- {{(option.default | default({})).text}} |
+ {{(option.default | default({})).text | pygments("nix")}} |
{%- endif -%}
{%- if option.example -%}
example |
- {{(option.example | default({})).text}}
+ {{(option.example | default({})).text | pygments("nix")}}
|
{%- endif -%}
From 855cfa5e77a069996f0ad61439e56da40f7c2c3f Mon Sep 17 00:00:00 2001
From: phaer
Date: Tue, 18 Jun 2024 09:11:18 +0200
Subject: [PATCH 38/67] docs: fix display of collapsible sidebar items
---
docs/src/style.css | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/src/style.css b/docs/src/style.css
index 899bf2d702..4e3b12e677 100644
--- a/docs/src/style.css
+++ b/docs/src/style.css
@@ -2,3 +2,7 @@
background-color: white;
border-radius: 100%;
}
+
+[data-md-component="toc"] .md-nav__link {
+ display: inline-flex;
+}
From b4ceedaafd680b60183fcc13770c282904ad2b8a Mon Sep 17 00:00:00 2001
From: phaer
Date: Tue, 18 Jun 2024 10:46:22 +0200
Subject: [PATCH 39/67] docs: fix sorting, don't hardcode pip ;)
---
docs/hooks/render_options.py | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/docs/hooks/render_options.py b/docs/hooks/render_options.py
index 64b1f9d538..76c189e499 100644
--- a/docs/hooks/render_options.py
+++ b/docs/hooks/render_options.py
@@ -25,13 +25,13 @@ def pygments(code: str, lang: str) -> str:
return highlight(code, get_lexer_by_name(lang), HtmlFormatter())
-def sort_options(item: Tuple[str, Dict]):
+def sort_options(item: Tuple[str, Dict], module_name: str) -> int:
"""
Sort the modules. First the one the page is about,
then single options, then the rest, alphabetically
"""
name, option = item
- if name == "pip":
+ if name == module_name:
return -1
elif len(option["children"]) == 0:
return 0
@@ -39,7 +39,7 @@ def sort_options(item: Tuple[str, Dict]):
return ord(name[0])
-def preprocess_options(options):
+def preprocess_options(options, module_name):
tree = dict()
for name, option in options.items():
if name.startswith("_module"):
@@ -55,7 +55,7 @@ def preprocess_options(options):
cursor = cursor[part]
else:
cursor = cursor[part]["children"]
- return OrderedDict(sorted(tree.items(), key=sort_options))
+ return OrderedDict(sorted(tree.items(), key=lambda i: sort_options(i, module_name)))
def on_page_markdown(
@@ -64,6 +64,7 @@ def on_page_markdown(
if not is_reference_page(page):
return markdown
src_path = Path(config.docs_dir) / page.file.src_path
+ module_name = src_path.parent.stem
env = config.theme.get_env()
env.filters["pygments"] = pygments
@@ -74,7 +75,7 @@ def on_page_markdown(
log.error(f"{options_path} does not exist")
return None
with open(options_path, "r") as f:
- options = preprocess_options(json.load(f))
+ options = preprocess_options(json.load(f), module_name)
reference = env.get_template("reference_options.html").render(options=options)
return "\n\n".join([header, markdown, reference])
From 2bf5e20f2300627a895f63b3e54473b4fc605cd1 Mon Sep 17 00:00:00 2001
From: phaer
Date: Tue, 18 Jun 2024 10:46:46 +0200
Subject: [PATCH 40/67] docs: add note regarding upstream PR
for mkdocs-awesome-pages-plugin
---
.../reference-website/mkdocs-awesome-pages-plugin.nix | 3 +++
1 file changed, 3 insertions(+)
diff --git a/modules/flake-parts/reference-website/mkdocs-awesome-pages-plugin.nix b/modules/flake-parts/reference-website/mkdocs-awesome-pages-plugin.nix
index f7bf173400..bd8e10e8a4 100644
--- a/modules/flake-parts/reference-website/mkdocs-awesome-pages-plugin.nix
+++ b/modules/flake-parts/reference-website/mkdocs-awesome-pages-plugin.nix
@@ -1,3 +1,6 @@
+# Can be removed from dream2nix repo when
+# https://github.com/NixOS/nixpkgs/pull/320709
+# is in nixpkgs-unstable
{
lib,
buildPythonPackage,
From b6b9e5d2fb3bc4a348faebb07608525d217fb56b Mon Sep 17 00:00:00 2001
From: phaer
Date: Tue, 18 Jun 2024 12:55:38 +0200
Subject: [PATCH 41/67] docs: customize toc-item.html
to add collapsible subtrees
---
docs/theme/partials/toc-item.html | 52 +++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
create mode 100644 docs/theme/partials/toc-item.html
diff --git a/docs/theme/partials/toc-item.html b/docs/theme/partials/toc-item.html
new file mode 100644
index 0000000000..34d3dfae98
--- /dev/null
+++ b/docs/theme/partials/toc-item.html
@@ -0,0 +1,52 @@
+
+
+
+
+ {%- set should_collapse = toc_item.level > 2 and toc_item.children -%}
+ {% if should_collapse -%}
+
+
+ {%- endif %}
+
+
+ {{ toc_item.title }}
+
+
+ {% if should_collapse -%}
+
+ {%- endif %}
+
+
+ {% if toc_item.children %}
+
+ {% endif %}
+ {% if should_collapse -%}
+
+ {%- endif %}
+
From eeb48666ca3c345b3357cd99302d058650886d88 Mon Sep 17 00:00:00 2001
From: phaer
Date: Tue, 18 Jun 2024 12:58:02 +0200
Subject: [PATCH 42/67] docs: fix reference titles
---
docs/theme/reference_options.html | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/docs/theme/reference_options.html b/docs/theme/reference_options.html
index bcf9149009..940f315858 100644
--- a/docs/theme/reference_options.html
+++ b/docs/theme/reference_options.html
@@ -1,7 +1,7 @@
## Options
{%- for name, option in options.items() recursive %}
-##{{loop.depth * "#"}} {{ name.replace("<", "<").replace(">", ">") }}
+##{{loop.depth * "#"}} {{ ((option.loc | join (".")) or name).replace("<", "<").replace(">", ">") }}
{{ option.description or '' }}
@@ -29,6 +29,7 @@
{%- endif -%}
+
{% endif %}
{%- if option.children -%}
From 5f3051487a86206f0704476bb08756b965c563b7 Mon Sep 17 00:00:00 2001
From: phaer
Date: Tue, 18 Jun 2024 13:01:19 +0200
Subject: [PATCH 43/67] docs: don't render full paths in reference toc
---
docs/theme/partials/toc-item.html | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/theme/partials/toc-item.html b/docs/theme/partials/toc-item.html
index 34d3dfae98..5af8905ab4 100644
--- a/docs/theme/partials/toc-item.html
+++ b/docs/theme/partials/toc-item.html
@@ -29,7 +29,11 @@
{%- endif %}
+ {%- if page.url.split("/")[-3] == "reference" -%}
+ {{ toc_item.title.split(".")[-1] }}
+ {%- else -%}
{{ toc_item.title }}
+ {%- endif -%}
{% if should_collapse -%}
From c1d15024865a3f005933f602f3c14f0d23b6bb42 Mon Sep 17 00:00:00 2001
From: phaer
Date: Tue, 18 Jun 2024 13:17:34 +0200
Subject: [PATCH 44/67] docs: improve options reference layout
---
docs/src/style.css | 4 ++++
docs/theme/reference_options.html | 8 +++++---
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/docs/src/style.css b/docs/src/style.css
index 4e3b12e677..d95edd65b6 100644
--- a/docs/src/style.css
+++ b/docs/src/style.css
@@ -6,3 +6,7 @@
[data-md-component="toc"] .md-nav__link {
display: inline-flex;
}
+
+.md-typeset td pre {
+ margin: 0;
+}
diff --git a/docs/theme/reference_options.html b/docs/theme/reference_options.html
index 940f315858..9f863c3563 100644
--- a/docs/theme/reference_options.html
+++ b/docs/theme/reference_options.html
@@ -3,13 +3,15 @@
##{{loop.depth * "#"}} {{ ((option.loc | join (".")) or name).replace("<", "<").replace(">", ">") }}
+{% if (option.description or '') != "This option has no description." -%}
{{ option.description or '' }}
+{%- endif %}
{% if "type" in option %}
type |
- {{ option.type }} {{ "(read only)" if option.readOnly else "" }} |
+ {{ option.type}} {{ "(read only)" if option.readOnly else "" }} |
source |
@@ -18,14 +20,14 @@
{%- if option.default -%}
default |
- {{(option.default | default({})).text | pygments("nix")}} |
+ {{(option.default | default({})).text | pygments("nix")}} |
{%- endif -%}
{%- if option.example -%}
example |
- {{(option.example | default({})).text | pygments("nix")}}
+ {{(option.example | default({})).text | pygments("nix")}}
|
{%- endif -%}
From 233a797b5ccbd6d71e9cdff982da64e68b6e8c81 Mon Sep 17 00:00:00 2001
From: phaer
Date: Tue, 18 Jun 2024 15:32:24 +0200
Subject: [PATCH 45/67] docs: put modules where state != "released"...
into a separate navigation section.
---
docs/hooks/render_options.py | 43 +++++++++++++++++++++++++++++++++++-
1 file changed, 42 insertions(+), 1 deletion(-)
diff --git a/docs/hooks/render_options.py b/docs/hooks/render_options.py
index 76c189e499..7878dd9fb6 100644
--- a/docs/hooks/render_options.py
+++ b/docs/hooks/render_options.py
@@ -3,11 +3,13 @@
from pathlib import Path
from collections import OrderedDict
from typing import Dict, Tuple
+from urllib.request import UnknownHandler
from mkdocs.structure.pages import Page
+from mkdocs.structure.nav import Navigation, Section
from mkdocs.structure.files import Files
from mkdocs.config.defaults import MkDocsConfig
-
+from mkdocs.plugins import event_priority
from pygments import highlight
from pygments.lexers import get_lexer_by_name
@@ -61,6 +63,13 @@ def preprocess_options(options, module_name):
def on_page_markdown(
markdown: str, page: Page, config: MkDocsConfig, files: Files
) -> str | None:
+ """Check whether the source path starts with "reference/".
+ If it does:
+ - render a header template, containing values from the source markdown file
+ - render the source markdown file
+ - render an options.json file containing nixos option definitions from the
+ same directory where the source file is found. Then render those options.
+ """
if not is_reference_page(page):
return markdown
src_path = Path(config.docs_dir) / page.file.src_path
@@ -79,3 +88,35 @@ def on_page_markdown(
reference = env.get_template("reference_options.html").render(options=options)
return "\n\n".join([header, markdown, reference])
+
+
+@event_priority(-100)
+def on_nav(nav: Navigation, config: MkDocsConfig, files: Files) -> Navigation | None:
+ """Customize the navigation: If a reference section is found,
+ filter for a "state" variable defined in a markdown files front-matter.
+ Leave all items where "state" equals "released" as-is, but put
+ all others in an "experimental" section below that."""
+ try:
+ reference_section = next(filter(lambda i: i.title == "Reference", nav.items))
+ reference_index = nav.items.index(reference_section)
+ except StopIteration:
+ # Return the navigation as-is if we don't find
+ # a reference section
+ return nav
+
+ released = []
+ experimental = []
+ for page in reference_section.children:
+ # to have metadata from the yaml front-matter available
+ page.read_source(config)
+ state = page.meta.get("state")
+ if state == "released":
+ released.append(page)
+ else:
+ experimental.append(page)
+
+ experimental_section = Section("Experimental", experimental)
+ reference_section.children = released + [experimental_section]
+
+ nav.items[reference_index] = reference_section
+ return nav
From 9aae1937a458229ecda24c0026a09001f4c07f9e Mon Sep 17 00:00:00 2001
From: phaer
Date: Tue, 18 Jun 2024 15:39:32 +0200
Subject: [PATCH 46/67] docs: Experimental -> Experimental Modules
---
docs/hooks/render_options.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/hooks/render_options.py b/docs/hooks/render_options.py
index 7878dd9fb6..168f87be29 100644
--- a/docs/hooks/render_options.py
+++ b/docs/hooks/render_options.py
@@ -115,7 +115,7 @@ def on_nav(nav: Navigation, config: MkDocsConfig, files: Files) -> Navigation |
else:
experimental.append(page)
- experimental_section = Section("Experimental", experimental)
+ experimental_section = Section("Experimental Modules", experimental)
reference_section.children = released + [experimental_section]
nav.items[reference_index] = reference_section
From 4f1b50435693fb2ae03583d3a808cec9b2706bb7 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Tue, 18 Jun 2024 18:31:41 +0000
Subject: [PATCH 47/67] flake.lock: Update
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Flake lock file updates:
• Updated input 'nixpkgs':
'github:NixOS/nixpkgs/e913ae340076bbb73d9f4d3d065c2bca7caafb16?narHash=sha256-Ds1QpobBX2yoUDx9ZruqVGJ/uQPgcXoYuobBguyKEh8%3D' (2024-06-11)
→ 'github:NixOS/nixpkgs/38d3352a65ac9d621b0cd3074d3bef27199ff78f?narHash=sha256-pmjP5ePc1jz%2BOkona3HxD7AYT0wbrCwm9bXAlj08nDM%3D' (2024-06-17)
---
flake.lock | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/flake.lock b/flake.lock
index 557a2d1c9a..b037f84252 100644
--- a/flake.lock
+++ b/flake.lock
@@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
- "lastModified": 1718149104,
- "narHash": "sha256-Ds1QpobBX2yoUDx9ZruqVGJ/uQPgcXoYuobBguyKEh8=",
+ "lastModified": 1718606988,
+ "narHash": "sha256-pmjP5ePc1jz+Okona3HxD7AYT0wbrCwm9bXAlj08nDM=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "e913ae340076bbb73d9f4d3d065c2bca7caafb16",
+ "rev": "38d3352a65ac9d621b0cd3074d3bef27199ff78f",
"type": "github"
},
"original": {
From c6915501f676f0f30c501f20b686a35072396ac3 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Tue, 18 Jun 2024 18:31:41 +0000
Subject: [PATCH 48/67] flake.lock: Update
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Flake lock file updates:
• Updated input 'nixpkgs':
'github:NixOS/nixpkgs/e913ae340076bbb73d9f4d3d065c2bca7caafb16?narHash=sha256-Ds1QpobBX2yoUDx9ZruqVGJ/uQPgcXoYuobBguyKEh8%3D' (2024-06-11)
→ 'github:NixOS/nixpkgs/38d3352a65ac9d621b0cd3074d3bef27199ff78f?narHash=sha256-pmjP5ePc1jz%2BOkona3HxD7AYT0wbrCwm9bXAlj08nDM%3D' (2024-06-17)
---
dev-flake/flake.lock | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dev-flake/flake.lock b/dev-flake/flake.lock
index b74169dae7..80bcf9c757 100644
--- a/dev-flake/flake.lock
+++ b/dev-flake/flake.lock
@@ -145,11 +145,11 @@
},
"nixpkgs_2": {
"locked": {
- "lastModified": 1718149104,
- "narHash": "sha256-Ds1QpobBX2yoUDx9ZruqVGJ/uQPgcXoYuobBguyKEh8=",
+ "lastModified": 1718606988,
+ "narHash": "sha256-pmjP5ePc1jz+Okona3HxD7AYT0wbrCwm9bXAlj08nDM=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "e913ae340076bbb73d9f4d3d065c2bca7caafb16",
+ "rev": "38d3352a65ac9d621b0cd3074d3bef27199ff78f",
"type": "github"
},
"original": {
From ea0ef38c778f92227b682bf710c33b806714412e Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Thu, 20 Jun 2024 18:31:00 +0000
Subject: [PATCH 49/67] flake.lock: Update
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Flake lock file updates:
• Updated input 'nixpkgs':
'github:NixOS/nixpkgs/38d3352a65ac9d621b0cd3074d3bef27199ff78f?narHash=sha256-pmjP5ePc1jz%2BOkona3HxD7AYT0wbrCwm9bXAlj08nDM%3D' (2024-06-17)
→ 'github:NixOS/nixpkgs/37a45fb6993f14555f50b18fbcf4945b82a35707?narHash=sha256-%2BH7PnuwEDDDxUMa3ItAcSRDK5%2BjfMJap/zHiuACyIfc%3D' (2024-06-18)
---
flake.lock | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/flake.lock b/flake.lock
index b037f84252..83d84f717b 100644
--- a/flake.lock
+++ b/flake.lock
@@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
- "lastModified": 1718606988,
- "narHash": "sha256-pmjP5ePc1jz+Okona3HxD7AYT0wbrCwm9bXAlj08nDM=",
+ "lastModified": 1718742829,
+ "narHash": "sha256-+H7PnuwEDDDxUMa3ItAcSRDK5+jfMJap/zHiuACyIfc=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "38d3352a65ac9d621b0cd3074d3bef27199ff78f",
+ "rev": "37a45fb6993f14555f50b18fbcf4945b82a35707",
"type": "github"
},
"original": {
From 5e523a4e419a31dedae61443b9f78397e64eeea9 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Thu, 20 Jun 2024 18:31:00 +0000
Subject: [PATCH 50/67] flake.lock: Update
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Flake lock file updates:
• Updated input 'nixpkgs':
'github:NixOS/nixpkgs/38d3352a65ac9d621b0cd3074d3bef27199ff78f?narHash=sha256-pmjP5ePc1jz%2BOkona3HxD7AYT0wbrCwm9bXAlj08nDM%3D' (2024-06-17)
→ 'github:NixOS/nixpkgs/37a45fb6993f14555f50b18fbcf4945b82a35707?narHash=sha256-%2BH7PnuwEDDDxUMa3ItAcSRDK5%2BjfMJap/zHiuACyIfc%3D' (2024-06-18)
---
dev-flake/flake.lock | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dev-flake/flake.lock b/dev-flake/flake.lock
index 80bcf9c757..887bc0c511 100644
--- a/dev-flake/flake.lock
+++ b/dev-flake/flake.lock
@@ -145,11 +145,11 @@
},
"nixpkgs_2": {
"locked": {
- "lastModified": 1718606988,
- "narHash": "sha256-pmjP5ePc1jz+Okona3HxD7AYT0wbrCwm9bXAlj08nDM=",
+ "lastModified": 1718742829,
+ "narHash": "sha256-+H7PnuwEDDDxUMa3ItAcSRDK5+jfMJap/zHiuACyIfc=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "38d3352a65ac9d621b0cd3074d3bef27199ff78f",
+ "rev": "37a45fb6993f14555f50b18fbcf4945b82a35707",
"type": "github"
},
"original": {
From 6d786109563d1a74bebbe4ab6422d96010b8f598 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Fri, 21 Jun 2024 18:31:10 +0000
Subject: [PATCH 51/67] flake.lock: Update
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Flake lock file updates:
• Updated input 'nixpkgs':
'github:NixOS/nixpkgs/37a45fb6993f14555f50b18fbcf4945b82a35707?narHash=sha256-%2BH7PnuwEDDDxUMa3ItAcSRDK5%2BjfMJap/zHiuACyIfc%3D' (2024-06-18)
→ 'github:NixOS/nixpkgs/9b10b8f00cb5494795e5f51b39210fed4d2b0748?narHash=sha256-jab3Kpc8O1z3qxwVsCMHL4%2B18n5Wy/HHKyu1fcsF7gs%3D' (2024-06-20)
---
flake.lock | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/flake.lock b/flake.lock
index 83d84f717b..2f44d2c149 100644
--- a/flake.lock
+++ b/flake.lock
@@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
- "lastModified": 1718742829,
- "narHash": "sha256-+H7PnuwEDDDxUMa3ItAcSRDK5+jfMJap/zHiuACyIfc=",
+ "lastModified": 1718870667,
+ "narHash": "sha256-jab3Kpc8O1z3qxwVsCMHL4+18n5Wy/HHKyu1fcsF7gs=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "37a45fb6993f14555f50b18fbcf4945b82a35707",
+ "rev": "9b10b8f00cb5494795e5f51b39210fed4d2b0748",
"type": "github"
},
"original": {
From ec375230a76fd6df5b5655f621268d2325278c0a Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Fri, 21 Jun 2024 18:31:10 +0000
Subject: [PATCH 52/67] flake.lock: Update
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Flake lock file updates:
• Updated input 'nixpkgs':
'github:NixOS/nixpkgs/37a45fb6993f14555f50b18fbcf4945b82a35707?narHash=sha256-%2BH7PnuwEDDDxUMa3ItAcSRDK5%2BjfMJap/zHiuACyIfc%3D' (2024-06-18)
→ 'github:NixOS/nixpkgs/9b10b8f00cb5494795e5f51b39210fed4d2b0748?narHash=sha256-jab3Kpc8O1z3qxwVsCMHL4%2B18n5Wy/HHKyu1fcsF7gs%3D' (2024-06-20)
---
dev-flake/flake.lock | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dev-flake/flake.lock b/dev-flake/flake.lock
index 887bc0c511..2b7d082cbe 100644
--- a/dev-flake/flake.lock
+++ b/dev-flake/flake.lock
@@ -145,11 +145,11 @@
},
"nixpkgs_2": {
"locked": {
- "lastModified": 1718742829,
- "narHash": "sha256-+H7PnuwEDDDxUMa3ItAcSRDK5+jfMJap/zHiuACyIfc=",
+ "lastModified": 1718870667,
+ "narHash": "sha256-jab3Kpc8O1z3qxwVsCMHL4+18n5Wy/HHKyu1fcsF7gs=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "37a45fb6993f14555f50b18fbcf4945b82a35707",
+ "rev": "9b10b8f00cb5494795e5f51b39210fed4d2b0748",
"type": "github"
},
"original": {
From 58bf45413a126b618b334400cd6d54a4ab0a8052 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Sat, 22 Jun 2024 18:29:33 +0000
Subject: [PATCH 53/67] flake.lock: Update
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Flake lock file updates:
• Updated input 'nixpkgs':
'github:NixOS/nixpkgs/9b10b8f00cb5494795e5f51b39210fed4d2b0748?narHash=sha256-jab3Kpc8O1z3qxwVsCMHL4%2B18n5Wy/HHKyu1fcsF7gs%3D' (2024-06-20)
→ 'github:NixOS/nixpkgs/90338afd6177fc683a04d934199d693708c85a3b?narHash=sha256-%2B1xgeIow4gJeiwo4ETvMRvWoircnvb0JOt7NS9kUhoM%3D' (2024-06-21)
---
flake.lock | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/flake.lock b/flake.lock
index 2f44d2c149..aecdd47ffd 100644
--- a/flake.lock
+++ b/flake.lock
@@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
- "lastModified": 1718870667,
- "narHash": "sha256-jab3Kpc8O1z3qxwVsCMHL4+18n5Wy/HHKyu1fcsF7gs=",
+ "lastModified": 1718983919,
+ "narHash": "sha256-+1xgeIow4gJeiwo4ETvMRvWoircnvb0JOt7NS9kUhoM=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "9b10b8f00cb5494795e5f51b39210fed4d2b0748",
+ "rev": "90338afd6177fc683a04d934199d693708c85a3b",
"type": "github"
},
"original": {
From 2b2cb862ad39f458ea6321c606ad235655149f71 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Sat, 22 Jun 2024 18:29:34 +0000
Subject: [PATCH 54/67] flake.lock: Update
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Flake lock file updates:
• Updated input 'nixpkgs':
'github:NixOS/nixpkgs/9b10b8f00cb5494795e5f51b39210fed4d2b0748?narHash=sha256-jab3Kpc8O1z3qxwVsCMHL4%2B18n5Wy/HHKyu1fcsF7gs%3D' (2024-06-20)
→ 'github:NixOS/nixpkgs/90338afd6177fc683a04d934199d693708c85a3b?narHash=sha256-%2B1xgeIow4gJeiwo4ETvMRvWoircnvb0JOt7NS9kUhoM%3D' (2024-06-21)
---
dev-flake/flake.lock | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dev-flake/flake.lock b/dev-flake/flake.lock
index 2b7d082cbe..c6918853af 100644
--- a/dev-flake/flake.lock
+++ b/dev-flake/flake.lock
@@ -145,11 +145,11 @@
},
"nixpkgs_2": {
"locked": {
- "lastModified": 1718870667,
- "narHash": "sha256-jab3Kpc8O1z3qxwVsCMHL4+18n5Wy/HHKyu1fcsF7gs=",
+ "lastModified": 1718983919,
+ "narHash": "sha256-+1xgeIow4gJeiwo4ETvMRvWoircnvb0JOt7NS9kUhoM=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "9b10b8f00cb5494795e5f51b39210fed4d2b0748",
+ "rev": "90338afd6177fc683a04d934199d693708c85a3b",
"type": "github"
},
"original": {
From fb55ba188252fca66cfb9185a327829872f6f15d Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Sun, 23 Jun 2024 18:29:12 +0000
Subject: [PATCH 55/67] flake.lock: Update
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Flake lock file updates:
• Updated input 'nixpkgs':
'github:NixOS/nixpkgs/90338afd6177fc683a04d934199d693708c85a3b?narHash=sha256-%2B1xgeIow4gJeiwo4ETvMRvWoircnvb0JOt7NS9kUhoM%3D' (2024-06-21)
→ 'github:NixOS/nixpkgs/9693852a2070b398ee123a329e68f0dab5526681?narHash=sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs%3D' (2024-06-22)
---
flake.lock | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/flake.lock b/flake.lock
index aecdd47ffd..4277e18e60 100644
--- a/flake.lock
+++ b/flake.lock
@@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
- "lastModified": 1718983919,
- "narHash": "sha256-+1xgeIow4gJeiwo4ETvMRvWoircnvb0JOt7NS9kUhoM=",
+ "lastModified": 1719082008,
+ "narHash": "sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "90338afd6177fc683a04d934199d693708c85a3b",
+ "rev": "9693852a2070b398ee123a329e68f0dab5526681",
"type": "github"
},
"original": {
From c46b53791ca39d824e0d839209b8b1981fa295c0 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Sun, 23 Jun 2024 18:29:13 +0000
Subject: [PATCH 56/67] flake.lock: Update
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Flake lock file updates:
• Updated input 'nixpkgs':
'github:NixOS/nixpkgs/90338afd6177fc683a04d934199d693708c85a3b?narHash=sha256-%2B1xgeIow4gJeiwo4ETvMRvWoircnvb0JOt7NS9kUhoM%3D' (2024-06-21)
→ 'github:NixOS/nixpkgs/9693852a2070b398ee123a329e68f0dab5526681?narHash=sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs%3D' (2024-06-22)
---
dev-flake/flake.lock | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dev-flake/flake.lock b/dev-flake/flake.lock
index c6918853af..22250933a8 100644
--- a/dev-flake/flake.lock
+++ b/dev-flake/flake.lock
@@ -145,11 +145,11 @@
},
"nixpkgs_2": {
"locked": {
- "lastModified": 1718983919,
- "narHash": "sha256-+1xgeIow4gJeiwo4ETvMRvWoircnvb0JOt7NS9kUhoM=",
+ "lastModified": 1719082008,
+ "narHash": "sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "90338afd6177fc683a04d934199d693708c85a3b",
+ "rev": "9693852a2070b398ee123a329e68f0dab5526681",
"type": "github"
},
"original": {
From e1ea06ffd34c254745a0585e58ac47ce3c2447af Mon Sep 17 00:00:00 2001
From: purepani
Date: Sun, 23 Jun 2024 15:20:11 -0500
Subject: [PATCH 57/67] python: Moves python-local-development example into src
layout
---
.../python-local-development/{ => src}/mytool/__init__.py | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename examples/packages/languages/python-local-development/{ => src}/mytool/__init__.py (100%)
diff --git a/examples/packages/languages/python-local-development/mytool/__init__.py b/examples/packages/languages/python-local-development/src/mytool/__init__.py
similarity index 100%
rename from examples/packages/languages/python-local-development/mytool/__init__.py
rename to examples/packages/languages/python-local-development/src/mytool/__init__.py
From cbe72c89ba649b6ba9aad7b123076f45e0efc3ce Mon Sep 17 00:00:00 2001
From: purepani
Date: Sun, 23 Jun 2024 15:20:56 -0500
Subject: [PATCH 58/67] python-editables: Exports environment variables for
python whether .dream2nix needs updating or not (editables.py)
---
.../dream2nix/python-editables/editable.py | 28 +++++++++++--------
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/modules/dream2nix/python-editables/editable.py b/modules/dream2nix/python-editables/editable.py
index efd8516b72..d18c87c154 100644
--- a/modules/dream2nix/python-editables/editable.py
+++ b/modules/dream2nix/python-editables/editable.py
@@ -1,14 +1,14 @@
-import os
-import sys
+import configparser
+import importlib
import json
+import os
import shutil
import subprocess
-import configparser
-import importlib
+import sys
from contextlib import redirect_stdout
-from textwrap import dedent
from pathlib import Path
from tempfile import TemporaryDirectory
+from textwrap import dedent
import tomli
@@ -173,6 +173,15 @@ def needs_update(args, dream2nix_python_dir):
return old_args != args
+def export_environment_vars(python_environment, bin_dir, site_dir, site_packages):
+ print(
+ f"""
+ export PYTHONPATH="{site_dir}:{python_environment / site_packages}:$PYTHONPATH"
+ export PATH="{bin_dir}:${python_environment}/bin:$PATH"
+ """
+ )
+
+
def pretty_print_editables(editables, root_dir, root_name):
if os.environ.get("D2N_QUIET"):
return
@@ -218,6 +227,7 @@ def pretty_print_editables(editables, root_dir, root_name):
if dream2nix_python_dir.exists():
shutil.rmtree(dream2nix_python_dir)
else:
+ export_environment_vars(python_environment, bin_dir, site_dir, site_packages)
pretty_print_editables(editables, root_dir, root_name)
exit(0)
@@ -259,14 +269,8 @@ def pretty_print_editables(editables, root_dir, root_name):
"""
)
- print(
- f"""
-export PYTHONPATH="{site_dir}:{python_environment / site_packages}:$PYTHONPATH"
-export PATH="{bin_dir}:${python_environment}/bin:$PATH"
- """
- )
-
with open(dream2nix_python_dir / "editable-args.json", "w") as f:
json.dump(args, f, indent=2)
+ export_environment_vars(python_environment, bin_dir, site_dir, site_packages)
pretty_print_editables(editables, root_dir, root_name)
From 3288c5cf4448ed843455a65737b4f27d42828555 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Tue, 25 Jun 2024 18:31:49 +0000
Subject: [PATCH 59/67] flake.lock: Update
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Flake lock file updates:
• Updated input 'nixpkgs':
'github:NixOS/nixpkgs/9693852a2070b398ee123a329e68f0dab5526681?narHash=sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs%3D' (2024-06-22)
→ 'github:NixOS/nixpkgs/cfb89a95f19bea461fc37228dc4d07b22fe617c2?narHash=sha256-kOUKtKfYEh8h8goL/P6lKF4Jb0sXnEkFyEganzdTGvo%3D' (2024-06-25)
---
flake.lock | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/flake.lock b/flake.lock
index 4277e18e60..159c0fe97d 100644
--- a/flake.lock
+++ b/flake.lock
@@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
- "lastModified": 1719082008,
- "narHash": "sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs=",
+ "lastModified": 1719285171,
+ "narHash": "sha256-kOUKtKfYEh8h8goL/P6lKF4Jb0sXnEkFyEganzdTGvo=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "9693852a2070b398ee123a329e68f0dab5526681",
+ "rev": "cfb89a95f19bea461fc37228dc4d07b22fe617c2",
"type": "github"
},
"original": {
From aa983fd908a0d7e235a8c8a77b803231b9ff2e4a Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Tue, 25 Jun 2024 18:31:49 +0000
Subject: [PATCH 60/67] flake.lock: Update
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Flake lock file updates:
• Updated input 'nixpkgs':
'github:NixOS/nixpkgs/9693852a2070b398ee123a329e68f0dab5526681?narHash=sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs%3D' (2024-06-22)
→ 'github:NixOS/nixpkgs/cfb89a95f19bea461fc37228dc4d07b22fe617c2?narHash=sha256-kOUKtKfYEh8h8goL/P6lKF4Jb0sXnEkFyEganzdTGvo%3D' (2024-06-25)
---
dev-flake/flake.lock | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dev-flake/flake.lock b/dev-flake/flake.lock
index 22250933a8..f1824b9497 100644
--- a/dev-flake/flake.lock
+++ b/dev-flake/flake.lock
@@ -145,11 +145,11 @@
},
"nixpkgs_2": {
"locked": {
- "lastModified": 1719082008,
- "narHash": "sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs=",
+ "lastModified": 1719285171,
+ "narHash": "sha256-kOUKtKfYEh8h8goL/P6lKF4Jb0sXnEkFyEganzdTGvo=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "9693852a2070b398ee123a329e68f0dab5526681",
+ "rev": "cfb89a95f19bea461fc37228dc4d07b22fe617c2",
"type": "github"
},
"original": {
From 00ccd3da762a17a4c57263a50de7a5623d791298 Mon Sep 17 00:00:00 2001
From: phaer
Date: Mon, 24 Jun 2024 12:47:15 +0200
Subject: [PATCH 61/67] docs/pip: Add intro to README
---
modules/dream2nix/pip/README.md | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/modules/dream2nix/pip/README.md b/modules/dream2nix/pip/README.md
index d5f05f5be4..d6f434982b 100644
--- a/modules/dream2nix/pip/README.md
+++ b/modules/dream2nix/pip/README.md
@@ -5,4 +5,26 @@ maintainers:
- phaer
---
-Python packaging via [pip](https://pip.pypa.io/).
+A module to package python projects via [pip](https://pip.pypa.io/).
+
+Under the hood, it uses [./pkgs/fetchPipMetadata](https://github.com/nix-community/dream2nix/tree/main/pkgs/fetchPipMetadata) to
+run `pip install --dry-run --report [...]` with reproducible inputs and converts the resulting installation report into a dream2nix
+lock file.
+
+!!! note
+
+ Due to limitations in `pip`s cross-platform support, the resulting
+ lock-files are platform-specific!
+ We therefore recommend setting `paths.lockFile` to `lock.${system}.json`
+ for all projects where you use the pip module.
+
+ Check out the [pdm module](../WIP-python-pdm/index.md) if you need a solution that
+ allows locking for multiple platforms at once!
+
+During building, it uses this lock file to build each dependency as well as the top-level package in separate derivations
+while allowing overrides and further customization via [dream2nix module system](../../modules.md).
+
+## Getting started
+
+See [Build a python project with pip](../../guides/pip.md).
+
From 35e13f912ad3e9a7d461e519f7a7a8576fecc794 Mon Sep 17 00:00:00 2001
From: phaer
Date: Mon, 24 Jun 2024 12:47:27 +0200
Subject: [PATCH 62/67] docs/buildPythonPackage: reformat
---
.../dream2nix/buildPythonPackage/interface.nix | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/modules/dream2nix/buildPythonPackage/interface.nix b/modules/dream2nix/buildPythonPackage/interface.nix
index ef2d4dd7fa..37019eabf9 100644
--- a/modules/dream2nix/buildPythonPackage/interface.nix
+++ b/modules/dream2nix/buildPythonPackage/interface.nix
@@ -93,13 +93,15 @@ in {
description = ''
Whether the pyproject format should be used. When set to `true`,
`pypaBuildHook` will be used, and you can add the required build dependencies
- from `build-system.requires` to `build-system`. Note that the pyproject
- format falls back to using `setuptools`, so you can use `pyproject = true`
- even if the package only has a `setup.py`. When set to `false`, you can
- use the existing hooks or provide your own logic to build the
- package. This can be useful for packages that don't support the pyproject
- format. When unset, the legacy `setuptools` hooks are used for backwards
- compatibility.
+ from `build-system.requires` to `build-system`.
+
+ Note that the pyproject format falls back to using `setuptools`, so
+ you can use `pyproject = true` even if the package only has a `setup.py`.
+ When set to `false`, you can use the existing hooks or provide your own
+ logic to build the package. This can be useful for packages that don't
+ support the pyproject format.
+
+ When unset, the legacy `setuptools` hooks are used for backwards compatibility.
'';
};
From 3f1417738823c90c4b4600a3f2f3fb59e773b6dd Mon Sep 17 00:00:00 2001
From: phaer
Date: Mon, 24 Jun 2024 14:17:49 +0200
Subject: [PATCH 63/67] examples/hello: 2.12 -> 2.12.1
---
examples/repo-with-packages/packages/hello/default.nix | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/examples/repo-with-packages/packages/hello/default.nix b/examples/repo-with-packages/packages/hello/default.nix
index 59c3853d48..668a1af395 100644
--- a/examples/repo-with-packages/packages/hello/default.nix
+++ b/examples/repo-with-packages/packages/hello/default.nix
@@ -9,7 +9,7 @@
];
name = "hello";
- version = "2.12";
+ version = "2.12.1";
deps = {nixpkgs, ...}: {
inherit
@@ -21,7 +21,7 @@
mkDerivation = {
src = builtins.fetchTarball {
url = "https://ftp.gnu.org/gnu/hello/hello-${config.version}.tar.gz";
- sha256 = "sha256-4GQeKLIxoWfYiOraJub5RsHNVQBr2H+3bfPP22PegdU=";
+ sha256 = "0xw6cr5jgi1ir13q6apvrivwmmpr5j8vbymp0x6ll0kcv6366hnn";
};
};
}
From 68e0c76cb5114ee8cc5f9a21911a06031efe15ec Mon Sep 17 00:00:00 2001
From: phaer
Date: Mon, 24 Jun 2024 15:01:47 +0200
Subject: [PATCH 64/67] docs: enable copy button for code blocks
---
docs/mkdocs.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml
index e0b0ec09d6..4db23ffaaf 100644
--- a/docs/mkdocs.yml
+++ b/docs/mkdocs.yml
@@ -52,6 +52,7 @@ theme:
- navigation.path
- navigation.top
- toc.follow
+ - content.code.copy
- content.code.annotate
extra:
From 5253c929b7519a954d18c80871d30ac4c215a32d Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Wed, 26 Jun 2024 18:30:56 +0000
Subject: [PATCH 65/67] flake.lock: Update
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Flake lock file updates:
• Updated input 'nixpkgs':
'github:NixOS/nixpkgs/cfb89a95f19bea461fc37228dc4d07b22fe617c2?narHash=sha256-kOUKtKfYEh8h8goL/P6lKF4Jb0sXnEkFyEganzdTGvo%3D' (2024-06-25)
→ 'github:NixOS/nixpkgs/9c513fc6fb75142f6aec6b7545cb8af2236b80f5?narHash=sha256-bu0xbu2Z6DDzA9LGV81yJunIti6r7tjUImeR8orAL/I%3D' (2024-06-25)
---
flake.lock | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/flake.lock b/flake.lock
index 159c0fe97d..c6a502de24 100644
--- a/flake.lock
+++ b/flake.lock
@@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
- "lastModified": 1719285171,
- "narHash": "sha256-kOUKtKfYEh8h8goL/P6lKF4Jb0sXnEkFyEganzdTGvo=",
+ "lastModified": 1719317636,
+ "narHash": "sha256-bu0xbu2Z6DDzA9LGV81yJunIti6r7tjUImeR8orAL/I=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "cfb89a95f19bea461fc37228dc4d07b22fe617c2",
+ "rev": "9c513fc6fb75142f6aec6b7545cb8af2236b80f5",
"type": "github"
},
"original": {
From 481cd64f9674f60d99cb7a679b0d7f76358e18f4 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
Date: Wed, 26 Jun 2024 18:30:57 +0000
Subject: [PATCH 66/67] flake.lock: Update
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Flake lock file updates:
• Updated input 'nixpkgs':
'github:NixOS/nixpkgs/cfb89a95f19bea461fc37228dc4d07b22fe617c2?narHash=sha256-kOUKtKfYEh8h8goL/P6lKF4Jb0sXnEkFyEganzdTGvo%3D' (2024-06-25)
→ 'github:NixOS/nixpkgs/9c513fc6fb75142f6aec6b7545cb8af2236b80f5?narHash=sha256-bu0xbu2Z6DDzA9LGV81yJunIti6r7tjUImeR8orAL/I%3D' (2024-06-25)
---
dev-flake/flake.lock | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dev-flake/flake.lock b/dev-flake/flake.lock
index f1824b9497..5a3643e8d6 100644
--- a/dev-flake/flake.lock
+++ b/dev-flake/flake.lock
@@ -145,11 +145,11 @@
},
"nixpkgs_2": {
"locked": {
- "lastModified": 1719285171,
- "narHash": "sha256-kOUKtKfYEh8h8goL/P6lKF4Jb0sXnEkFyEganzdTGvo=",
+ "lastModified": 1719317636,
+ "narHash": "sha256-bu0xbu2Z6DDzA9LGV81yJunIti6r7tjUImeR8orAL/I=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "cfb89a95f19bea461fc37228dc4d07b22fe617c2",
+ "rev": "9c513fc6fb75142f6aec6b7545cb8af2236b80f5",
"type": "github"
},
"original": {
From ef046832220655543b105949787a9d0e6a24211e Mon Sep 17 00:00:00 2001
From: DavHau
Date: Thu, 27 Jun 2024 15:21:24 +0700
Subject: [PATCH 67/67] fix: nix flake show requiring IFD
---
.../nodejs-packaging-devshell-only/default.nix | 10 +++++-----
.../packages/languages/nodejs-packaging/default.nix | 10 +++++-----
.../packages/nodejs-packaging-package-lock/default.nix | 10 +++++-----
3 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/examples/packages/languages/nodejs-packaging-devshell-only/default.nix b/examples/packages/languages/nodejs-packaging-devshell-only/default.nix
index e34ee3ab64..bd22c5042b 100644
--- a/examples/packages/languages/nodejs-packaging-devshell-only/default.nix
+++ b/examples/packages/languages/nodejs-packaging-devshell-only/default.nix
@@ -22,11 +22,11 @@
version = "1.5.0";
mkDerivation = {
- src = config.deps.fetchFromGitHub {
- owner = "DavHau";
- repo = "cowsay";
- rev = "package-lock-v3";
- sha256 = "sha256-KuZkGWl5An78IFR5uT/2jVTXdm71oWB+p143svYVkqQ=";
+ src = builtins.fetchGit {
+ shallow = true;
+ url = "https://github.com/DavHau/cowsay";
+ ref = "package-lock-v3";
+ rev = "c89952cb75e3e54b8ca0033bd3499297610083c7";
};
# allow devshell to be built -> CI pipeline happy
buildPhase = "mkdir $out";
diff --git a/examples/packages/languages/nodejs-packaging/default.nix b/examples/packages/languages/nodejs-packaging/default.nix
index 50e8c463c4..a5384d2a73 100644
--- a/examples/packages/languages/nodejs-packaging/default.nix
+++ b/examples/packages/languages/nodejs-packaging/default.nix
@@ -10,11 +10,11 @@
];
mkDerivation = {
- src = config.deps.fetchFromGitHub {
- owner = "DavHau";
- repo = "cowsay";
- rev = "package-lock-v3";
- sha256 = "sha256-KuZkGWl5An78IFR5uT/2jVTXdm71oWB+p143svYVkqQ=";
+ src = builtins.fetchGit {
+ shallow = true;
+ url = "https://github.com/DavHau/cowsay";
+ ref = "package-lock-v3";
+ rev = "c89952cb75e3e54b8ca0033bd3499297610083c7";
};
};
diff --git a/modules/dream2nix/WIP-nodejs-builder-v3/tests/packages/nodejs-packaging-package-lock/default.nix b/modules/dream2nix/WIP-nodejs-builder-v3/tests/packages/nodejs-packaging-package-lock/default.nix
index ac35de343f..735ee365db 100644
--- a/modules/dream2nix/WIP-nodejs-builder-v3/tests/packages/nodejs-packaging-package-lock/default.nix
+++ b/modules/dream2nix/WIP-nodejs-builder-v3/tests/packages/nodejs-packaging-package-lock/default.nix
@@ -9,11 +9,11 @@
];
mkDerivation = {
- src = config.deps.fetchFromGitHub {
- owner = "DavHau";
- repo = "cowsay";
- rev = "package-lock-v3";
- sha256 = "sha256-KuZkGWl5An78IFR5uT/2jVTXdm71oWB+p143svYVkqQ=";
+ src = builtins.fetchGit {
+ shallow = true;
+ url = "https://github.com/DavHau/cowsay";
+ ref = "package-lock-v3";
+ rev = "c89952cb75e3e54b8ca0033bd3499297610083c7";
};
};