From 249fe0d6b2ae39e6bee75606c01ef9922582d04e Mon Sep 17 00:00:00 2001 From: kev <31861128+yqlbu@users.noreply.github.com> Date: Sun, 17 Mar 2024 12:17:03 +0800 Subject: [PATCH 01/15] fix: correct a typo (#127) --- docs/development/packaging-101.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/development/packaging-101.md b/docs/development/packaging-101.md index 475dd20..5c4d65b 100644 --- a/docs/development/packaging-101.md +++ b/docs/development/packaging-101.md @@ -3,7 +3,7 @@ WIP work in progress, please refer to the following reference documents to learn Nix packaging. -## 参考文档 +## References - [NixOS Series 3: Software Packaging 101](https://lantian.pub/en/article/modify-computer/nixos-packaging.lantian/) - [How to Learn Nix, Part 28: The standard environment](https://ianthehenry.com/posts/how-to-learn-nix/the-standard-environment/) From d7109620959bfdba726cb3ccbe7db4c6667fdc21 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Sun, 17 Mar 2024 12:17:50 +0800 Subject: [PATCH 02/15] fix(Chinese): line breaks (#128) --- docs/.vitepress/config.ts | 17 + docs/zh/the-nix-language/index.md | 4 +- package.json | 3 +- pnpm-lock.yaml | 520 +++++++++++++++--------------- 4 files changed, 288 insertions(+), 256 deletions(-) diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 9f049d2..b264ee3 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -75,6 +75,7 @@ export default defineConfig({ config: (md) => { // add support for footnote md.use(require("markdown-it-footnote")) + md.use(require("markdown-it-cjk-breaks")) }, }, @@ -88,6 +89,22 @@ export default defineConfig({ search: { provider: "local", + // for debugging + // options: { + // /** + // * @param {string} src + // * @param {import('vitepress').MarkdownEnv} env + // * @param {import('markdown-it')} md + // */ + // _render(src, env, md) { + // console.log("start...") + // console.log("src", src) + // let out = md.render(src, env) + // console.log("success...") + // return out + // }, + // }, + // provider: 'algolia', // options: { // appId: '747LJ10EI7', diff --git a/docs/zh/the-nix-language/index.md b/docs/zh/the-nix-language/index.md index 05cf0af..81662c1 100644 --- a/docs/zh/the-nix-language/index.md +++ b/docs/zh/the-nix-language/index.md @@ -6,8 +6,8 @@ Nix 语言是 Nix 包管理器的基础,要想玩得转 NixOS 与 Nix Flakes Nix 是一门比较简单的函数式语言,在已有一定编程基础的情况下,过一遍这些语法用时应该在 2 个 小时以内。 -NixOS-CN 社区已经有了一份不错的 Nix 语言教程,我不打算重复造轮子,请直接阅读 -[**Nix 语言概览 - NixOS-CN**](https://nixos-cn.org/tutorials/lang) 来快速入门。 +NixOS-CN 社区已经有了一份不错的 Nix 语言教程,我不打算重复造轮子,请直接阅 +读[**Nix 语言概览 - NixOS-CN**](https://nixos-cn.org/tutorials/lang) 来快速入门。 先把语法过一遍,有个大概的印象就行,后面需要用到时再边用边复习语法知识。 diff --git a/package.json b/package.json index 6481c94..d6d867c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "type": "module", "devDependencies": { - "vitepress": "1.0.0-rc.44", + "vitepress": "1.0.0-rc.45", "vitepress-export-pdf": "1.0.0-beta.0" }, "scripts": { @@ -11,6 +11,7 @@ "export-pdf": "press-export-pdf export ./docs --outFile ./nixos-and-flakes-book.pdf" }, "dependencies": { + "markdown-it-cjk-breaks": "^2.0.0", "markdown-it-footnote": "^4.0.0", "sitemap-ts": "^1.6.1", "vitepress-plugin-comment-with-giscus": "^1.1.12" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 79d343f..d8daec9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,6 +5,9 @@ settings: excludeLinksFromLockfile: false dependencies: + markdown-it-cjk-breaks: + specifier: ^2.0.0 + version: 2.0.0 markdown-it-footnote: specifier: ^4.0.0 version: 4.0.0 @@ -13,15 +16,15 @@ dependencies: version: 1.6.1 vitepress-plugin-comment-with-giscus: specifier: ^1.1.12 - version: 1.1.12(vue@3.4.20) + version: 1.1.12(vue@3.4.21) devDependencies: vitepress: - specifier: 1.0.0-rc.44 - version: 1.0.0-rc.44(@algolia/client-search@4.22.1)(search-insights@2.13.0) + specifier: 1.0.0-rc.45 + version: 1.0.0-rc.45(@algolia/client-search@4.22.1)(search-insights@2.13.0) vitepress-export-pdf: specifier: 1.0.0-beta.0 - version: 1.0.0-beta.0(esbuild@0.20.1)(vitepress@1.0.0-rc.44) + version: 1.0.0-beta.0(esbuild@0.20.2)(vitepress@1.0.0-rc.45) packages: @@ -188,15 +191,15 @@ packages: js-tokens: 4.0.0 dev: true - /@babel/parser@7.23.9: - resolution: {integrity: sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA==} + /@babel/parser@7.24.0: + resolution: {integrity: sha512-QuP/FxEAzMSjXygs8v4N9dvdXzEHN4W1oF3PxuWAtPo08UdM17u89RDMgjLn/mlc56iM0HlLmVkO/wgR+rDgHg==} engines: {node: '>=6.0.0'} hasBin: true dependencies: - '@babel/types': 7.23.9 + '@babel/types': 7.24.0 - /@babel/types@7.23.9: - resolution: {integrity: sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q==} + /@babel/types@7.24.0: + resolution: {integrity: sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==} engines: {node: '>=6.9.0'} dependencies: '@babel/helper-string-parser': 7.23.4 @@ -213,12 +216,12 @@ packages: yargs: 17.7.2 dev: true - /@condorhero/vuepress-plugin-export-pdf-core@3.0.2(esbuild@0.20.1): + /@condorhero/vuepress-plugin-export-pdf-core@3.0.2(esbuild@0.20.2): resolution: {integrity: sha512-EOyo175bsDeK015wtMItMesZCdYDJF0wjgsZu8ZsFJciPrDsogBd+dhkC8W3oJ6ni7d5YBK1ftwGl04ZI8hErw==} engines: {node: '>=8.6'} dependencies: '@condorhero/merge-pdfs': 0.0.7 - bundle-require: 4.0.2(esbuild@0.20.1) + bundle-require: 4.0.2(esbuild@0.20.2) cac: 6.7.14 envinfo: 7.11.1 fs-extra: 11.2.0 @@ -237,14 +240,14 @@ packages: - utf-8-validate dev: true - /@docsearch/css@3.5.2: - resolution: {integrity: sha512-SPiDHaWKQZpwR2siD0KQUwlStvIAnEyK6tAE2h2Wuoq8ue9skzhlyVQ1ddzOxX6khULnAALDiR/isSF3bnuciA==} + /@docsearch/css@3.6.0: + resolution: {integrity: sha512-+sbxb71sWre+PwDK7X2T8+bhS6clcVMLwBPznX45Qu6opJcgRjAp7gYSDzVFp187J+feSj5dNBN1mJoi6ckkUQ==} dev: true - /@docsearch/js@3.5.2(@algolia/client-search@4.22.1)(search-insights@2.13.0): - resolution: {integrity: sha512-p1YFTCDflk8ieHgFJYfmyHBki1D61+U9idwrLh+GQQMrBSP3DLGKpy0XUJtPjAOPltcVbqsTjiPFfH7JImjUNg==} + /@docsearch/js@3.6.0(@algolia/client-search@4.22.1)(search-insights@2.13.0): + resolution: {integrity: sha512-QujhqINEElrkIfKwyyyTfbsfMAYCkylInLYMRqHy7PHc8xTBQCow73tlo/Kc7oIwBrCLf0P3YhjlOeV4v8hevQ==} dependencies: - '@docsearch/react': 3.5.2(@algolia/client-search@4.22.1)(search-insights@2.13.0) + '@docsearch/react': 3.6.0(@algolia/client-search@4.22.1)(search-insights@2.13.0) preact: 10.19.6 transitivePeerDependencies: - '@algolia/client-search' @@ -254,8 +257,8 @@ packages: - search-insights dev: true - /@docsearch/react@3.5.2(@algolia/client-search@4.22.1)(search-insights@2.13.0): - resolution: {integrity: sha512-9Ahcrs5z2jq/DcAvYtvlqEBHImbm4YJI8M9y0x6Tqg598P40HTEkX7hsMcIuThI+hTFxRGZ9hll0Wygm2yEjng==} + /@docsearch/react@3.6.0(@algolia/client-search@4.22.1)(search-insights@2.13.0): + resolution: {integrity: sha512-HUFut4ztcVNmqy9gp/wxNbC7pTOHhgVVkHVGCACTuLhUKUhKAF9KYHJtMiLUJxEqiFLQiuri1fWF8zqwM/cu1w==} peerDependencies: '@types/react': '>= 16.8.0 < 19.0.0' react: '>= 16.8.0 < 19.0.0' @@ -273,7 +276,7 @@ packages: dependencies: '@algolia/autocomplete-core': 1.9.3(@algolia/client-search@4.22.1)(algoliasearch@4.22.1)(search-insights@2.13.0) '@algolia/autocomplete-preset-algolia': 1.9.3(@algolia/client-search@4.22.1)(algoliasearch@4.22.1) - '@docsearch/css': 3.5.2 + '@docsearch/css': 3.6.0 algoliasearch: 4.22.1 search-insights: 2.13.0 transitivePeerDependencies: @@ -289,8 +292,8 @@ packages: dev: true optional: true - /@esbuild/aix-ppc64@0.20.1: - resolution: {integrity: sha512-m55cpeupQ2DbuRGQMMZDzbv9J9PgVelPjlcmM5kxHnrBdBx6REaEd7LamYV7Dm8N7rCyR/XwU6rVP8ploKtIkA==} + /@esbuild/aix-ppc64@0.20.2: + resolution: {integrity: sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==} engines: {node: '>=12'} cpu: [ppc64] os: [aix] @@ -307,8 +310,8 @@ packages: dev: true optional: true - /@esbuild/android-arm64@0.20.1: - resolution: {integrity: sha512-hCnXNF0HM6AjowP+Zou0ZJMWWa1VkD77BXe959zERgGJBBxB+sV+J9f/rcjeg2c5bsukD/n17RKWXGFCO5dD5A==} + /@esbuild/android-arm64@0.20.2: + resolution: {integrity: sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -325,8 +328,8 @@ packages: dev: true optional: true - /@esbuild/android-arm@0.20.1: - resolution: {integrity: sha512-4j0+G27/2ZXGWR5okcJi7pQYhmkVgb4D7UKwxcqrjhvp5TKWx3cUjgB1CGj1mfdmJBQ9VnUGgUhign+FPF2Zgw==} + /@esbuild/android-arm@0.20.2: + resolution: {integrity: sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==} engines: {node: '>=12'} cpu: [arm] os: [android] @@ -343,8 +346,8 @@ packages: dev: true optional: true - /@esbuild/android-x64@0.20.1: - resolution: {integrity: sha512-MSfZMBoAsnhpS+2yMFYIQUPs8Z19ajwfuaSZx+tSl09xrHZCjbeXXMsUF/0oq7ojxYEpsSo4c0SfjxOYXRbpaA==} + /@esbuild/android-x64@0.20.2: + resolution: {integrity: sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -361,8 +364,8 @@ packages: dev: true optional: true - /@esbuild/darwin-arm64@0.20.1: - resolution: {integrity: sha512-Ylk6rzgMD8klUklGPzS414UQLa5NPXZD5tf8JmQU8GQrj6BrFA/Ic9tb2zRe1kOZyCbGl+e8VMbDRazCEBqPvA==} + /@esbuild/darwin-arm64@0.20.2: + resolution: {integrity: sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -379,8 +382,8 @@ packages: dev: true optional: true - /@esbuild/darwin-x64@0.20.1: - resolution: {integrity: sha512-pFIfj7U2w5sMp52wTY1XVOdoxw+GDwy9FsK3OFz4BpMAjvZVs0dT1VXs8aQm22nhwoIWUmIRaE+4xow8xfIDZA==} + /@esbuild/darwin-x64@0.20.2: + resolution: {integrity: sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -397,8 +400,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-arm64@0.20.1: - resolution: {integrity: sha512-UyW1WZvHDuM4xDz0jWun4qtQFauNdXjXOtIy7SYdf7pbxSWWVlqhnR/T2TpX6LX5NI62spt0a3ldIIEkPM6RHw==} + /@esbuild/freebsd-arm64@0.20.2: + resolution: {integrity: sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -415,8 +418,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-x64@0.20.1: - resolution: {integrity: sha512-itPwCw5C+Jh/c624vcDd9kRCCZVpzpQn8dtwoYIt2TJF3S9xJLiRohnnNrKwREvcZYx0n8sCSbvGH349XkcQeg==} + /@esbuild/freebsd-x64@0.20.2: + resolution: {integrity: sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -433,8 +436,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm64@0.20.1: - resolution: {integrity: sha512-cX8WdlF6Cnvw/DO9/X7XLH2J6CkBnz7Twjpk56cshk9sjYVcuh4sXQBy5bmTwzBjNVZze2yaV1vtcJS04LbN8w==} + /@esbuild/linux-arm64@0.20.2: + resolution: {integrity: sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -451,8 +454,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm@0.20.1: - resolution: {integrity: sha512-LojC28v3+IhIbfQ+Vu4Ut5n3wKcgTu6POKIHN9Wpt0HnfgUGlBuyDDQR4jWZUZFyYLiz4RBBBmfU6sNfn6RhLw==} + /@esbuild/linux-arm@0.20.2: + resolution: {integrity: sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -469,8 +472,8 @@ packages: dev: true optional: true - /@esbuild/linux-ia32@0.20.1: - resolution: {integrity: sha512-4H/sQCy1mnnGkUt/xszaLlYJVTz3W9ep52xEefGtd6yXDQbz/5fZE5dFLUgsPdbUOQANcVUa5iO6g3nyy5BJiw==} + /@esbuild/linux-ia32@0.20.2: + resolution: {integrity: sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -487,8 +490,8 @@ packages: dev: true optional: true - /@esbuild/linux-loong64@0.20.1: - resolution: {integrity: sha512-c0jgtB+sRHCciVXlyjDcWb2FUuzlGVRwGXgI+3WqKOIuoo8AmZAddzeOHeYLtD+dmtHw3B4Xo9wAUdjlfW5yYA==} + /@esbuild/linux-loong64@0.20.2: + resolution: {integrity: sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==} engines: {node: '>=12'} cpu: [loong64] os: [linux] @@ -505,8 +508,8 @@ packages: dev: true optional: true - /@esbuild/linux-mips64el@0.20.1: - resolution: {integrity: sha512-TgFyCfIxSujyuqdZKDZ3yTwWiGv+KnlOeXXitCQ+trDODJ+ZtGOzLkSWngynP0HZnTsDyBbPy7GWVXWaEl6lhA==} + /@esbuild/linux-mips64el@0.20.2: + resolution: {integrity: sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -523,8 +526,8 @@ packages: dev: true optional: true - /@esbuild/linux-ppc64@0.20.1: - resolution: {integrity: sha512-b+yuD1IUeL+Y93PmFZDZFIElwbmFfIKLKlYI8M6tRyzE6u7oEP7onGk0vZRh8wfVGC2dZoy0EqX1V8qok4qHaw==} + /@esbuild/linux-ppc64@0.20.2: + resolution: {integrity: sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -541,8 +544,8 @@ packages: dev: true optional: true - /@esbuild/linux-riscv64@0.20.1: - resolution: {integrity: sha512-wpDlpE0oRKZwX+GfomcALcouqjjV8MIX8DyTrxfyCfXxoKQSDm45CZr9fanJ4F6ckD4yDEPT98SrjvLwIqUCgg==} + /@esbuild/linux-riscv64@0.20.2: + resolution: {integrity: sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -559,8 +562,8 @@ packages: dev: true optional: true - /@esbuild/linux-s390x@0.20.1: - resolution: {integrity: sha512-5BepC2Au80EohQ2dBpyTquqGCES7++p7G+7lXe1bAIvMdXm4YYcEfZtQrP4gaoZ96Wv1Ute61CEHFU7h4FMueQ==} + /@esbuild/linux-s390x@0.20.2: + resolution: {integrity: sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -577,8 +580,8 @@ packages: dev: true optional: true - /@esbuild/linux-x64@0.20.1: - resolution: {integrity: sha512-5gRPk7pKuaIB+tmH+yKd2aQTRpqlf1E4f/mC+tawIm/CGJemZcHZpp2ic8oD83nKgUPMEd0fNanrnFljiruuyA==} + /@esbuild/linux-x64@0.20.2: + resolution: {integrity: sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -595,8 +598,8 @@ packages: dev: true optional: true - /@esbuild/netbsd-x64@0.20.1: - resolution: {integrity: sha512-4fL68JdrLV2nVW2AaWZBv3XEm3Ae3NZn/7qy2KGAt3dexAgSVT+Hc97JKSZnqezgMlv9x6KV0ZkZY7UO5cNLCg==} + /@esbuild/netbsd-x64@0.20.2: + resolution: {integrity: sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -613,8 +616,8 @@ packages: dev: true optional: true - /@esbuild/openbsd-x64@0.20.1: - resolution: {integrity: sha512-GhRuXlvRE+twf2ES+8REbeCb/zeikNqwD3+6S5y5/x+DYbAQUNl0HNBs4RQJqrechS4v4MruEr8ZtAin/hK5iw==} + /@esbuild/openbsd-x64@0.20.2: + resolution: {integrity: sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -631,8 +634,8 @@ packages: dev: true optional: true - /@esbuild/sunos-x64@0.20.1: - resolution: {integrity: sha512-ZnWEyCM0G1Ex6JtsygvC3KUUrlDXqOihw8RicRuQAzw+c4f1D66YlPNNV3rkjVW90zXVsHwZYWbJh3v+oQFM9Q==} + /@esbuild/sunos-x64@0.20.2: + resolution: {integrity: sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -649,8 +652,8 @@ packages: dev: true optional: true - /@esbuild/win32-arm64@0.20.1: - resolution: {integrity: sha512-QZ6gXue0vVQY2Oon9WyLFCdSuYbXSoxaZrPuJ4c20j6ICedfsDilNPYfHLlMH7vGfU5DQR0czHLmJvH4Nzis/A==} + /@esbuild/win32-arm64@0.20.2: + resolution: {integrity: sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -667,8 +670,8 @@ packages: dev: true optional: true - /@esbuild/win32-ia32@0.20.1: - resolution: {integrity: sha512-HzcJa1NcSWTAU0MJIxOho8JftNp9YALui3o+Ny7hCh0v5f90nprly1U3Sj1Ldj/CvKKdvvFsCRvDkpsEMp4DNw==} + /@esbuild/win32-ia32@0.20.2: + resolution: {integrity: sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -685,8 +688,8 @@ packages: dev: true optional: true - /@esbuild/win32-x64@0.20.1: - resolution: {integrity: sha512-0MBh53o6XtI6ctDnRMeQ+xoCN8kD2qI1rY1KgF/xdWQwoFeKou7puvDfV8/Wv4Ctx2rRpET/gGdz3YlNtNACSA==} + /@esbuild/win32-x64@0.20.2: + resolution: {integrity: sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -694,13 +697,13 @@ packages: dev: true optional: true - /@giscus/vue@2.4.0(vue@3.4.20): + /@giscus/vue@2.4.0(vue@3.4.21): resolution: {integrity: sha512-QOxKHgsMT91myyQagP2v20YYAei1ByZuc3qcaYxbHx4AwOeyVrybDIuRFwG9YDv6OraC86jYnU4Ixd37ddC/0A==} peerDependencies: vue: '>=3.2.0' dependencies: giscus: 1.5.0 - vue: 3.4.20 + vue: 3.4.21 dev: false /@jridgewell/sourcemap-codec@1.4.15: @@ -768,118 +771,118 @@ packages: unicode-trie: 0.3.1 dev: true - /@rollup/rollup-android-arm-eabi@4.12.0: - resolution: {integrity: sha512-+ac02NL/2TCKRrJu2wffk1kZ+RyqxVUlbjSagNgPm94frxtr+XDL12E5Ll1enWskLrtrZ2r8L3wED1orIibV/w==} + /@rollup/rollup-android-arm-eabi@4.13.0: + resolution: {integrity: sha512-5ZYPOuaAqEH/W3gYsRkxQATBW3Ii1MfaT4EQstTnLKViLi2gLSQmlmtTpGucNP3sXEpOiI5tdGhjdE111ekyEg==} cpu: [arm] os: [android] requiresBuild: true dev: true optional: true - /@rollup/rollup-android-arm64@4.12.0: - resolution: {integrity: sha512-OBqcX2BMe6nvjQ0Nyp7cC90cnumt8PXmO7Dp3gfAju/6YwG0Tj74z1vKrfRz7qAv23nBcYM8BCbhrsWqO7PzQQ==} + /@rollup/rollup-android-arm64@4.13.0: + resolution: {integrity: sha512-BSbaCmn8ZadK3UAQdlauSvtaJjhlDEjS5hEVVIN3A4bbl3X+otyf/kOJV08bYiRxfejP3DXFzO2jz3G20107+Q==} cpu: [arm64] os: [android] requiresBuild: true dev: true optional: true - /@rollup/rollup-darwin-arm64@4.12.0: - resolution: {integrity: sha512-X64tZd8dRE/QTrBIEs63kaOBG0b5GVEd3ccoLtyf6IdXtHdh8h+I56C2yC3PtC9Ucnv0CpNFJLqKFVgCYe0lOQ==} + /@rollup/rollup-darwin-arm64@4.13.0: + resolution: {integrity: sha512-Ovf2evVaP6sW5Ut0GHyUSOqA6tVKfrTHddtmxGQc1CTQa1Cw3/KMCDEEICZBbyppcwnhMwcDce9ZRxdWRpVd6g==} cpu: [arm64] os: [darwin] requiresBuild: true dev: true optional: true - /@rollup/rollup-darwin-x64@4.12.0: - resolution: {integrity: sha512-cc71KUZoVbUJmGP2cOuiZ9HSOP14AzBAThn3OU+9LcA1+IUqswJyR1cAJj3Mg55HbjZP6OLAIscbQsQLrpgTOg==} + /@rollup/rollup-darwin-x64@4.13.0: + resolution: {integrity: sha512-U+Jcxm89UTK592vZ2J9st9ajRv/hrwHdnvyuJpa5A2ngGSVHypigidkQJP+YiGL6JODiUeMzkqQzbCG3At81Gg==} cpu: [x64] os: [darwin] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm-gnueabihf@4.12.0: - resolution: {integrity: sha512-a6w/Y3hyyO6GlpKL2xJ4IOh/7d+APaqLYdMf86xnczU3nurFTaVN9s9jOXQg97BE4nYm/7Ga51rjec5nfRdrvA==} + /@rollup/rollup-linux-arm-gnueabihf@4.13.0: + resolution: {integrity: sha512-8wZidaUJUTIR5T4vRS22VkSMOVooG0F4N+JSwQXWSRiC6yfEsFMLTYRFHvby5mFFuExHa/yAp9juSphQQJAijQ==} cpu: [arm] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm64-gnu@4.12.0: - resolution: {integrity: sha512-0fZBq27b+D7Ar5CQMofVN8sggOVhEtzFUwOwPppQt0k+VR+7UHMZZY4y+64WJ06XOhBTKXtQB/Sv0NwQMXyNAA==} + /@rollup/rollup-linux-arm64-gnu@4.13.0: + resolution: {integrity: sha512-Iu0Kno1vrD7zHQDxOmvweqLkAzjxEVqNhUIXBsZ8hu8Oak7/5VTPrxOEZXYC1nmrBVJp0ZcL2E7lSuuOVaE3+w==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm64-musl@4.12.0: - resolution: {integrity: sha512-eTvzUS3hhhlgeAv6bfigekzWZjaEX9xP9HhxB0Dvrdbkk5w/b+1Sxct2ZuDxNJKzsRStSq1EaEkVSEe7A7ipgQ==} + /@rollup/rollup-linux-arm64-musl@4.13.0: + resolution: {integrity: sha512-C31QrW47llgVyrRjIwiOwsHFcaIwmkKi3PCroQY5aVq4H0A5v/vVVAtFsI1nfBngtoRpeREvZOkIhmRwUKkAdw==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-riscv64-gnu@4.12.0: - resolution: {integrity: sha512-ix+qAB9qmrCRiaO71VFfY8rkiAZJL8zQRXveS27HS+pKdjwUfEhqo2+YF2oI+H/22Xsiski+qqwIBxVewLK7sw==} + /@rollup/rollup-linux-riscv64-gnu@4.13.0: + resolution: {integrity: sha512-Oq90dtMHvthFOPMl7pt7KmxzX7E71AfyIhh+cPhLY9oko97Zf2C9tt/XJD4RgxhaGeAraAXDtqxvKE1y/j35lA==} cpu: [riscv64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-x64-gnu@4.12.0: - resolution: {integrity: sha512-TenQhZVOtw/3qKOPa7d+QgkeM6xY0LtwzR8OplmyL5LrgTWIXpTQg2Q2ycBf8jm+SFW2Wt/DTn1gf7nFp3ssVA==} + /@rollup/rollup-linux-x64-gnu@4.13.0: + resolution: {integrity: sha512-yUD/8wMffnTKuiIsl6xU+4IA8UNhQ/f1sAnQebmE/lyQ8abjsVyDkyRkWop0kdMhKMprpNIhPmYlCxgHrPoXoA==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-x64-musl@4.12.0: - resolution: {integrity: sha512-LfFdRhNnW0zdMvdCb5FNuWlls2WbbSridJvxOvYWgSBOYZtgBfW9UGNJG//rwMqTX1xQE9BAodvMH9tAusKDUw==} + /@rollup/rollup-linux-x64-musl@4.13.0: + resolution: {integrity: sha512-9RyNqoFNdF0vu/qqX63fKotBh43fJQeYC98hCaf89DYQpv+xu0D8QFSOS0biA7cGuqJFOc1bJ+m2rhhsKcw1hw==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-arm64-msvc@4.12.0: - resolution: {integrity: sha512-JPDxovheWNp6d7AHCgsUlkuCKvtu3RB55iNEkaQcf0ttsDU/JZF+iQnYcQJSk/7PtT4mjjVG8N1kpwnI9SLYaw==} + /@rollup/rollup-win32-arm64-msvc@4.13.0: + resolution: {integrity: sha512-46ue8ymtm/5PUU6pCvjlic0z82qWkxv54GTJZgHrQUuZnVH+tvvSP0LsozIDsCBFO4VjJ13N68wqrKSeScUKdA==} cpu: [arm64] os: [win32] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-ia32-msvc@4.12.0: - resolution: {integrity: sha512-fjtuvMWRGJn1oZacG8IPnzIV6GF2/XG+h71FKn76OYFqySXInJtseAqdprVTDTyqPxQOG9Exak5/E9Z3+EJ8ZA==} + /@rollup/rollup-win32-ia32-msvc@4.13.0: + resolution: {integrity: sha512-P5/MqLdLSlqxbeuJ3YDeX37srC8mCflSyTrUsgbU1c/U9j6l2g2GiIdYaGD9QjdMQPMSgYm7hgg0551wHyIluw==} cpu: [ia32] os: [win32] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-x64-msvc@4.12.0: - resolution: {integrity: sha512-ZYmr5mS2wd4Dew/JjT0Fqi2NPB/ZhZ2VvPp7SmvPZb4Y1CG/LRcS6tcRo2cYU7zLK5A7cdbhWnnWmUjoI4qapg==} + /@rollup/rollup-win32-x64-msvc@4.13.0: + resolution: {integrity: sha512-UKXUQNbO3DOhzLRwHSpa0HnhhCgNODvfoPWv2FCXme8N/ANFfhIPMGuOT+QuKd16+B5yxZ0HdpNlqPvTMS1qfw==} cpu: [x64] os: [win32] requiresBuild: true dev: true optional: true - /@shikijs/core@1.1.7: - resolution: {integrity: sha512-gTYLUIuD1UbZp/11qozD3fWpUTuMqPSf3svDMMrL0UmlGU7D9dPw/V1FonwAorCUJBltaaESxq90jrSjQyGixg==} + /@shikijs/core@1.2.0: + resolution: {integrity: sha512-OlFvx+nyr5C8zpcMBnSGir0YPD6K11uYhouqhNmm1qLiis4GA7SsGtu07r9gKS9omks8RtQqHrJL4S+lqWK01A==} dev: true - /@shikijs/transformers@1.1.7: - resolution: {integrity: sha512-lXz011ao4+rvweps/9h3CchBfzb1U5OtP5D51Tqc9lQYdLblWMIxQxH6Ybe1GeGINcEVM4goMyPrI0JvlIp4UQ==} + /@shikijs/transformers@1.2.0: + resolution: {integrity: sha512-xKn7DtA65DQV4FOfYsrvqM80xOy2xuXnxWWKsZmHv1VII/IOuDUDsWDu3KnpeLH6wqNJWp1GRoNUsHR1aw/VhQ==} dependencies: - shiki: 1.1.7 + shiki: 1.2.0 dev: true /@tootallnate/quickjs-emscripten@0.23.0: @@ -913,8 +916,8 @@ packages: resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==} dev: false - /@types/node@20.11.20: - resolution: {integrity: sha512-7/rR21OS+fq8IyHTgtLkDK949uzsa6n8BkziAKtPVpugIkO6D+/ooXMvzXxDnZrmtXVfjb1bKQafYpb8s89LOg==} + /@types/node@20.11.28: + resolution: {integrity: sha512-M/GPWVS2wLkSkNHVeLkrF2fD5Lx5UC4PxA0uZcKc6QqbIQUJyW1jVjueJYi1z8n0I5PxYrtpnPnWglE+y9A0KA==} requiresBuild: true dependencies: undici-types: 5.26.5 @@ -939,126 +942,126 @@ packages: resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} requiresBuild: true dependencies: - '@types/node': 20.11.20 + '@types/node': 20.11.28 dev: true optional: true - /@vitejs/plugin-vue@5.0.4(vite@5.1.4)(vue@3.4.20): + /@vitejs/plugin-vue@5.0.4(vite@5.1.6)(vue@3.4.21): resolution: {integrity: sha512-WS3hevEszI6CEVEx28F8RjTX97k3KsrcY6kvTg7+Whm5y3oYvcqzVeGCU3hxSAn4uY2CLCkeokkGKpoctccilQ==} engines: {node: ^18.0.0 || >=20.0.0} peerDependencies: vite: ^5.0.0 vue: ^3.2.25 dependencies: - vite: 5.1.4 - vue: 3.4.20 + vite: 5.1.6 + vue: 3.4.21 dev: true - /@vue/compiler-core@3.4.20: - resolution: {integrity: sha512-l7M+xUuL8hrGtRLkrf+62d9zucAdgqNBTbJ/NufCOIuJQhauhfyAKH9ra/qUctCXcULwmclGAVpvmxjbBO30qg==} + /@vue/compiler-core@3.4.21: + resolution: {integrity: sha512-MjXawxZf2SbZszLPYxaFCjxfibYrzr3eYbKxwpLR9EQN+oaziSu3qKVbwBERj1IFIB8OLUewxB5m/BFzi613og==} dependencies: - '@babel/parser': 7.23.9 - '@vue/shared': 3.4.20 + '@babel/parser': 7.24.0 + '@vue/shared': 3.4.21 entities: 4.5.0 estree-walker: 2.0.2 source-map-js: 1.0.2 - /@vue/compiler-dom@3.4.20: - resolution: {integrity: sha512-/cSBGL79HFBYgDnqCNKErOav3bPde3n0sJwJM2Z09rXlkiowV/2SG1tgDAiWS1CatS4Cvo0o74e1vNeCK1R3RA==} + /@vue/compiler-dom@3.4.21: + resolution: {integrity: sha512-IZC6FKowtT1sl0CR5DpXSiEB5ayw75oT2bma1BEhV7RRR1+cfwLrxc2Z8Zq/RGFzJ8w5r9QtCOvTjQgdn0IKmA==} dependencies: - '@vue/compiler-core': 3.4.20 - '@vue/shared': 3.4.20 + '@vue/compiler-core': 3.4.21 + '@vue/shared': 3.4.21 - /@vue/compiler-sfc@3.4.20: - resolution: {integrity: sha512-nPuTZz0yxTPzjyYe+9nQQsFYImcz/57UX8N3jyhl5oIUUs2jqqAMaULsAlJwve3qNYfjQzq0bwy3pqJrN9ecZw==} + /@vue/compiler-sfc@3.4.21: + resolution: {integrity: sha512-me7epoTxYlY+2CUM7hy9PCDdpMPfIwrOvAXud2Upk10g4YLv9UBW7kL798TvMeDhPthkZ0CONNrK2GoeI1ODiQ==} dependencies: - '@babel/parser': 7.23.9 - '@vue/compiler-core': 3.4.20 - '@vue/compiler-dom': 3.4.20 - '@vue/compiler-ssr': 3.4.20 - '@vue/shared': 3.4.20 + '@babel/parser': 7.24.0 + '@vue/compiler-core': 3.4.21 + '@vue/compiler-dom': 3.4.21 + '@vue/compiler-ssr': 3.4.21 + '@vue/shared': 3.4.21 estree-walker: 2.0.2 - magic-string: 0.30.7 + magic-string: 0.30.8 postcss: 8.4.35 source-map-js: 1.0.2 - /@vue/compiler-ssr@3.4.20: - resolution: {integrity: sha512-b3gFQPiHLvI12C56otzBPpQhZ5kgkJ5RMv/zpLjLC2BIFwX5GktDqYQ7xg0Q2grP6uFI8al3beVKvAVxFtXmIg==} + /@vue/compiler-ssr@3.4.21: + resolution: {integrity: sha512-M5+9nI2lPpAsgXOGQobnIueVqc9sisBFexh5yMIMRAPYLa7+5wEJs8iqOZc1WAa9WQbx9GR2twgznU8LTIiZ4Q==} dependencies: - '@vue/compiler-dom': 3.4.20 - '@vue/shared': 3.4.20 + '@vue/compiler-dom': 3.4.21 + '@vue/shared': 3.4.21 - /@vue/devtools-api@7.0.15(vue@3.4.20): - resolution: {integrity: sha512-kgEYWosDyWpS1vFSuJNNWUnHkP+VkL3Y+9mw+rf7ex41SwbYL/WdC3KXqAtjiSrEs7r/FrHmUTh0BkINJPFkbA==} + /@vue/devtools-api@7.0.17(vue@3.4.21): + resolution: {integrity: sha512-UWU9tqzUBv+ttUxYLaQcL5IxSSdF+i6yheFiEtz7mh88YZUYkxpEmT43iKBs3YsC54ROwPD2iZIndnju6PWfOQ==} dependencies: - '@vue/devtools-kit': 7.0.15(vue@3.4.20) + '@vue/devtools-kit': 7.0.17(vue@3.4.21) transitivePeerDependencies: - vue dev: true - /@vue/devtools-kit@7.0.15(vue@3.4.20): - resolution: {integrity: sha512-dT7OeCe1LUCIhHIb/yRR6Hn+XHh73r1o78onqCrxEKHdoZwBItiIeVnmJZPEUDFstIxfs+tJL231mySk3laTow==} + /@vue/devtools-kit@7.0.17(vue@3.4.21): + resolution: {integrity: sha512-znPLSOoTP3RnR9fvkq5M+nnpEA+WocybzOo5ID73vYkE0/n0VcfU8Ld0j4AHQjV/omTdAzh6QLpPlUYdIHXg+w==} peerDependencies: vue: ^3.0.0 dependencies: - '@vue/devtools-shared': 7.0.15 + '@vue/devtools-shared': 7.0.17 hookable: 5.5.3 mitt: 3.0.1 perfect-debounce: 1.0.0 speakingurl: 14.0.1 - vue: 3.4.20 + vue: 3.4.21 dev: true - /@vue/devtools-shared@7.0.15: - resolution: {integrity: sha512-fpfvMVvS7aDgO7x2JPFiTQ1MHcCc63/bE7yTgs278gMBybuO9b3hdiZ/k0Pw1rN+RefaU9yQiFA+5CCFc1D+6w==} + /@vue/devtools-shared@7.0.17: + resolution: {integrity: sha512-QNg2TMQBFFffRbTKE9NjytXBywGR77p2UMi/gJ0ow58S+1jkAvL8ikU/JnSs9ePvsVtspHX32m2cdfe4DJ4ygw==} dependencies: rfdc: 1.3.1 dev: true - /@vue/reactivity@3.4.20: - resolution: {integrity: sha512-P5LJcxUkG6inlHr6MHVA4AVFAmRYJQ7ONGWJILNjMjoYuEXFhYviSCb9BEMyszSG/1kWCZbtWQlKSLasFRpThw==} + /@vue/reactivity@3.4.21: + resolution: {integrity: sha512-UhenImdc0L0/4ahGCyEzc/pZNwVgcglGy9HVzJ1Bq2Mm9qXOpP8RyNTjookw/gOCUlXSEtuZ2fUg5nrHcoqJcw==} dependencies: - '@vue/shared': 3.4.20 + '@vue/shared': 3.4.21 - /@vue/runtime-core@3.4.20: - resolution: {integrity: sha512-MPvsQpGAxoBqLHjqopt4YPtUYBpq0K6oAWDTwIR1CTNZ3y9O/J2ZVh+i2JpxKNYwANJBiZ20O99NE20uisB7xw==} + /@vue/runtime-core@3.4.21: + resolution: {integrity: sha512-pQthsuYzE1XcGZznTKn73G0s14eCJcjaLvp3/DKeYWoFacD9glJoqlNBxt3W2c5S40t6CCcpPf+jG01N3ULyrA==} dependencies: - '@vue/reactivity': 3.4.20 - '@vue/shared': 3.4.20 + '@vue/reactivity': 3.4.21 + '@vue/shared': 3.4.21 - /@vue/runtime-dom@3.4.20: - resolution: {integrity: sha512-OkbPVP69H+8m74543zMAAx/LIkajxufYyow41gc0s5iF0uplT5uTQ4llDYu1GeJZEI8wjL5ueiPQruk4qwOMmA==} + /@vue/runtime-dom@3.4.21: + resolution: {integrity: sha512-gvf+C9cFpevsQxbkRBS1NpU8CqxKw0ebqMvLwcGQrNpx6gqRDodqKqA+A2VZZpQ9RpK2f9yfg8VbW/EpdFUOJw==} dependencies: - '@vue/runtime-core': 3.4.20 - '@vue/shared': 3.4.20 + '@vue/runtime-core': 3.4.21 + '@vue/shared': 3.4.21 csstype: 3.1.3 - /@vue/server-renderer@3.4.20(vue@3.4.20): - resolution: {integrity: sha512-w3VH2GuwxQHA6pJo/HCV22OfVC8Mw4oeHQM+vKeqtRK0OPE1Wilnh+P/SDVGGxPjJsGmyfphi0dbw8UKZQJH9w==} + /@vue/server-renderer@3.4.21(vue@3.4.21): + resolution: {integrity: sha512-aV1gXyKSN6Rz+6kZ6kr5+Ll14YzmIbeuWe7ryJl5muJ4uwSwY/aStXTixx76TwkZFJLm1aAlA/HSWEJ4EyiMkg==} peerDependencies: - vue: 3.4.20 + vue: 3.4.21 dependencies: - '@vue/compiler-ssr': 3.4.20 - '@vue/shared': 3.4.20 - vue: 3.4.20 + '@vue/compiler-ssr': 3.4.21 + '@vue/shared': 3.4.21 + vue: 3.4.21 - /@vue/shared@3.4.20: - resolution: {integrity: sha512-KTEngal0aiUvNJ6I1Chk5Ew5XqChsFsxP4GKAYXWb99zKJWjNU72p2FWEOmZWHxHcqtniOJsgnpd3zizdpfEag==} + /@vue/shared@3.4.21: + resolution: {integrity: sha512-PuJe7vDIi6VYSinuEbUIQgMIRZGgM8e4R+G+/dQTk0X1NEdvgvvgv7m+rfmDH1gZzyA1OjjoWskvHlfRNfQf3g==} - /@vueuse/core@10.8.0(vue@3.4.20): - resolution: {integrity: sha512-G9Ok9fjx10TkNIPn8V1dJmK1NcdJCtYmDRyYiTMUyJ1p0Tywc1zmOoCQ2xhHYyz8ULBU4KjIJQ9n+Lrty74iVw==} + /@vueuse/core@10.9.0(vue@3.4.21): + resolution: {integrity: sha512-/1vjTol8SXnx6xewDEKfS0Ra//ncg4Hb0DaZiwKf7drgfMsKFExQ+FnnENcN6efPen+1kIzhLQoGSy0eDUVOMg==} dependencies: '@types/web-bluetooth': 0.0.20 - '@vueuse/metadata': 10.8.0 - '@vueuse/shared': 10.8.0(vue@3.4.20) - vue-demi: 0.14.7(vue@3.4.20) + '@vueuse/metadata': 10.9.0 + '@vueuse/shared': 10.9.0(vue@3.4.21) + vue-demi: 0.14.7(vue@3.4.21) transitivePeerDependencies: - '@vue/composition-api' - vue dev: true - /@vueuse/integrations@10.8.0(focus-trap@7.5.4)(vue@3.4.20): - resolution: {integrity: sha512-sw3P/7cXOfNLQfERp7P0IJ2ODjLE2C3BGXpBQJQkS309c1jbJak9yu4EnY70WaZjkj53aeWSFU6BbHrUxXJ7SA==} + /@vueuse/integrations@10.9.0(focus-trap@7.5.4)(vue@3.4.21): + resolution: {integrity: sha512-acK+A01AYdWSvL4BZmCoJAcyHJ6EqhmkQEXbQLwev1MY7NBnS+hcEMx/BzVoR9zKI+UqEPMD9u6PsyAuiTRT4Q==} peerDependencies: async-validator: '*' axios: '*' @@ -1098,23 +1101,23 @@ packages: universal-cookie: optional: true dependencies: - '@vueuse/core': 10.8.0(vue@3.4.20) - '@vueuse/shared': 10.8.0(vue@3.4.20) + '@vueuse/core': 10.9.0(vue@3.4.21) + '@vueuse/shared': 10.9.0(vue@3.4.21) focus-trap: 7.5.4 - vue-demi: 0.14.7(vue@3.4.20) + vue-demi: 0.14.7(vue@3.4.21) transitivePeerDependencies: - '@vue/composition-api' - vue dev: true - /@vueuse/metadata@10.8.0: - resolution: {integrity: sha512-Nim/Vle5OgXcXhAvGOgkJQXB1Yb+Kq/fMbLuv3YYDYbiQrwr39ljuD4k9fPeq4yUyokYRo2RaNQmbbIMWB/9+w==} + /@vueuse/metadata@10.9.0: + resolution: {integrity: sha512-iddNbg3yZM0X7qFY2sAotomgdHK7YJ6sKUvQqbvwnf7TmaVPxS4EJydcNsVejNdS8iWCtDk+fYXr7E32nyTnGA==} dev: true - /@vueuse/shared@10.8.0(vue@3.4.20): - resolution: {integrity: sha512-dUdy6zwHhULGxmr9YUg8e+EnB39gcM4Fe2oKBSrh3cOsV30JcMPtsyuspgFCUo5xxFNaeMf/W2yyKfST7Bg8oQ==} + /@vueuse/shared@10.9.0(vue@3.4.21): + resolution: {integrity: sha512-Uud2IWncmAfJvRaFYzv5OHDli+FbOzxiVEQdLCKQKLyhz94PIyFC3CHcH7EDMwIn8NPtD06+PNbC/PiO0LGLtw==} dependencies: - vue-demi: 0.14.7(vue@3.4.20) + vue-demi: 0.14.7(vue@3.4.21) transitivePeerDependencies: - '@vue/composition-api' - vue @@ -1205,8 +1208,8 @@ packages: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} dev: true - /bare-events@2.2.0: - resolution: {integrity: sha512-Yyyqff4PIFfSuthCZqLlPISTWHmnQxoPuAvkmgzsJEmG3CesdIv6Xweayl0JkCZJSB2yYIdJyEz97tpxNhgjbg==} + /bare-events@2.2.1: + resolution: {integrity: sha512-9GYPpsPFvrWBkelIhOhTWtkeZxVxZOdb3VnFTCzlOo3OjvmTvzLoZFUT8kNFACx0vJej6QPney1Cf9BvzCNE/A==} requiresBuild: true dev: true optional: true @@ -1215,8 +1218,8 @@ packages: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} dev: true - /basic-ftp@5.0.4: - resolution: {integrity: sha512-8PzkB0arJFV4jJWSGOYR+OEic6aeKMu/osRhBULN6RY0ykby6LKhbmuQ5ublvaas5BOwboah5D87nrHyuh8PPA==} + /basic-ftp@5.0.5: + resolution: {integrity: sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg==} engines: {node: '>=10.0.0'} dev: true @@ -1259,13 +1262,13 @@ packages: ieee754: 1.2.1 dev: true - /bundle-require@4.0.2(esbuild@0.20.1): + /bundle-require@4.0.2(esbuild@0.20.2): resolution: {integrity: sha512-jwzPOChofl67PSTW2SGubV9HBQAhhR2i6nskiOThauo9dzwDUgOWQScFVaJkjEfYX+UXiD+LEx8EblQMc2wIag==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} peerDependencies: esbuild: '>=0.17' dependencies: - esbuild: 0.20.1 + esbuild: 0.20.2 load-tsconfig: 0.2.5 dev: true @@ -1494,35 +1497,35 @@ packages: '@esbuild/win32-x64': 0.19.12 dev: true - /esbuild@0.20.1: - resolution: {integrity: sha512-OJwEgrpWm/PCMsLVWXKqvcjme3bHNpOgN7Tb6cQnR5n0TPbQx1/Xrn7rqM+wn17bYeT6MGB5sn1Bh5YiGi70nA==} + /esbuild@0.20.2: + resolution: {integrity: sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - '@esbuild/aix-ppc64': 0.20.1 - '@esbuild/android-arm': 0.20.1 - '@esbuild/android-arm64': 0.20.1 - '@esbuild/android-x64': 0.20.1 - '@esbuild/darwin-arm64': 0.20.1 - '@esbuild/darwin-x64': 0.20.1 - '@esbuild/freebsd-arm64': 0.20.1 - '@esbuild/freebsd-x64': 0.20.1 - '@esbuild/linux-arm': 0.20.1 - '@esbuild/linux-arm64': 0.20.1 - '@esbuild/linux-ia32': 0.20.1 - '@esbuild/linux-loong64': 0.20.1 - '@esbuild/linux-mips64el': 0.20.1 - '@esbuild/linux-ppc64': 0.20.1 - '@esbuild/linux-riscv64': 0.20.1 - '@esbuild/linux-s390x': 0.20.1 - '@esbuild/linux-x64': 0.20.1 - '@esbuild/netbsd-x64': 0.20.1 - '@esbuild/openbsd-x64': 0.20.1 - '@esbuild/sunos-x64': 0.20.1 - '@esbuild/win32-arm64': 0.20.1 - '@esbuild/win32-ia32': 0.20.1 - '@esbuild/win32-x64': 0.20.1 + '@esbuild/aix-ppc64': 0.20.2 + '@esbuild/android-arm': 0.20.2 + '@esbuild/android-arm64': 0.20.2 + '@esbuild/android-x64': 0.20.2 + '@esbuild/darwin-arm64': 0.20.2 + '@esbuild/darwin-x64': 0.20.2 + '@esbuild/freebsd-arm64': 0.20.2 + '@esbuild/freebsd-x64': 0.20.2 + '@esbuild/linux-arm': 0.20.2 + '@esbuild/linux-arm64': 0.20.2 + '@esbuild/linux-ia32': 0.20.2 + '@esbuild/linux-loong64': 0.20.2 + '@esbuild/linux-mips64el': 0.20.2 + '@esbuild/linux-ppc64': 0.20.2 + '@esbuild/linux-riscv64': 0.20.2 + '@esbuild/linux-s390x': 0.20.2 + '@esbuild/linux-x64': 0.20.2 + '@esbuild/netbsd-x64': 0.20.2 + '@esbuild/openbsd-x64': 0.20.2 + '@esbuild/sunos-x64': 0.20.2 + '@esbuild/win32-arm64': 0.20.2 + '@esbuild/win32-ia32': 0.20.2 + '@esbuild/win32-x64': 0.20.2 dev: true /escalade@3.1.2: @@ -1651,6 +1654,11 @@ packages: engines: {node: 6.* || 8.* || >= 10.*} dev: true + /get-east-asian-width@1.2.0: + resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} + engines: {node: '>=18'} + dev: false + /get-stream@5.2.0: resolution: {integrity: sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==} engines: {node: '>=8'} @@ -1662,7 +1670,7 @@ packages: resolution: {integrity: sha512-BzUrJBS9EcUb4cFol8r4W3v1cPsSyajLSthNkz5BxbpDcHN5tIrM10E2eNvfnvBn3DaT3DUgx0OpsBKkaOpanw==} engines: {node: '>= 14'} dependencies: - basic-ftp: 5.0.4 + basic-ftp: 5.0.5 data-uri-to-buffer: 6.0.2 debug: 4.3.4 fs-extra: 11.2.0 @@ -1699,8 +1707,8 @@ packages: resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==} dev: true - /html-entities@2.4.0: - resolution: {integrity: sha512-igBTJcNNNhvZFRtm8uA6xMY6xYleeDwn3PeBCkDz7tHttv4F2hsDI2aPgNERWzvRcNYHNT3ymRaQzllmXj4YsQ==} + /html-entities@2.5.2: + resolution: {integrity: sha512-K//PSRMQk4FZ78Kyau+mZurHn3FH0Vwr+H36eE0rPbeYkRRi9YxceYPhuN60UwWorxyKHhqoAJl2OFKa4BVtaA==} dev: true /html-export-pdf-cli@1.1.5: @@ -1711,7 +1719,7 @@ packages: cli-progress: 3.12.0 commander: 11.1.0 fast-glob: 3.3.2 - html-entities: 2.4.0 + html-entities: 2.5.2 pdf-lib: 1.17.1 puppeteer: 21.11.0 transitivePeerDependencies: @@ -1877,8 +1885,8 @@ packages: engines: {node: '>=12'} dev: true - /magic-string@0.30.7: - resolution: {integrity: sha512-8vBuFF/I/+OSLRmdf2wwFCJCz+nSn0m6DPvGH1fS/KiQoSaR+sETbov0eIk9KhEKy8CYqIkIAnbohxT/4H0kuA==} + /magic-string@0.30.8: + resolution: {integrity: sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==} engines: {node: '>=12'} dependencies: '@jridgewell/sourcemap-codec': 1.4.15 @@ -1887,6 +1895,12 @@ packages: resolution: {integrity: sha512-1I+1qpDt4idfgLQG+BNWmrqku+7/2bi5nLf4YwF8y8zXvmfiTBY3PV3ZibfrjBueCByROpuBjLLFCajqkgYoLQ==} dev: true + /markdown-it-cjk-breaks@2.0.0: + resolution: {integrity: sha512-hzgyuNzXuHoNJuPW+b4IXEtqaLeD4xNloqFVWG/wzT3O0npoDiwaEFY6JiglFjUh5//xvE0N21GU07NMxw4TiA==} + dependencies: + get-east-asian-width: 1.2.0 + dev: false + /markdown-it-footnote@4.0.0: resolution: {integrity: sha512-WYJ7urf+khJYl3DqofQpYfEYkZKbmXmwxQV8c8mO/hGIhgZ1wOe7R4HLFNwqx7TjILbnC98fuyeSsin19JdFcQ==} dev: false @@ -2207,26 +2221,26 @@ packages: resolution: {integrity: sha512-r5a3l5HzYlIC68TpmYKlxWjmOP6wiPJ1vWv2HeLhNsRZMrCkxeqxiHlQ21oXmQ4F3SiryXBHhAD7JZqvOJjFmg==} dev: true - /rollup@4.12.0: - resolution: {integrity: sha512-wz66wn4t1OHIJw3+XU7mJJQV/2NAfw5OAk6G6Hoo3zcvz/XOfQ52Vgi+AN4Uxoxi0KBBwk2g8zPrTDA4btSB/Q==} + /rollup@4.13.0: + resolution: {integrity: sha512-3YegKemjoQnYKmsBlOHfMLVPPA5xLkQ8MHLLSw/fBrFaVkEayL51DilPpNNLq1exr98F2B1TzrV0FUlN3gWRPg==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true dependencies: '@types/estree': 1.0.5 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.12.0 - '@rollup/rollup-android-arm64': 4.12.0 - '@rollup/rollup-darwin-arm64': 4.12.0 - '@rollup/rollup-darwin-x64': 4.12.0 - '@rollup/rollup-linux-arm-gnueabihf': 4.12.0 - '@rollup/rollup-linux-arm64-gnu': 4.12.0 - '@rollup/rollup-linux-arm64-musl': 4.12.0 - '@rollup/rollup-linux-riscv64-gnu': 4.12.0 - '@rollup/rollup-linux-x64-gnu': 4.12.0 - '@rollup/rollup-linux-x64-musl': 4.12.0 - '@rollup/rollup-win32-arm64-msvc': 4.12.0 - '@rollup/rollup-win32-ia32-msvc': 4.12.0 - '@rollup/rollup-win32-x64-msvc': 4.12.0 + '@rollup/rollup-android-arm-eabi': 4.13.0 + '@rollup/rollup-android-arm64': 4.13.0 + '@rollup/rollup-darwin-arm64': 4.13.0 + '@rollup/rollup-darwin-x64': 4.13.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.13.0 + '@rollup/rollup-linux-arm64-gnu': 4.13.0 + '@rollup/rollup-linux-arm64-musl': 4.13.0 + '@rollup/rollup-linux-riscv64-gnu': 4.13.0 + '@rollup/rollup-linux-x64-gnu': 4.13.0 + '@rollup/rollup-linux-x64-musl': 4.13.0 + '@rollup/rollup-win32-arm64-msvc': 4.13.0 + '@rollup/rollup-win32-ia32-msvc': 4.13.0 + '@rollup/rollup-win32-x64-msvc': 4.13.0 fsevents: 2.3.3 dev: true @@ -2255,10 +2269,10 @@ packages: lru-cache: 6.0.0 dev: true - /shiki@1.1.7: - resolution: {integrity: sha512-9kUTMjZtcPH3i7vHunA6EraTPpPOITYTdA5uMrvsJRexktqP0s7P3s9HVK80b4pP42FRVe03D7fT3NmJv2yYhw==} + /shiki@1.2.0: + resolution: {integrity: sha512-xLhiTMOIUXCv5DqJ4I70GgQCtdlzsTqFLZWcMHHG3TAieBUbvEGthdrlPDlX4mL/Wszx9C6rEcxU6kMlg4YlxA==} dependencies: - '@shikijs/core': 1.1.7 + '@shikijs/core': 1.2.0 dev: true /signal-exit@3.0.7: @@ -2342,7 +2356,7 @@ packages: fast-fifo: 1.3.2 queue-tick: 1.0.1 optionalDependencies: - bare-events: 2.2.0 + bare-events: 2.2.1 dev: true /string-width@4.2.3: @@ -2478,8 +2492,8 @@ packages: hasBin: true dev: true - /vite@5.1.4: - resolution: {integrity: sha512-n+MPqzq+d9nMVTKyewqw6kSt+R3CkvF9QAKY8obiQn8g1fwTscKxyfaYnC632HtBXAQGc1Yjomphwn1dtwGAHg==} + /vite@5.1.6: + resolution: {integrity: sha512-yYIAZs9nVfRJ/AiOLCA91zzhjsHUgMjB+EigzFb6W2XTLO8JixBCKCjvhKZaye+NKYHCrkv3Oh50dH9EdLU2RA==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: @@ -2508,22 +2522,22 @@ packages: dependencies: esbuild: 0.19.12 postcss: 8.4.35 - rollup: 4.12.0 + rollup: 4.13.0 optionalDependencies: fsevents: 2.3.3 dev: true - /vitepress-export-pdf@1.0.0-beta.0(esbuild@0.20.1)(vitepress@1.0.0-rc.44): + /vitepress-export-pdf@1.0.0-beta.0(esbuild@0.20.2)(vitepress@1.0.0-rc.45): resolution: {integrity: sha512-DTI1A0ntWy08OXNWmwZC9lSEG69z/tTzng8MVwdvttG4mIHOrEwD9NUZucQPr6o5YgpWDIEsm/J92/Yt+/IgRg==} engines: {node: '>=14.6.0'} hasBin: true peerDependencies: vitepress: '>=1.0.0-alpha.35 <=1.x' dependencies: - '@condorhero/vuepress-plugin-export-pdf-core': 3.0.2(esbuild@0.20.1) + '@condorhero/vuepress-plugin-export-pdf-core': 3.0.2(esbuild@0.20.2) debug: 4.3.4 hash-sum: 2.0.0 - vitepress: 1.0.0-rc.44(@algolia/client-search@4.22.1)(search-insights@2.13.0) + vitepress: 1.0.0-rc.45(@algolia/client-search@4.22.1)(search-insights@2.13.0) transitivePeerDependencies: - bufferutil - encoding @@ -2533,16 +2547,16 @@ packages: - utf-8-validate dev: true - /vitepress-plugin-comment-with-giscus@1.1.12(vue@3.4.20): + /vitepress-plugin-comment-with-giscus@1.1.12(vue@3.4.21): resolution: {integrity: sha512-kUN0NraWXG27BnArVCveZUEpWahT5tT+DFLXRcnuoAtiYfu8qJ/lo/mdzjdSuqFMCWVHjCEx6vVYbVMQKPnRHQ==} dependencies: - '@giscus/vue': 2.4.0(vue@3.4.20) + '@giscus/vue': 2.4.0(vue@3.4.21) transitivePeerDependencies: - vue dev: false - /vitepress@1.0.0-rc.44(@algolia/client-search@4.22.1)(search-insights@2.13.0): - resolution: {integrity: sha512-tO5taxGI7fSpBK1D8zrZTyJJERlyU9nnt0jHSt3fywfq3VKn977Hg0wUuTkEmwXlFYwuW26+6+3xorf4nD3XvA==} + /vitepress@1.0.0-rc.45(@algolia/client-search@4.22.1)(search-insights@2.13.0): + resolution: {integrity: sha512-/OiYsu5UKpQKA2c0BAZkfyywjfauDjvXyv6Mo4Ra57m5n4Bxg1HgUGoth1CLH2vwUbR/BHvDA9zOM0RDvgeSVQ==} hasBin: true peerDependencies: markdown-it-mathjax3: ^4.3.2 @@ -2553,21 +2567,21 @@ packages: postcss: optional: true dependencies: - '@docsearch/css': 3.5.2 - '@docsearch/js': 3.5.2(@algolia/client-search@4.22.1)(search-insights@2.13.0) - '@shikijs/core': 1.1.7 - '@shikijs/transformers': 1.1.7 + '@docsearch/css': 3.6.0 + '@docsearch/js': 3.6.0(@algolia/client-search@4.22.1)(search-insights@2.13.0) + '@shikijs/core': 1.2.0 + '@shikijs/transformers': 1.2.0 '@types/markdown-it': 13.0.7 - '@vitejs/plugin-vue': 5.0.4(vite@5.1.4)(vue@3.4.20) - '@vue/devtools-api': 7.0.15(vue@3.4.20) - '@vueuse/core': 10.8.0(vue@3.4.20) - '@vueuse/integrations': 10.8.0(focus-trap@7.5.4)(vue@3.4.20) + '@vitejs/plugin-vue': 5.0.4(vite@5.1.6)(vue@3.4.21) + '@vue/devtools-api': 7.0.17(vue@3.4.21) + '@vueuse/core': 10.9.0(vue@3.4.21) + '@vueuse/integrations': 10.9.0(focus-trap@7.5.4)(vue@3.4.21) focus-trap: 7.5.4 mark.js: 8.11.1 minisearch: 6.3.0 - shiki: 1.1.7 - vite: 5.1.4 - vue: 3.4.20 + shiki: 1.2.0 + vite: 5.1.6 + vue: 3.4.21 transitivePeerDependencies: - '@algolia/client-search' - '@types/node' @@ -2596,7 +2610,7 @@ packages: - universal-cookie dev: true - /vue-demi@0.14.7(vue@3.4.20): + /vue-demi@0.14.7(vue@3.4.21): resolution: {integrity: sha512-EOG8KXDQNwkJILkx/gPcoL/7vH+hORoBaKgGe+6W7VFMvCYJfmF2dGbvgDroVnI8LU7/kTu8mbjRZGBU1z9NTA==} engines: {node: '>=12'} hasBin: true @@ -2608,22 +2622,22 @@ packages: '@vue/composition-api': optional: true dependencies: - vue: 3.4.20 + vue: 3.4.21 dev: true - /vue@3.4.20: - resolution: {integrity: sha512-xF4zDKXp67NjgORFX/HOuaiaKYjgxkaToK0KWglFQEYlCw9AqgBlj1yu5xa6YaRek47w2IGiuvpvrGg/XuQFCw==} + /vue@3.4.21: + resolution: {integrity: sha512-5hjyV/jLEIKD/jYl4cavMcnzKwjMKohureP8ejn3hhEjwhWIhWeuzL2kJAjzl/WyVsgPY56Sy4Z40C3lVshxXA==} peerDependencies: typescript: '*' peerDependenciesMeta: typescript: optional: true dependencies: - '@vue/compiler-dom': 3.4.20 - '@vue/compiler-sfc': 3.4.20 - '@vue/runtime-dom': 3.4.20 - '@vue/server-renderer': 3.4.20(vue@3.4.20) - '@vue/shared': 3.4.20 + '@vue/compiler-dom': 3.4.21 + '@vue/compiler-sfc': 3.4.21 + '@vue/runtime-dom': 3.4.21 + '@vue/server-renderer': 3.4.21(vue@3.4.21) + '@vue/shared': 3.4.21 /wcwidth@1.0.1: resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} From 490be22f0a3a8ba76146a891e323e63f18bf7766 Mon Sep 17 00:00:00 2001 From: Sacabambaspis <102341238+DataEraserC@users.noreply.github.com> Date: Sun, 17 Mar 2024 21:34:00 +0800 Subject: [PATCH 03/15] fix typo (#129) --- docs/development/cross-platform-compilation.md | 4 ++-- docs/development/intro.md | 4 ++-- docs/zh/development/cross-platform-compilation.md | 4 ++-- docs/zh/development/intro.md | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/development/cross-platform-compilation.md b/docs/development/cross-platform-compilation.md index 7169c1f..b8d0c2b 100644 --- a/docs/development/cross-platform-compilation.md +++ b/docs/development/cross-platform-compilation.md @@ -252,7 +252,7 @@ So how to use this method in Flakes? The example `flake.nix` is as follows: system = "x86_64-linux"; modules = [ { - nigpkgs.crossSystem = { + nixpkgs.crossSystem = { config = "riscv64-unknown-linux-gnu"; }; @@ -304,7 +304,7 @@ follows: }; modules = [ { - nigpkgs.crossSystem = { + nixpkgs.crossSystem = { config = "riscv64-unknown-linux-gnu"; }; } diff --git a/docs/development/intro.md b/docs/development/intro.md index dc0e76f..9dbd26e 100644 --- a/docs/development/intro.md +++ b/docs/development/intro.md @@ -260,7 +260,7 @@ For example, we can directly install this wrapper through NixOS's `environment.systemPackages`, and then execute it directly: ```nix -{pkgs, lib, ...}{ +{pkgs, lib, ...}:{ environment.systemPackages = [ # Install the wrapper into the system @@ -279,7 +279,7 @@ For example, we can directly install this wrapper through NixOS's mkdir -p $out/bin/ ln -s ${pkgs.nushell}/bin/nu $out/bin/dev-shell wrapProgram $out/bin/dev-shell --prefix PATH : ${pkgs.lib.makeBinPath packages} - '';) + '') ]; } ``` diff --git a/docs/zh/development/cross-platform-compilation.md b/docs/zh/development/cross-platform-compilation.md index 33b2e80..585b2a5 100644 --- a/docs/zh/development/cross-platform-compilation.md +++ b/docs/zh/development/cross-platform-compilation.md @@ -226,7 +226,7 @@ nix-repl> pkgs.pkgsCross.riscv64.stdenv.cc system = "x86_64-linux"; modules = [ { - nigpkgs.crossSystem = { + nixpkgs.crossSystem = { config = "riscv64-unknown-linux-gnu"; }; @@ -276,7 +276,7 @@ nix-repl> pkgs.pkgsCross.riscv64.stdenv.cc }; modules = [ { - nigpkgs.crossSystem = { + nixpkgs.crossSystem = { config = "riscv64-unknown-linux-gnu"; }; } diff --git a/docs/zh/development/intro.md b/docs/zh/development/intro.md index e4244ef..6ce9db1 100644 --- a/docs/zh/development/intro.md +++ b/docs/zh/development/intro.md @@ -257,7 +257,7 @@ session,可以在其中正常使用 `node` `pnpm` 命令. 过 NixOS 的 `environment.systemPackages` 来安装这个 wrapper,然后直接执行它: ```nix -{pkgs, lib, ...}{ +{pkgs, lib, ...}:{ environment.systemPackages = [ # 将 dev-shell 安装到系统环境中 @@ -276,7 +276,7 @@ session,可以在其中正常使用 `node` `pnpm` 命令. mkdir -p $out/bin/ ln -s ${pkgs.nushell}/bin/nu $out/bin/dev-shell wrapProgram $out/bin/dev-shell --prefix PATH : ${pkgs.lib.makeBinPath packages} - '';) + '') ]; } ``` From 98f99ae40dfa6fdbe57751ba171506ec276c623c Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Tue, 19 Mar 2024 18:23:09 +0800 Subject: [PATCH 04/15] feat: Flakes Tutorials - update links --- .../nixos-with-flakes/introduction-to-flakes.md | 14 +++++++++----- .../nixos-with-flakes/introduction-to-flakes.md | 17 +++++++++++------ 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/docs/nixos-with-flakes/introduction-to-flakes.md b/docs/nixos-with-flakes/introduction-to-flakes.md index 3ce94b6..b9dcb5e 100644 --- a/docs/nixos-with-flakes/introduction-to-flakes.md +++ b/docs/nixos-with-flakes/introduction-to-flakes.md @@ -48,11 +48,15 @@ may arise due to forthcoming breaking changes. I won't go into too much detail here, please refer to the following documents: -- [Flakes - nix.dev](https://nix.dev/concepts/flakes) -- [Nix Flakes, Part 1: An introduction and tutorial (Eelco Dolstra, 2020)](https://www.tweag.io/blog/2020-05-25-flakes/) -- [Nix Flakes, Part 2: Evaluation caching (Eelco Dolstra, 2020)](https://www.tweag.io/blog/2020-06-25-eval-cache/) -- [Nix Flakes, Part 3: Managing NixOS systems (Eelco Dolstra, 2020)](https://www.tweag.io/blog/2020-07-31-nixos-flakes/) -- [Practical Nix Flakes](https://serokell.io/blog/practical-nix-flakes) +- A series of tutorials by Eelco Dolstra(The creator of Nix) about Flakes: + - [Nix Flakes, Part 1: An introduction and tutorial (Eelco Dolstra, 2020)](https://www.tweag.io/blog/2020-05-25-flakes/) + - [Nix Flakes, Part 2: Evaluation caching (Eelco Dolstra, 2020)](https://www.tweag.io/blog/2020-06-25-eval-cache/) + - [Nix Flakes, Part 3: Managing NixOS systems (Eelco Dolstra, 2020)](https://www.tweag.io/blog/2020-07-31-nixos-flakes/) +- Nix's official documentation: + - [Nix flakes - Nix Manual](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake) + - [Flakes - nix.dev](https://nix.dev/concepts/flakes) +- Other useful documents: + - [Practical Nix Flakes](https://serokell.io/blog/practical-nix-flakes) ## When Will Flakes Be Stabilized? diff --git a/docs/zh/nixos-with-flakes/introduction-to-flakes.md b/docs/zh/nixos-with-flakes/introduction-to-flakes.md index db5c151..19625bc 100644 --- a/docs/zh/nixos-with-flakes/introduction-to-flakes.md +++ b/docs/zh/nixos-with-flakes/introduction-to-flakes.md @@ -37,13 +37,18 @@ Flakes[^3],因此我们可以相当确定 Flakes 不会被废弃。 ## Flakes 入门 -我就不多介绍了,请直接参考如下文档: +限于个人精力,我不会在本书中详细介绍 Flakes 的使用, +请直接参考如下官方/半官方的文档。 -- [Flakes - nix.dev](https://nix.dev/concepts/flakes) -- [Nix Flakes, Part 1: An introduction and tutorial (Eelco Dolstra, 2020)](https://www.tweag.io/blog/2020-05-25-flakes/) -- [Nix Flakes, Part 2: Evaluation caching (Eelco Dolstra, 2020)](https://www.tweag.io/blog/2020-06-25-eval-cache/) -- [Nix Flakes, Part 3: Managing NixOS systems (Eelco Dolstra, 2020)](https://www.tweag.io/blog/2020-07-31-nixos-flakes/) -- [Practical Nix Flakes](https://serokell.io/blog/practical-nix-flakes) +- Eelco Dolstra (Nix 的创造者)的一系列关于 Flakes 的文章: + - [Nix Flakes, Part 1: An introduction and tutorial (Eelco Dolstra, 2020)](https://www.tweag.io/blog/2020-05-25-flakes/) + - [Nix Flakes, Part 2: Evaluation caching (Eelco Dolstra, 2020)](https://www.tweag.io/blog/2020-06-25-eval-cache/) + - [Nix Flakes, Part 3: Managing NixOS systems (Eelco Dolstra, 2020)](https://www.tweag.io/blog/2020-07-31-nixos-flakes/) +- Nix 的官方文档: + - [Nix flakes - Nix Manual](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake) + - [Flakes - nix.dev](https://nix.dev/concepts/flakes) +- 其他可能有用的文档: + - [Practical Nix Flakes](https://serokell.io/blog/practical-nix-flakes) ## Flakes 何时会成为稳定特性? {#when-will-flakes-stablized} From ca15ac1cc8551346bceb32e6e23f39998eabb754 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Tue, 19 Mar 2024 18:28:45 +0800 Subject: [PATCH 05/15] feat: Flakes Tutorials - update links --- docs/nixos-with-flakes/introduction-to-flakes.md | 6 +++--- docs/zh/nixos-with-flakes/introduction-to-flakes.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/nixos-with-flakes/introduction-to-flakes.md b/docs/nixos-with-flakes/introduction-to-flakes.md index b9dcb5e..88489d9 100644 --- a/docs/nixos-with-flakes/introduction-to-flakes.md +++ b/docs/nixos-with-flakes/introduction-to-flakes.md @@ -48,13 +48,13 @@ may arise due to forthcoming breaking changes. I won't go into too much detail here, please refer to the following documents: +- Nix Flakes's official documentation: + - [Nix flakes - Nix Manual](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake) + - [Flakes - nix.dev](https://nix.dev/concepts/flakes) - A series of tutorials by Eelco Dolstra(The creator of Nix) about Flakes: - [Nix Flakes, Part 1: An introduction and tutorial (Eelco Dolstra, 2020)](https://www.tweag.io/blog/2020-05-25-flakes/) - [Nix Flakes, Part 2: Evaluation caching (Eelco Dolstra, 2020)](https://www.tweag.io/blog/2020-06-25-eval-cache/) - [Nix Flakes, Part 3: Managing NixOS systems (Eelco Dolstra, 2020)](https://www.tweag.io/blog/2020-07-31-nixos-flakes/) -- Nix's official documentation: - - [Nix flakes - Nix Manual](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake) - - [Flakes - nix.dev](https://nix.dev/concepts/flakes) - Other useful documents: - [Practical Nix Flakes](https://serokell.io/blog/practical-nix-flakes) diff --git a/docs/zh/nixos-with-flakes/introduction-to-flakes.md b/docs/zh/nixos-with-flakes/introduction-to-flakes.md index 19625bc..0d157fb 100644 --- a/docs/zh/nixos-with-flakes/introduction-to-flakes.md +++ b/docs/zh/nixos-with-flakes/introduction-to-flakes.md @@ -40,13 +40,13 @@ Flakes[^3],因此我们可以相当确定 Flakes 不会被废弃。 限于个人精力,我不会在本书中详细介绍 Flakes 的使用, 请直接参考如下官方/半官方的文档。 +- Nix Flakes 的官方文档: + - [Nix flakes - Nix Manual](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake) + - [Flakes - nix.dev](https://nix.dev/concepts/flakes) - Eelco Dolstra (Nix 的创造者)的一系列关于 Flakes 的文章: - [Nix Flakes, Part 1: An introduction and tutorial (Eelco Dolstra, 2020)](https://www.tweag.io/blog/2020-05-25-flakes/) - [Nix Flakes, Part 2: Evaluation caching (Eelco Dolstra, 2020)](https://www.tweag.io/blog/2020-06-25-eval-cache/) - [Nix Flakes, Part 3: Managing NixOS systems (Eelco Dolstra, 2020)](https://www.tweag.io/blog/2020-07-31-nixos-flakes/) -- Nix 的官方文档: - - [Nix flakes - Nix Manual](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake) - - [Flakes - nix.dev](https://nix.dev/concepts/flakes) - 其他可能有用的文档: - [Practical Nix Flakes](https://serokell.io/blog/practical-nix-flakes) From cb4941ee44fc93bd12af356fa50bcec034a3e923 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Fri, 22 Mar 2024 15:00:46 +0800 Subject: [PATCH 06/15] feat: one more section about flake's 'self' (#131) --- .../nixos-with-flakes-enabled.md | 27 ++++++++++++++++--- .../nixos-with-flakes-enabled.md | 24 +++++++++++++++-- 2 files changed, 46 insertions(+), 5 deletions(-) diff --git a/docs/nixos-with-flakes/nixos-with-flakes-enabled.md b/docs/nixos-with-flakes/nixos-with-flakes-enabled.md index 644f0a8..661ea29 100644 --- a/docs/nixos-with-flakes/nixos-with-flakes-enabled.md +++ b/docs/nixos-with-flakes/nixos-with-flakes-enabled.md @@ -183,8 +183,6 @@ results of the flake: nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; }; - # The `self` parameter is special, it refers to - # the attribute set returned by the `outputs` function itself. outputs = { self, nixpkgs, ... }@inputs: { # The host with the hostname `my-nixos` will use this configuration nixosConfigurations.my-nixos = nixpkgs.lib.nixosSystem { @@ -230,7 +228,28 @@ example: sudo nixos-rebuild switch --flake github:owner/repo#your-hostname ``` -### 3. Simple Introduction to `nixpkgs.lib.nixosSystem` Function {#simple-introduction-to-nixpkgs-lib-nixos-system} +### 3. The Special Parameter `self` of the `outputs` Function {#special-parameter-self-of-outputs-function} + +Although we have not mentioned it before, all the example code in the previous sections +has one more special parameter in the `outputs` function, and we will briefly introduce +its purpose here. + +The description of it in the [nix flake - Nix Manual] is: + +> The special input named `self` refers to the outputs and source tree of this flake. + +This means that `self` is the return value of the current flake's `outputs` function and +also the path to the current flake's source code folder (source tree). + +We are not using the `self` parameter here, but in some more complex examples (or +configurations you may find online) later, you will see the usage of `self`. + +> Note: You might come across some code where people use `self.outputs` to reference the +> outputs of the current flake, which is indeed possible. However, the Nix Manual does not +> provide any explanation for this, and it is considered an internal implementation detail +> of flakes. It is not recommended to use this in your own code! + +### 4. Simple Introduction to `nixpkgs.lib.nixosSystem` Function {#simple-introduction-to-nixpkgs-lib-nixos-system} **A Flake can depend on other Flakes to utilize the features they provide.** @@ -545,6 +564,8 @@ referenced for future mention: versions of Nixpkgs are introduced as dependencies, allowing for flexible selection of packages from various versions of Nixpkgs. +[nix flake - Nix Manual]: + https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake#flake-inputs [nixpkgs/flake.nix]: https://github.com/NixOS/nixpkgs/tree/nixos-23.11/flake.nix [nixpkgs/nixos/lib/eval-config.nix]: https://github.com/NixOS/nixpkgs/tree/nixos-23.11/nixos/lib/eval-config.nix diff --git a/docs/zh/nixos-with-flakes/nixos-with-flakes-enabled.md b/docs/zh/nixos-with-flakes/nixos-with-flakes-enabled.md index 54be115..552c4c0 100644 --- a/docs/zh/nixos-with-flakes/nixos-with-flakes-enabled.md +++ b/docs/zh/nixos-with-flakes/nixos-with-flakes-enabled.md @@ -162,7 +162,6 @@ attribute set,这个返回的 attribute set 即为该 flake 的构建结果: nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; }; - # 这里的 `self` 是个特殊参数,它指向 `outputs` 函数返回的 attribute set 自身,即自引用 outputs = { self, nixpkgs, ... }@inputs: { # hostname 为 my-nixos 的主机会使用这个配置 nixosConfigurations.my-nixos = nixpkgs.lib.nixosSystem { @@ -202,7 +201,26 @@ sudo nixos-rebuild switch --flake /path/to/your/flake#your-hostname sudo nixos-rebuild switch --flake github:owner/repo#your-hostname ``` -### 3. `nixpkgs.lib.nixosSystem` 函数的简单介绍 {#simple-introduction-to-nixpkgs-lib-nixos-system} +### 3. `outputs` 函数的特殊参数 `self` {#special-parameter-self-of-outputs-function} + +虽然我们前面并未提到,但是前面的所有示例代码中,`outputs` 函数都还有一个特殊的参数 +`self`,这里我们简单介绍一下它的作用。 + +[nix flake - Nix Manual] 对其的描述是: + +> The special input named `self` refers to the outputs and source tree of this flake. + +所以说 `self` 是当前 flake 的 `outputs` 函数的返回值,同时也是当前 flake 源码的文件夹路径 +(source tree)。 + +这里我们并未使用到 `self` 这个参数,在后面一些更复杂的例子(或者你网上搜 +到的一些配置)中,我们会看到 `self` 的用法。 + +> 注意:你可能会在一些代码中看到,有人会使用 `self.outputs` 来引用当前 flake 的输出,这 +> 确实是可行的,但 Nix Manual 并未对其做任何说明,属于是 flake 的内部实现细节,不建议在 +> 你自己的代码中使用! + +### 4. `nixpkgs.lib.nixosSystem` 函数的简单介绍 {#simple-introduction-to-nixpkgs-lib-nixos-system} **一个 Flake 可以依赖其他 Flakes,从而使用它们提供的功能**。 @@ -492,6 +510,8 @@ nix run github:helix-editor/helix/master - [Downgrading or Upgrading Packages](./downgrade-or-upgrade-packages.md): 这里引入了不同 版本的 Nixpkgs 作为依赖项,从而能很灵活地选用不同版本的 Nixpkgs 中的包。 +[nix flake - Nix Manual]: + https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake#flake-inputs [nixpkgs/flake.nix]: https://github.com/NixOS/nixpkgs/tree/nixos-23.11/flake.nix [nixpkgs/nixos/lib/eval-config.nix]: https://github.com/NixOS/nixpkgs/tree/nixos-23.11/nixos/lib/eval-config.nix From 5410d170a36159b556e65ffdcf6deae6d96a51b4 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Fri, 22 Mar 2024 18:49:04 +0800 Subject: [PATCH 07/15] refactor: divide nixos-with-flakes-enabled into several sections to make it easier to read and find (#132) --- docs/.vitepress/config.ts | 18 +- .../introduction-to-flakes.md | 14 - .../nixos-flake-and-module-system.md | 293 +++++++++++ .../nixos-flake-configuration-explained.md | 186 +++++++ .../nixos-with-flakes-enabled.md | 460 +----------------- .../introduction-to-flakes.md | 14 - .../nixos-flake-and-module-system.md | 269 ++++++++++ .../nixos-flake-configuration-explained.md | 171 +++++++ .../nixos-with-flakes-enabled.md | 416 +--------------- 9 files changed, 970 insertions(+), 871 deletions(-) create mode 100644 docs/nixos-with-flakes/nixos-flake-and-module-system.md create mode 100644 docs/nixos-with-flakes/nixos-flake-configuration-explained.md create mode 100644 docs/zh/nixos-with-flakes/nixos-flake-and-module-system.md create mode 100644 docs/zh/nixos-with-flakes/nixos-flake-configuration-explained.md diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index b264ee3..b9240bb 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -186,6 +186,14 @@ function themeConfigEnglish() { text: "NixOS with Flakes Enabled", link: "/nixos-with-flakes/nixos-with-flakes-enabled.md", }, + { + text: "NixOS's flake.nix Explained", + link: "/nixos-with-flakes/nixos-flake-configuration-explained.md", + }, + { + text: "The combination ability of Flakes and Nixpkgs module system", + link: "/nixos-with-flakes/nixos-flake-and-module-system.md", + }, { text: "Adding Custom Cache Servers", link: "/nixos-with-flakes/add-custom-cache-servers.md", @@ -380,6 +388,14 @@ function themeConfigChinese() { text: "使用 Flakes 管理 NixOS", link: "/zh/nixos-with-flakes/nixos-with-flakes-enabled.md", }, + { + text: "NixOS 的 flake.nix 内容详解", + link: "/zh/nixos-with-flakes/nixos-flake-configuration-explained.md", + }, + { + text: "Flakes 的组合能力与 Nixpkgs 模块系统", + link: "/zh/nixos-with-flakes/nixos-flake-and-module-system.md", + }, { text: "添加自定义缓存服务器", link: "/zh/nixos-with-flakes/add-custom-cache-servers.md", @@ -414,7 +430,7 @@ function themeConfigChinese() { { text: "Overriding", link: "/zh/nixpkgs/overriding.md" }, { text: "Overlays", link: "/zh/nixpkgs/overlays.md" }, { - text: "多 Nixpkgs 实例", + text: "多 Nixpkgs 实例的妙用", link: "/zh/nixpkgs/multiple-nixpkgs.md", }, ], diff --git a/docs/nixos-with-flakes/introduction-to-flakes.md b/docs/nixos-with-flakes/introduction-to-flakes.md index 88489d9..53a3ec1 100644 --- a/docs/nixos-with-flakes/introduction-to-flakes.md +++ b/docs/nixos-with-flakes/introduction-to-flakes.md @@ -44,20 +44,6 @@ Overall, I strongly recommend everyone to use Flakes, especially since this book around NixOS and Flakes. However, it's crucial to be prepared for potential problems that may arise due to forthcoming breaking changes. -## Flakes Tutorials - -I won't go into too much detail here, please refer to the following documents: - -- Nix Flakes's official documentation: - - [Nix flakes - Nix Manual](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake) - - [Flakes - nix.dev](https://nix.dev/concepts/flakes) -- A series of tutorials by Eelco Dolstra(The creator of Nix) about Flakes: - - [Nix Flakes, Part 1: An introduction and tutorial (Eelco Dolstra, 2020)](https://www.tweag.io/blog/2020-05-25-flakes/) - - [Nix Flakes, Part 2: Evaluation caching (Eelco Dolstra, 2020)](https://www.tweag.io/blog/2020-06-25-eval-cache/) - - [Nix Flakes, Part 3: Managing NixOS systems (Eelco Dolstra, 2020)](https://www.tweag.io/blog/2020-07-31-nixos-flakes/) -- Other useful documents: - - [Practical Nix Flakes](https://serokell.io/blog/practical-nix-flakes) - ## When Will Flakes Be Stabilized? I delved into some details regarding Flakes: diff --git a/docs/nixos-with-flakes/nixos-flake-and-module-system.md b/docs/nixos-with-flakes/nixos-flake-and-module-system.md new file mode 100644 index 0000000..14368b7 --- /dev/null +++ b/docs/nixos-with-flakes/nixos-flake-and-module-system.md @@ -0,0 +1,293 @@ +# The combination ability of Flakes and Nixpkgs module system + +## Nixpkgs Module Structure Explained {#simple-introduction-to-nixpkgs-module-structure} + +> The detailed workings of this module system will be introduced in the following +> [Modularizing NixOS Configuration](./modularize-the-configuration.md) section. Here, +> we'll just cover some basic knowledge. + +You might be wondering why the `/etc/nixos/configuration.nix` configuration file adheres +to the Nixpkgs Module definition and can be referenced directly within the `flake.nix`. + +This is because the Nixpkgs repository contains a significant amount of NixOS +implementation source code, primarily written in Nix. To manage and maintain such a large +volume of Nix code and to allow users to customize various functions of their NixOS +systems, a modular system for Nix code is essential. + +This modular system for Nix code is also implemented within the Nixpkgs repository and is +primarily used for modularizing NixOS system configurations. However, it is also widely +used in other contexts, such as nix-darwin and home-manager. Since NixOS is built on this +modular system, it is only natural that its configuration files, including +`/etc/nixos/configuration.nix`, are Nixpkgs Modules. + +Before delving into the subsequent content, it's essential to have a basic understanding +of how this module system operates. + +Here's a simplified structure of a Nixpkgs Module: + +```nix +{lib, config, options, pkgs, ...}: +{ + # Importing other Modules + imports = [ + # ... + ./xxx.nix + ]; + for.bar.enable = true; + # Other option declarations + # ... +} +``` + +The definition is actually a Nix function, and it has five **automatically generated, +automatically injected, and declaration-free parameters** provided by the module system: + +1. `lib`: A built-in function library included with nixpkgs, offering many practical + functions for operating Nix expressions. + - For more information, see . +2. `config`: A set of all options' values in the current environment, which will be used + extensively in the subsequent section on the module system. +3. `options`: A set of all options defined in all Modules in the current environment. +4. `pkgs`: A collection containing all nixpkgs packages, along with several related + utility functions. + - At the beginner stage, you can consider its default value to be + `nixpkgs.legacyPackages."${system}"`, and the value of `pkgs` can be customized + through the `nixpkgs.pkgs` option. +5. `modulesPath`: A parameter available only in NixOS, which is a path pointing to + [nixpkgs/nixos/modules](https://github.com/NixOS/nixpkgs/tree/nixos-23.11/nixos/modules). + - It is defined in + [nixpkgs/nixos/lib/eval-config-minimal.nix#L43](https://github.com/NixOS/nixpkgs/blob/nixos-23.11/nixos/lib/eval-config-minimal.nix#L43). + - It is typically used to import additional NixOS modules and can be found in most + NixOS auto-generated `hardware-configuration.nix` files. + +## Passing Non-default Parameters to Submodules {#pass-non-default-parameters-to-submodules} + +If you need to pass other non-default parameters to submodules, you will need to use some +special methods to manually specify these non-default parameters. + +The Nixpkgs module system provides two ways to pass non-default parameters: + +1. The `specialArgs` parameter of the `nixpkgs.lib.nixosSystem` function +2. Using the `_module.args` option in any module to pass parameters + +The official documentation for these two parameters is buried deep and is vague and hard +to understand. If readers are interested, I will include the links here: + +1. `specialArgs`: There are scattered mentions related to it in the NixOS Manual and the + Nixpkgs Manual. + - Nixpkgs Manual: [Module System - Nixpkgs] + - NixOS Manual: + [nixpkgs/nixos-23.11/nixos/doc/manual/development/option-types.section.md#L237-L244] +1. `_module.args`: + - NixOS Manual: + [Appendix A. Configuration Options](https://nixos.org/manual/nixos/stable/options#opt-_module.args) + - Source Code: [nixpkgs/nixos-23.11/lib/modules.nix - _module.args] + +In short, `specialArgs` and `_module.args` both require an attribute set as their value, +and they serve the same purpose, passing all parameters in the attribute set to all +submodules. The difference between them is: + +1. The `_module.args` option can be used in any module to pass parameters to each other, + which is more flexible than `specialArgs`, which can only be used in the + `nixpkgs.lib.nixosSystem` function. +1. `_module.args` is declared within a module, so it must be evaluated after all modules + have been evaluated before it can be used. This means that **if you use the parameters + passed through `_module.args` in `imports = [ ... ];`, it will result in an + `infinite recursion` error**. In this case, you must use `specialArgs` instead. + +The NixOS community generally recommends prioritizing the use of the `_module.args` option +and resorting to `specialArgs` only when `_module.args` cannot be used. + +Suppose you want to pass a certain dependency to a submodule for use. You can use the +`specialArgs` parameter to pass the `inputs` to all submodules: + +```nix{13} +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; + another-input.url = "github:username/repo-name/branch-name"; + }; + + outputs = inputs@{ self, nixpkgs, another-input, ... }: { + nixosConfigurations.my-nixos = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + + # Set all inputs parameters as special arguments for all submodules, + # so you can directly use all dependencies in inputs in submodules + specialArgs = { inherit inputs; }; + modules = [ + ./configuration.nix + ]; + }; + }; +} +``` + +Or you can achieve the same effect using the `_module.args` option: + +```nix{14} +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; + another-input.url = "github:username/repo-name/branch-name"; + }; + outputs = inputs@{ self, nixpkgs, another-input, ... }: { + nixosConfigurations.my-nixos = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./configuration.nix + { + # Set all inputs parameters as special arguments for all submodules, + # so you can directly use all dependencies in inputs in submodules + _module.args = { inherit inputs; }; + } + ]; + }; + }; +} +``` + +Choose one of the two methods above to modify your configuration, and then you can use the +`inputs` parameter in `/etc/nixos/configuration.nix`. The module system will automatically +match the `inputs` defined in `specialArgs` and inject it into all submodules that require +this parameter: + +```nix{3} +# Nix will match by name and automatically inject the inputs +# from specialArgs/_module.args into the third parameter of this function +{ config, pkgs, inputs, ... }: +{ + # ... +} +``` + +The next section will demonstrate how to use `specialArgs`/`_module.args` to install +system software from other flake sources. + +## Installing System Software from Other Flake Sources {#install-system-packages-from-other-flakes} + +The most common requirement for managing a system is to install software, and we have +already seen in the previous section how to install packages from the official nixpkgs +repository using `environment.systemPackages`. These packages all come from the official +nixpkgs repository. + +Now, we will learn how to install software packages from other flake sources, which is +much more flexible than installing directly from nixpkgs. The main use case is to install +the latest version of a software that is not yet added or updated in Nixpkgs. + +Taking the Helix editor as an example, here's how to compile and install the master branch +of Helix directly. + +First, add the helix input data source to `flake.nix`: + +```nix{6,12,18} +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; + + # helix editor, use the master branch + helix.url = "github:helix-editor/helix/master"; + }; + + outputs = inputs@{ self, nixpkgs, ... }: { + nixosConfigurations.my-nixos = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = [ + ./configuration.nix + + # This module works the same as the `specialArgs` parameter we used above + # chose one of the two methods to use + # { _module.args = { inherit inputs; };} + ]; + }; + }; +} +``` + +Next, you can reference this flake input data source in `configuration.nix`: + +```nix{1,10} +{ config, pkgs, inputs, ... }: +{ + # ... + environment.systemPackages = with pkgs; [ + git + vim + wget + curl + # Here, the helix package is installed from the helix input data source + inputs.helix.packages."${pkgs.system}".helix + ]; + # ... +} +``` + +Make the necessary changes and deploy with `sudo nixos-rebuild switch`. The deployment +will take much longer this time because Nix will compile the entire Helix program from +source. + +After deployment, you can directly test and verify the installation using the `hx` command +in the terminal. + +Additionally, if you just want to try out the latest version of Helix and decide whether +to install it on your system later, there is a simpler way to do it in one command (but as +mentioned earlier, compiling from source will take a long time): + +```bash +nix run github:helix-editor/helix/master +``` + +We will go into more detail on the usage of `nix run` in the following section +[Usage of the New CLI](../other-usage-of-flakes/the-new-cli.md). + +## Leveraging Features from Other Flakes Packages + +In fact, this is the primary functionality of Flakes — a flake can depend on other flakes, +allowing it to utilize the features they provide. It's akin to how we incorporate +functionalities from other libraries when writing programs in TypeScript, Go, Rust, and +other programming languages. + +The example above, using the latest version from the official Helix Flake, illustrates +this functionality. More use cases will be discussed later, and here are a few examples +referenced for future mention: + +- [Getting Started with Home Manager](./start-using-home-manager.md): This introduces the + community's Home-Manager as a dependency, enabling direct utilization of the features + provided by this Flake. +- [Downgrading or Upgrading Packages](./downgrade-or-upgrade-packages.md): Here, different + versions of Nixpkgs are introduced as dependencies, allowing for flexible selection of + packages from various versions of Nixpkgs. + + +## More Flakes Tutorials + +Up to this point, we have learned how to use Flakes to configure NixOS systems. +If you have more questions about Flakes or want to learn more in-depth, please refer +directly to the following official/semi-official documents: + +- Nix Flakes's official documentation: + - [Nix flakes - Nix Manual](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake) + - [Flakes - nix.dev](https://nix.dev/concepts/flakes) +- A series of tutorials by Eelco Dolstra(The creator of Nix) about Flakes: + - [Nix Flakes, Part 1: An introduction and tutorial (Eelco Dolstra, 2020)](https://www.tweag.io/blog/2020-05-25-flakes/) + - [Nix Flakes, Part 2: Evaluation caching (Eelco Dolstra, 2020)](https://www.tweag.io/blog/2020-06-25-eval-cache/) + - [Nix Flakes, Part 3: Managing NixOS systems (Eelco Dolstra, 2020)](https://www.tweag.io/blog/2020-07-31-nixos-flakes/) +- Other useful documents: + - [Practical Nix Flakes](https://serokell.io/blog/practical-nix-flakes) + + + +[nix flake - Nix Manual]: + https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake#flake-inputs +[nixpkgs/flake.nix]: https://github.com/NixOS/nixpkgs/tree/nixos-23.11/flake.nix +[nixpkgs/nixos/lib/eval-config.nix]: + https://github.com/NixOS/nixpkgs/tree/nixos-23.11/nixos/lib/eval-config.nix +[Module System - Nixpkgs]: + https://github.com/NixOS/nixpkgs/blob/23.11/doc/module-system/module-system.chapter.md +[nixpkgs/nixos-23.11/lib/modules.nix - _module.args]: + https://github.com/NixOS/nixpkgs/blob/nixos-23.11/lib/modules.nix#L122-L184 +[nixpkgs/nixos-23.11/nixos/doc/manual/development/option-types.section.md#L237-L244]: + https://github.com/NixOS/nixpkgs/blob/nixos-23.11/nixos/doc/manual/development/option-types.section.md?plain=1#L237-L244 + + diff --git a/docs/nixos-with-flakes/nixos-flake-configuration-explained.md b/docs/nixos-with-flakes/nixos-flake-configuration-explained.md new file mode 100644 index 0000000..7dcbeee --- /dev/null +++ b/docs/nixos-with-flakes/nixos-flake-configuration-explained.md @@ -0,0 +1,186 @@ +# `flake.nix` Configuration Explained {#flake-nix-configuration-explained} + +Above, we created a `flake.nix` file to manage system configurations, but you might still +be unclear about its structure. Let's explain the content of this file in detail. + +## 1. Flake Inputs + +First, let's look at the `inputs` attribute. It is an attribute set that defines all the +dependencies of this flake. These dependencies will be passed as arguments to the +`outputs` function after they are fetched: + +```nix{2-5,7} +{ + inputs = { + # NixOS official package source, using the nixos-23.11 branch here + nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; + }; + + outputs = { self, nixpkgs, ... }@inputs: { + # Omitting previous configurations...... + }; +} +``` + +Dependencies in `inputs` has many types and definitions. It can be another flake, a +regular Git repository, or a local path. The section +[Other Usage of Flakes - Flake Inputs](../other-usage-of-flakes/inputs.md) describes +common types of dependencies and their definitions in detail. + +Here we only define a dependency named `nixpkgs`, which is the most common way to +reference in a flake, i.e., `github:owner/name/reference`. The `reference` here can be a +branch name, commit-id, or tag. + +After `nixpkgs` is defined in `inputs`, you can use it in the parameters of the subsequent +`outputs` function, which is exactly what our example does. + +## 2. Flake Outputs + +Now let's look at `outputs`. It is a function that takes the dependencies from `inputs` as +its parameters, and its return value is an attribute set, which represents the build +results of the flake: + +```nix{11-19} +{ + description = "A simple NixOS flake"; + + inputs = { + # NixOS official package source, here using the nixos-23.11 branch + nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; + }; + + outputs = { self, nixpkgs, ... }@inputs: { + # The host with the hostname `my-nixos` will use this configuration + nixosConfigurations.my-nixos = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./configuration.nix + ]; + }; + }; +} +``` + +Flakes can have various purposes and can have different types of outputs. The section +[Flake Outputs](../other-usage-of-flakes/outputs.md) provides a more detailed +introduction. Here, we are only using the `nixosConfigurations` type of outputs, which is +used to configure NixOS systems. + +When we run the `sudo nixos-rebuild switch` command, it looks for the +`nixosConfigurations.my-nixos` attribute (where `my-nixos` will be the hostname of your +current system) in the attribute set returned by the `outputs` function of +`/etc/nixos/flake.nix` and uses the definition there to configure your NixOS system. + +Actually, we can also customize the location of the flake and the name of the NixOS +configuration instead of using the defaults. This can be done by adding the `--flake` +parameter to the `nixos-rebuild` command. Here's an example: + +```nix +sudo nixos-rebuild switch --flake /path/to/your/flake#your-hostname +``` + +A brief explanation of the `--flake /path/to/your/flake#your-hostname` parameter: + +1. `/path/to/your/flake` is the location of the target flake. The default path is + `/etc/nixos/`. +2. `#` is a separator, and `your-hostname` is the name of the NixOS configuration. + `nixos-rebuild` will default to using the hostname of your current system as the + configuration name to look for. + +You can even directly reference a remote GitHub repository as your flake source, for +example: + +```nix +sudo nixos-rebuild switch --flake github:owner/repo#your-hostname +``` + +## 3. The Special Parameter `self` of the `outputs` Function {#special-parameter-self-of-outputs-function} + +Although we have not mentioned it before, all the example code in the previous sections +has one more special parameter in the `outputs` function, and we will briefly introduce +its purpose here. + +The description of it in the [nix flake - Nix Manual] is: + +> The special input named `self` refers to the outputs and source tree of this flake. + +This means that `self` is the return value of the current flake's `outputs` function and +also the path to the current flake's source code folder (source tree). + +We are not using the `self` parameter here, but in some more complex examples (or +configurations you may find online) later, you will see the usage of `self`. + +> Note: You might come across some code where people use `self.outputs` to reference the +> outputs of the current flake, which is indeed possible. However, the Nix Manual does not +> provide any explanation for this, and it is considered an internal implementation detail +> of flakes. It is not recommended to use this in your own code! + +## 4. Simple Introduction to `nixpkgs.lib.nixosSystem` Function {#simple-introduction-to-nixpkgs-lib-nixos-system} + +**A Flake can depend on other Flakes to utilize the features they provide.** + +By default, a flake searches for a `flake.nix` file in the root directory of each of its +dependencies (i.e., each item in `inputs`) and lazily evaluates their `outputs` functions. +It then passes the attribute set returned by these functions as arguments to its own +`outputs` function, enabling us to use the features provided by the other flakes within +our current flake. + +More precisely, the evaluation of the `outputs` function for each dependency is lazy. This +means that a flake's `outputs` function is only evaluated when it is actually used, +thereby avoiding unnecessary calculations and improving efficiency. + +The description above may be a bit confusing, so let's take a look at the process with the +`flake.nix` example used in this section. Our `flake.nix` declares the `inputs.nixpkgs` +dependency, so that [nixpkgs/flake.nix] will be evaluated when we run the +`sudo nixos-rebuild switch` command. + +From the source code of the Nixpkgs repository, we can see that its flake outputs +definition includes the `lib` attribute, and in our example, we use the `lib` attribute's +`nixosSystem` function to configure our NixOS system: + +```nix{8-13} +{ + inputs = { + # NixOS official package source, here using the nixos-23.11 branch + nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; + }; + + outputs = { self, nixpkgs, ... }@inputs: { + nixosConfigurations.my-nixos = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./configuration.nix + ]; + }; + }; +} +``` + +The attribute set following `nixpkgs.lib.nixosSystem` is the function's parameter. We have +only set two parameters here: + +1. `system`: This is straightforward, it's the system architecture parameter. +2. `modules`: This is a list of modules, where the actual NixOS system configuration is + defined. The `/etc/nixos/configuration.nix` configuration file itself is a Nixpkgs + Module, so it can be directly added to the `modules` list for use. + +Understanding these basics is sufficient for beginners. Exploring the +`nixpkgs.lib.nixosSystem` function in detail requires a grasp of the Nixpkgs module +system. Readers who have completed the +[Modularizing NixOS Configuration](./modularize-the-configuration.md) section can return +to [nixpkgs/flake.nix] to find the definition of `nixpkgs.lib.nixosSystem`, trace its +source code, and study its implementation. + +[nix flake - Nix Manual]: + https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake#flake-inputs +[nixpkgs/flake.nix]: https://github.com/NixOS/nixpkgs/tree/nixos-23.11/flake.nix +[nixpkgs/nixos/lib/eval-config.nix]: + https://github.com/NixOS/nixpkgs/tree/nixos-23.11/nixos/lib/eval-config.nix +[Module System - Nixpkgs]: + https://github.com/NixOS/nixpkgs/blob/23.11/doc/module-system/module-system.chapter.md +[nixpkgs/nixos-23.11/lib/modules.nix - _module.args]: + https://github.com/NixOS/nixpkgs/blob/nixos-23.11/lib/modules.nix#L122-L184 +[nixpkgs/nixos-23.11/nixos/doc/manual/development/option-types.section.md#L237-L244]: + https://github.com/NixOS/nixpkgs/blob/nixos-23.11/nixos/doc/manual/development/option-types.section.md?plain=1#L237-L244 + + diff --git a/docs/nixos-with-flakes/nixos-with-flakes-enabled.md b/docs/nixos-with-flakes/nixos-with-flakes-enabled.md index 661ea29..88450e2 100644 --- a/docs/nixos-with-flakes/nixos-with-flakes-enabled.md +++ b/docs/nixos-with-flakes/nixos-with-flakes-enabled.md @@ -1,13 +1,18 @@ # Enabling NixOS with Flakes -## Enabling Flakes Support for NixOS {#enable-nix-flakes} - Compared to the default configuration method currently used in NixOS, Flakes offers better reproducibility. Its clear package structure definition inherently supports dependencies on other Git repositories, facilitating code sharing. Therefore, this book suggests using -Flakes to manage system configurations. Currently, Flakes is still an experimental feature -and not enabled by default. We need to manually modify the `/etc/nixos/configuration.nix` -file to enable the Flakes feature and the accompanying new nix command-line tool: +Flakes to manage system configurations. + +This section describes how to use Flakes to manage NixOS system configuration, and **you +don't need to know anything about Flakes in advance**. + +## Enabling Flakes Support for NixOS {#enable-nix-flakes} + +Currently, Flakes is still an experimental feature and not enabled by default. We need to +manually modify the `/etc/nixos/configuration.nix` file to enable the Flakes feature and +the accompanying new nix command-line tool: ```nix{12,16} { config, pkgs, ... }: @@ -115,10 +120,17 @@ Currently, our flake includes these files: - `/etc/nixos/hardware-configuration.nix`: This is the system hardware configuration file, generated by NixOS, which describes the system's hardware information. -Up to this point, `/etc/nixos/flake.nix` has merely been a thin wrapper around +## Cconclusion + +Up to this point, we have merely added a very simple configuration file, +`/etc/nixos/flake.nix`, which has merely been a thin wrapper around `/etc/nixos/configuration.nix`, offering no new functionality and introducing no -disruptive changes. In the content of the book that follows, we will gradually see the -benefits that such a wrapper brings. +disruptive changes. + +In the content of the book that follows, we will learn about the structure and +functionality of `flake.nix` and gradually see the benefits that such a wrapper can +bring. + > Note: The configuration management method described in this book is NOT "Everything in a > single file". It is recommended to categorize configuration content into different nix @@ -132,438 +144,6 @@ benefits that such a wrapper brings. > [Other Useful Tips - Managing NixOS Configuration with Git](./other-useful-tips.md) will > introduce several best practices for managing NixOS configuration with Git. -## `flake.nix` Configuration Explained {#flake-nix-configuration-explained} - -Above, we created a `flake.nix` file to manage system configurations, but you might still -be unclear about its structure. Let's explain the content of this file in detail. - -### 1. Flake Inputs - -First, let's look at the `inputs` attribute. It is an attribute set that defines all the -dependencies of this flake. These dependencies will be passed as arguments to the -`outputs` function after they are fetched: - -```nix{2-5,7} -{ - inputs = { - # NixOS official package source, using the nixos-23.11 branch here - nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; - }; - - outputs = { self, nixpkgs, ... }@inputs: { - # Omitting previous configurations...... - }; -} -``` - -Dependencies in `inputs` has many types and definitions. It can be another flake, a -regular Git repository, or a local path. The section -[Other Usage of Flakes - Flake Inputs](../other-usage-of-flakes/inputs.md) describes -common types of dependencies and their definitions in detail. - -Here we only define a dependency named `nixpkgs`, which is the most common way to -reference in a flake, i.e., `github:owner/name/reference`. The `reference` here can be a -branch name, commit-id, or tag. - -After `nixpkgs` is defined in `inputs`, you can use it in the parameters of the subsequent -`outputs` function, which is exactly what our example does. - -### 2. Flake Outputs - -Now let's look at `outputs`. It is a function that takes the dependencies from `inputs` as -its parameters, and its return value is an attribute set, which represents the build -results of the flake: - -```nix{11-19} -{ - description = "A simple NixOS flake"; - - inputs = { - # NixOS official package source, here using the nixos-23.11 branch - nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; - }; - - outputs = { self, nixpkgs, ... }@inputs: { - # The host with the hostname `my-nixos` will use this configuration - nixosConfigurations.my-nixos = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - ./configuration.nix - ]; - }; - }; -} -``` - -Flakes can have various purposes and can have different types of outputs. The section -[Flake Outputs](../other-usage-of-flakes/outputs.md) provides a more detailed -introduction. Here, we are only using the `nixosConfigurations` type of outputs, which is -used to configure NixOS systems. - -When we run the `sudo nixos-rebuild switch` command, it looks for the -`nixosConfigurations.my-nixos` attribute (where `my-nixos` will be the hostname of your -current system) in the attribute set returned by the `outputs` function of -`/etc/nixos/flake.nix` and uses the definition there to configure your NixOS system. - -Actually, we can also customize the location of the flake and the name of the NixOS -configuration instead of using the defaults. This can be done by adding the `--flake` -parameter to the `nixos-rebuild` command. Here's an example: - -```nix -sudo nixos-rebuild switch --flake /path/to/your/flake#your-hostname -``` - -A brief explanation of the `--flake /path/to/your/flake#your-hostname` parameter: - -1. `/path/to/your/flake` is the location of the target flake. The default path is - `/etc/nixos/`. -2. `#` is a separator, and `your-hostname` is the name of the NixOS configuration. - `nixos-rebuild` will default to using the hostname of your current system as the - configuration name to look for. - -You can even directly reference a remote GitHub repository as your flake source, for -example: - -```nix -sudo nixos-rebuild switch --flake github:owner/repo#your-hostname -``` - -### 3. The Special Parameter `self` of the `outputs` Function {#special-parameter-self-of-outputs-function} - -Although we have not mentioned it before, all the example code in the previous sections -has one more special parameter in the `outputs` function, and we will briefly introduce -its purpose here. - -The description of it in the [nix flake - Nix Manual] is: - -> The special input named `self` refers to the outputs and source tree of this flake. - -This means that `self` is the return value of the current flake's `outputs` function and -also the path to the current flake's source code folder (source tree). - -We are not using the `self` parameter here, but in some more complex examples (or -configurations you may find online) later, you will see the usage of `self`. - -> Note: You might come across some code where people use `self.outputs` to reference the -> outputs of the current flake, which is indeed possible. However, the Nix Manual does not -> provide any explanation for this, and it is considered an internal implementation detail -> of flakes. It is not recommended to use this in your own code! - -### 4. Simple Introduction to `nixpkgs.lib.nixosSystem` Function {#simple-introduction-to-nixpkgs-lib-nixos-system} - -**A Flake can depend on other Flakes to utilize the features they provide.** - -By default, a flake searches for a `flake.nix` file in the root directory of each of its -dependencies (i.e., each item in `inputs`) and lazily evaluates their `outputs` functions. -It then passes the attribute set returned by these functions as arguments to its own -`outputs` function, enabling us to use the features provided by the other flakes within -our current flake. - -More precisely, the evaluation of the `outputs` function for each dependency is lazy. This -means that a flake's `outputs` function is only evaluated when it is actually used, -thereby avoiding unnecessary calculations and improving efficiency. - -The description above may be a bit confusing, so let's take a look at the process with the -`flake.nix` example used in this section. Our `flake.nix` declares the `inputs.nixpkgs` -dependency, so that [nixpkgs/flake.nix] will be evaluated when we run the -`sudo nixos-rebuild switch` command. - -From the source code of the Nixpkgs repository, we can see that its flake outputs -definition includes the `lib` attribute, and in our example, we use the `lib` attribute's -`nixosSystem` function to configure our NixOS system: - -```nix{8-13} -{ - inputs = { - # NixOS official package source, here using the nixos-23.11 branch - nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; - }; - - outputs = { self, nixpkgs, ... }@inputs: { - nixosConfigurations.my-nixos = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - ./configuration.nix - ]; - }; - }; -} -``` - -The attribute set following `nixpkgs.lib.nixosSystem` is the function's parameter. We have -only set two parameters here: - -1. `system`: This is straightforward, it's the system architecture parameter. -2. `modules`: This is a list of modules, where the actual NixOS system configuration is - defined. The `/etc/nixos/configuration.nix` configuration file itself is a Nixpkgs - Module, so it can be directly added to the `modules` list for use. - -Understanding these basics is sufficient for beginners. Exploring the -`nixpkgs.lib.nixosSystem` function in detail requires a grasp of the Nixpkgs module -system. Readers who have completed the -[Modularizing NixOS Configuration](./modularize-the-configuration.md) section can return -to [nixpkgs/flake.nix] to find the definition of `nixpkgs.lib.nixosSystem`, trace its -source code, and study its implementation. - -## Nixpkgs Module Structure Explained {#simple-introduction-to-nixpkgs-module-structure} - -> The detailed workings of this module system will be introduced in the following -> [Modularizing NixOS Configuration](./modularize-the-configuration.md) section. Here, -> we'll just cover some basic knowledge. - -You might be wondering why the `/etc/nixos/configuration.nix` configuration file adheres -to the Nixpkgs Module definition and can be referenced directly within the `flake.nix`. - -This is because the Nixpkgs repository contains a significant amount of NixOS -implementation source code, primarily written in Nix. To manage and maintain such a large -volume of Nix code and to allow users to customize various functions of their NixOS -systems, a modular system for Nix code is essential. - -This modular system for Nix code is also implemented within the Nixpkgs repository and is -primarily used for modularizing NixOS system configurations. However, it is also widely -used in other contexts, such as nix-darwin and home-manager. Since NixOS is built on this -modular system, it is only natural that its configuration files, including -`/etc/nixos/configuration.nix`, are Nixpkgs Modules. - -Before delving into the subsequent content, it's essential to have a basic understanding -of how this module system operates. - -Here's a simplified structure of a Nixpkgs Module: - -```nix -{lib, config, options, pkgs, ...}: -{ - # Importing other Modules - imports = [ - # ... - ./xxx.nix - ]; - for.bar.enable = true; - # Other option declarations - # ... -} -``` - -The definition is actually a Nix function, and it has five **automatically generated, -automatically injected, and declaration-free parameters** provided by the module system: - -1. `lib`: A built-in function library included with nixpkgs, offering many practical - functions for operating Nix expressions. - - For more information, see . -2. `config`: A set of all options' values in the current environment, which will be used - extensively in the subsequent section on the module system. -3. `options`: A set of all options defined in all Modules in the current environment. -4. `pkgs`: A collection containing all nixpkgs packages, along with several related - utility functions. - - At the beginner stage, you can consider its default value to be - `nixpkgs.legacyPackages."${system}"`, and the value of `pkgs` can be customized - through the `nixpkgs.pkgs` option. -5. `modulesPath`: A parameter available only in NixOS, which is a path pointing to - [nixpkgs/nixos/modules](https://github.com/NixOS/nixpkgs/tree/nixos-23.11/nixos/modules). - - It is defined in - [nixpkgs/nixos/lib/eval-config-minimal.nix#L43](https://github.com/NixOS/nixpkgs/blob/nixos-23.11/nixos/lib/eval-config-minimal.nix#L43). - - It is typically used to import additional NixOS modules and can be found in most - NixOS auto-generated `hardware-configuration.nix` files. - -## Passing Non-default Parameters to Submodules {#pass-non-default-parameters-to-submodules} - -If you need to pass other non-default parameters to submodules, you will need to use some -special methods to manually specify these non-default parameters. - -The Nixpkgs module system provides two ways to pass non-default parameters: - -1. The `specialArgs` parameter of the `nixpkgs.lib.nixosSystem` function -2. Using the `_module.args` option in any module to pass parameters - -The official documentation for these two parameters is buried deep and is vague and hard -to understand. If readers are interested, I will include the links here: - -1. `specialArgs`: There are scattered mentions related to it in the NixOS Manual and the - Nixpkgs Manual. - - Nixpkgs Manual: [Module System - Nixpkgs] - - NixOS Manual: - [nixpkgs/nixos-23.11/nixos/doc/manual/development/option-types.section.md#L237-L244] -1. `_module.args`: - - NixOS Manual: - [Appendix A. Configuration Options](https://nixos.org/manual/nixos/stable/options#opt-_module.args) - - Source Code: [nixpkgs/nixos-23.11/lib/modules.nix - _module.args] - -In short, `specialArgs` and `_module.args` both require an attribute set as their value, -and they serve the same purpose, passing all parameters in the attribute set to all -submodules. The difference between them is: - -1. The `_module.args` option can be used in any module to pass parameters to each other, - which is more flexible than `specialArgs`, which can only be used in the - `nixpkgs.lib.nixosSystem` function. -1. `_module.args` is declared within a module, so it must be evaluated after all modules - have been evaluated before it can be used. This means that **if you use the parameters - passed through `_module.args` in `imports = [ ... ];`, it will result in an - `infinite recursion` error**. In this case, you must use `specialArgs` instead. - -The NixOS community generally recommends prioritizing the use of the `_module.args` option -and resorting to `specialArgs` only when `_module.args` cannot be used. - -Suppose you want to pass a certain dependency to a submodule for use. You can use the -`specialArgs` parameter to pass the `inputs` to all submodules: - -```nix{13} -{ - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; - another-input.url = "github:username/repo-name/branch-name"; - }; - - outputs = inputs@{ self, nixpkgs, another-input, ... }: { - nixosConfigurations.my-nixos = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - - # Set all inputs parameters as special arguments for all submodules, - # so you can directly use all dependencies in inputs in submodules - specialArgs = { inherit inputs; }; - modules = [ - ./configuration.nix - ]; - }; - }; -} -``` - -Or you can achieve the same effect using the `_module.args` option: - -```nix{14} -{ - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; - another-input.url = "github:username/repo-name/branch-name"; - }; - outputs = inputs@{ self, nixpkgs, another-input, ... }: { - nixosConfigurations.my-nixos = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - ./configuration.nix - { - # Set all inputs parameters as special arguments for all submodules, - # so you can directly use all dependencies in inputs in submodules - _module.args = { inherit inputs; }; - } - ]; - }; - }; -} -``` - -Choose one of the two methods above to modify your configuration, and then you can use the -`inputs` parameter in `/etc/nixos/configuration.nix`. The module system will automatically -match the `inputs` defined in `specialArgs` and inject it into all submodules that require -this parameter: - -```nix{3} -# Nix will match by name and automatically inject the inputs -# from specialArgs/_module.args into the third parameter of this function -{ config, pkgs, inputs, ... }: -{ - # ... -} -``` - -The next section will demonstrate how to use `specialArgs`/`_module.args` to install -system software from other flake sources. - -## Installing System Software from Other Flake Sources {#install-system-packages-from-other-flakes} - -The most common requirement for managing a system is to install software, and we have -already seen in the previous section how to install packages from the official nixpkgs -repository using `environment.systemPackages`. These packages all come from the official -nixpkgs repository. - -Now, we will learn how to install software packages from other flake sources, which is -much more flexible than installing directly from nixpkgs. The main use case is to install -the latest version of a software that is not yet added or updated in Nixpkgs. - -Taking the Helix editor as an example, here's how to compile and install the master branch -of Helix directly. - -First, add the helix input data source to `flake.nix`: - -```nix{6,12,18} -{ - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; - - # helix editor, use the master branch - helix.url = "github:helix-editor/helix/master"; - }; - - outputs = inputs@{ self, nixpkgs, ... }: { - nixosConfigurations.my-nixos = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { inherit inputs; }; - modules = [ - ./configuration.nix - - # This module works the same as the `specialArgs` parameter we used above - # chose one of the two methods to use - # { _module.args = { inherit inputs; };} - ]; - }; - }; -} -``` - -Next, you can reference this flake input data source in `configuration.nix`: - -```nix{1,10} -{ config, pkgs, inputs, ... }: -{ - # ... - environment.systemPackages = with pkgs; [ - git - vim - wget - curl - # Here, the helix package is installed from the helix input data source - inputs.helix.packages."${pkgs.system}".helix - ]; - # ... -} -``` - -Make the necessary changes and deploy with `sudo nixos-rebuild switch`. The deployment -will take much longer this time because Nix will compile the entire Helix program from -source. - -After deployment, you can directly test and verify the installation using the `hx` command -in the terminal. - -Additionally, if you just want to try out the latest version of Helix and decide whether -to install it on your system later, there is a simpler way to do it in one command (but as -mentioned earlier, compiling from source will take a long time): - -```bash -nix run github:helix-editor/helix/master -``` - -We will go into more detail on the usage of `nix run` in the following section -[Usage of the New CLI](../other-usage-of-flakes/the-new-cli.md). - -## Leveraging Features from Other Flakes Packages - -In fact, this is the primary functionality of Flakes — a flake can depend on other flakes, -allowing it to utilize the features they provide. It's akin to how we incorporate -functionalities from other libraries when writing programs in TypeScript, Go, Rust, and -other programming languages. - -The example above, using the latest version from the official Helix Flake, illustrates -this functionality. More use cases will be discussed later, and here are a few examples -referenced for future mention: - -- [Getting Started with Home Manager](./start-using-home-manager.md): This introduces the - community's Home-Manager as a dependency, enabling direct utilization of the features - provided by this Flake. -- [Downgrading or Upgrading Packages](./downgrade-or-upgrade-packages.md): Here, different - versions of Nixpkgs are introduced as dependencies, allowing for flexible selection of - packages from various versions of Nixpkgs. - [nix flake - Nix Manual]: https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake#flake-inputs [nixpkgs/flake.nix]: https://github.com/NixOS/nixpkgs/tree/nixos-23.11/flake.nix diff --git a/docs/zh/nixos-with-flakes/introduction-to-flakes.md b/docs/zh/nixos-with-flakes/introduction-to-flakes.md index 0d157fb..ea6f671 100644 --- a/docs/zh/nixos-with-flakes/introduction-to-flakes.md +++ b/docs/zh/nixos-with-flakes/introduction-to-flakes.md @@ -35,20 +35,6 @@ Flakes[^3],因此我们可以相当确定 Flakes 不会被废弃。 总的来说,我仍然推荐大家使用 Flakes,毕竟这本书本身也是围绕 NixOS 与 Flakes 编写的,但是也 要做好准备——未来可能需要解决一些不兼容变更带来的问题。 -## Flakes 入门 - -限于个人精力,我不会在本书中详细介绍 Flakes 的使用, -请直接参考如下官方/半官方的文档。 - -- Nix Flakes 的官方文档: - - [Nix flakes - Nix Manual](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake) - - [Flakes - nix.dev](https://nix.dev/concepts/flakes) -- Eelco Dolstra (Nix 的创造者)的一系列关于 Flakes 的文章: - - [Nix Flakes, Part 1: An introduction and tutorial (Eelco Dolstra, 2020)](https://www.tweag.io/blog/2020-05-25-flakes/) - - [Nix Flakes, Part 2: Evaluation caching (Eelco Dolstra, 2020)](https://www.tweag.io/blog/2020-06-25-eval-cache/) - - [Nix Flakes, Part 3: Managing NixOS systems (Eelco Dolstra, 2020)](https://www.tweag.io/blog/2020-07-31-nixos-flakes/) -- 其他可能有用的文档: - - [Practical Nix Flakes](https://serokell.io/blog/practical-nix-flakes) ## Flakes 何时会成为稳定特性? {#when-will-flakes-stablized} diff --git a/docs/zh/nixos-with-flakes/nixos-flake-and-module-system.md b/docs/zh/nixos-with-flakes/nixos-flake-and-module-system.md new file mode 100644 index 0000000..a910f2a --- /dev/null +++ b/docs/zh/nixos-with-flakes/nixos-flake-and-module-system.md @@ -0,0 +1,269 @@ +# Flakes 的组合能力与 Nixpkgs Module 系统 + +## Nixpkgs Module 结构的简单介绍 {#simple-introduction-to-nixpkgs-module-structure} + +> 在后面的 [模块化 NixOS 配置](./modularize-the-configuration.md) 一节中会详细介绍这套模块 +> 系统的工作方式,这里只介绍些基础知识。 + +为什么 `/etc/nixos/configuration.nix` 这个配置文件会符合 Nixpkgs Module 定义,从而能直接在 +`flake.nix` 中引用它呢?可能会有读者觉得这有点出乎意料。 + +这实际是因为 Nixpkgs 中包含了大量 NixOS 的实现源码,这些源码大都使用 Nix 语言编写。为了编 +写维护如此多的 Nix 代码,并且使用户能灵活地自定义其 NixOS 系统的各项功能,就必须要有一套 +Nix 代码的模块化系统。 + +这套 Nix 代码的模块系统的实现也同样在 Nixpkgs 仓库中,它主要被用于 NixOS 系统配置的模块 +化,但也有其他的应用,比如 nix-darwin 跟 home-manager 都大量使用了这套模块系统。 + +既然 NixOS 是基于这套模块系统构建的,那它的配置文件(包括 `/etc/nixos/configuration.nix`) +是一个Nixpkgs Module,也就显得非常自然了。 + +在学习后面的内容之前,我们需要先简单了解下这套模块系统的工作方式。 + +一个简化的 Nixpkgs Module 结构如下: + +```nix +{lib, config, options, pkgs, ...}: +{ + # 导入其他 Modules + imports = [ + # ...... + # ./xxx.nix + ]; + + for.bar.enable = true; + # other options declarations + # ... +} +``` + +可以看到它的定义实际是一个 Nix 函数,该函数有 5 个**由模块系统自动生成、自动注入、无需额外 +声明的参数**: + +1. `lib`: **nixpkgs 自带的函数库,提供了许多操作 Nix 表达式的实用函数** + - 详见 +2. `config`: 包含了当前环境中所有 option 的值,在后面学习模块系统时会大量使用它 +3. `options`: 当前环境中所有 Modules 中定义的所有 options 的集合 +4. `pkgs`: **一个包含所有 nixpkgs 包的集合,它也提供了许多相关的工具函数** + - 入门阶段可以认为它的默认值为 `nixpkgs.legacyPackages."${system}"`,可通过 + `nixpkgs.pkgs` 这个 option 来自定义 `pkgs` 的值 +5. `modulesPath`: 一个只在 NixOS 中可用的参数,是一个 Path,指向 + [nixpkgs/nixos/modules](https://github.com/NixOS/nixpkgs/tree/nixos-23.11/nixos/modules) + - 它在 + [nixpkgs/nixos/lib/eval-config-minimal.nix#L43](https://github.com/NixOS/nixpkgs/blob/nixos-23.11/nixos/lib/eval-config-minimal.nix#L43) + 中被定义 + - 通常被用于导入一些额外的 NixOS 模块,NixOS 自动生成的 `hardware-configuration.nix` 中 + 基本都能看到它 + +## 传递非默认参数到模块系统中 {#pass-non-default-parameters-to-submodules} + +而如果你需要将其他非默认参数传递到子模块,就需要使用一些特殊手段手动指定这些非默认参数。 + +Nixpkgs 的模块系统提供了两种方式来传递非默认参数: + +1. `nixpkgs.lib.nixosSystem` 函数的 `specialArgs` 参数 +1. 在任一 Module 中使用 `_module.args` 这个 option 来传递参数 + +这两个参数的官方文档藏得很深,而且语焉不详、晦涩难懂。读者感兴趣的话我把链接放在这里: + +1. `specialArgs`: NixOS Manual 跟 Nixpkgs Manual 中分别有与它有关的只言片语 + - Nixpkgs Manual: [Module System - Nixpkgs] + - NixOS Manual: + [nixpkgs/nixos-23.11/nixos/doc/manual/development/option-types.section.md#L237-L244] +1. `_module.args`: + - NixOS Manual: + [Appendix A. Configuration Options](https://nixos.org/manual/nixos/stable/options#opt-_module.args) + - Source Code: [nixpkgs/nixos-23.11/lib/modules.nix - _module.args] + +总之,`specialArgs` 与 `_module.args` 需要的值都是一个 attribute set,它们的功能也相同,都 +是将其 attribute set 中的所有参数传递到所有子模块中。这两者的区别在于: + +1. 在任何 Module 中都能使用 `_module.args` 这个 option,通过它互相传递参数,这要比只能在 + `nixpkgs.lib.nixosSystem` 函数中使用的 `specialArgs` 更灵活。 +1. `_module.args` 是在 Module 中声明使用的,因此必须在所有 Modules 都已经被求值后,才能使 + 用它。这导致**如果你在 `imports = [ ... ];` 中使用 `_module.args` 传递的参数,会报错 + `infinite recursion`,这种场景下你必须改用 `specialArgs` 才行**。 + +NixOS 社区比较推荐优先使用 `_module.args` 这个 options,仅在无法使用 `_module.args` 时才改 +用 `specialArgs`。 + +假设你想将某个依赖项传递到子模块中使用,可以使用 `specialArgs` 参数将 `inputs` 传递到所有 +子模块中: + +```nix{13} +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; + another-input.url = "github:username/repo-name/branch-name"; + }; + + outputs = inputs@{ self, nixpkgs, another-input, ... }: { + nixosConfigurations.my-nixos = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + + # 将所有 inputs 参数设为所有子模块的特殊参数, + # 这样就能直接在子模块中使用 inputs 中的所有依赖项了 + specialArgs = { inherit inputs;}; + modules = [ + ./configuration.nix + ]; + }; + }; +} +``` + +或者使用 `_module.args` 这个 option 也能达成同样的效果: + +```nix{15} +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; + another-input.url = "github:username/repo-name/branch-name"; + }; + + outputs = inputs@{ self, nixpkgs, another-input, ... }: { + nixosConfigurations.my-nixos = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./configuration.nix + { + # 将所有 inputs 参数设为所有子模块的特殊参数, + # 这样就能直接在子模块中使用 inputs 中的所有依赖项了 + _module.args = { inherit inputs; }; + } + ]; + }; + }; +} +``` + +选择上述两种方式之一修改你的配置,然后在 `/etc/nixos/configuration.nix` 中就可以使用 +`inputs` 这个参数了,模块系统会自动匹配到 `specialArgs` 中定义的 `inputs`,并将其注入到所 +有需要该参数的子模块中: + +```nix{3} +# Nix 会通过名称匹配, +# 自动将 specialArgs/_module.args 中的 inputs 注入到此函数的第三个参数 +{ config, pkgs, inputs, ... }: + +# 然后我们就能在这下面使用 inputs 这个参数了 +{ + # ...... +} +``` + +下一节将演示如何使用 `specialArgs`/`_module.args` 来从其他 flake 来源安装系统软件。 + +## 从其他 flakes 安装系统软件 {#install-system-packages-from-other-flakes} + +管系统最常见的需求就是装软件,我们在上一节已经见识过如何通过 `environment.systemPackages` +来安装 `pkgs` 中的包,这些包都来自官方的 nixpkgs 仓库。 + +现在我们学习下如何安装其他 flake 来源的软件包,这比直接从 nixpkgs 安装要灵活很多,最主要的 +用途是安装 Nixpkgs 中还未添加或未更新的某软件的最新版本。 + +以 [helix](https://github.com/helix-editor/helix) 编辑器为例,这里演示下如何直接编译安装 +helix 的 master 分支。 + +首先在 `flake.nix` 中添加 helix 这个 inputs 数据源: + +```nix{6,12,18} +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; + + # helix editor, use the master branch + helix.url = "github:helix-editor/helix/master"; + }; + + outputs = inputs@{ self, nixpkgs, ... }: { + nixosConfigurations.my-nixos = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs;}; + modules = [ + ./configuration.nix + + # 如下 Module 与前面的 `specialArgs` 参数功能完全一致 + # 选择其中一种即可 + # { _module.args = { inherit inputs; };} + ]; + + }; + }; +} +``` + +接下来在 `configuration.nix` 中就能引用这个 flake input 数据源了: + +```nix{1,10} +{ config, pkgs, inputs, ... }: +{ + # 省略无关配置...... + environment.systemPackages = with pkgs; [ + git + vim + wget + curl + # 这里从 helix 这个 inputs 数据源安装了 helix 程序 + inputs.helix.packages."${pkgs.system}".helix + ]; + # 省略其他配置...... +} +``` + +改好后再 `sudo nixos-rebuild switch` 部署,就能安装好 Helix 程序了。这次部署用时会比以往长 +挺多,因为 Nix 会从源码编译整个 Helix 程序。 + +部署完毕后,可直接在终端使用 `hx` 命令测试验证。 + +另外,如果你只是想尝试一下 Helix 的最新版本,再决定要不要真正地将它安装到系统里,有更简单 +的办法,一行命令就行(但如前所述,源码编译会很费时间): + +```bash +nix run github:helix-editor/helix/master +``` + +我们会在后面的 [新一代 Nix 命令行工具的使用](../other-usage-of-flakes/the-new-cli.md) 中详 +细介绍 `nix run` 的用法。 + +## 使用其他 Flakes 包提供的功能 + +其实这才是 Flakes 最主要的功能,一个 Flake 可以依赖其他 Flakes,从而使用它们提供的功能——就 +如同我们在写 TypeScript/Go/Rust 等程序时使用其他 Library 提供的功能一样。 + +上面使用 Helix 的官方 Flake 中提供的最新版本就是一个例子,其他更多的用例会在后面提到,这里 +引用几个后面会讲的例子: + +- [Getting Started with Home Manager](./start-using-home-manager.md): 这里引入了社区的 + Home-Manager 作为依赖项,从而能直接使用该 Flake 提供的功能。 +- [Downgrading or Upgrading Packages](./downgrade-or-upgrade-packages.md): 这里引入了不同 + 版本的 Nixpkgs 作为依赖项,从而能很灵活地选用不同版本的 Nixpkgs 中的包。 + + +## 其他 Flakes 学习资料 + +到此为止,我们已经学习了如何使用 Flakes 来配置 NixOS 系统。 +如果你对 Flakes 还有更多的疑问,或者想深入学习,请直接参考如下官方/半官方的文档。 + +- Nix Flakes 的官方文档: + - [Nix flakes - Nix Manual](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake) + - [Flakes - nix.dev](https://nix.dev/concepts/flakes) +- Eelco Dolstra (Nix 的创造者)的一系列关于 Flakes 的文章: + - [Nix Flakes, Part 1: An introduction and tutorial (Eelco Dolstra, 2020)](https://www.tweag.io/blog/2020-05-25-flakes/) + - [Nix Flakes, Part 2: Evaluation caching (Eelco Dolstra, 2020)](https://www.tweag.io/blog/2020-06-25-eval-cache/) + - [Nix Flakes, Part 3: Managing NixOS systems (Eelco Dolstra, 2020)](https://www.tweag.io/blog/2020-07-31-nixos-flakes/) +- 其他可能有用的文档: + - [Practical Nix Flakes](https://serokell.io/blog/practical-nix-flakes) + + +[nix flake - Nix Manual]: + https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake#flake-inputs +[nixpkgs/flake.nix]: https://github.com/NixOS/nixpkgs/tree/nixos-23.11/flake.nix +[nixpkgs/nixos/lib/eval-config.nix]: + https://github.com/NixOS/nixpkgs/tree/nixos-23.11/nixos/lib/eval-config.nix +[Module System - Nixpkgs]: + https://github.com/NixOS/nixpkgs/blob/23.11/doc/module-system/module-system.chapter.md +[nixpkgs/nixos-23.11/lib/modules.nix - _module.args]: + https://github.com/NixOS/nixpkgs/blob/nixos-23.11/lib/modules.nix#L122-L184 +[nixpkgs/nixos-23.11/nixos/doc/manual/development/option-types.section.md#L237-L244]: + https://github.com/NixOS/nixpkgs/blob/nixos-23.11/nixos/doc/manual/development/option-types.section.md?plain=1#L237-L244 diff --git a/docs/zh/nixos-with-flakes/nixos-flake-configuration-explained.md b/docs/zh/nixos-with-flakes/nixos-flake-configuration-explained.md new file mode 100644 index 0000000..9c2b4fa --- /dev/null +++ b/docs/zh/nixos-with-flakes/nixos-flake-configuration-explained.md @@ -0,0 +1,171 @@ +# `flake.nix` 配置详解 {#flake-nix-configuration-explained} + +上面我们创建了一个 `flake.nix` 文件并通过它来管理系统配置,但你对它的结构还是一头雾水,下 +面我们来详细解释一下这个文件的内容。 + +### 1. flake inputs + +首先看看其中的 `inputs` 属性,它是一个 attribute set,其中定义了这个 flake 的所有依赖项, +这些依赖项会在被拉取后,作为参数传递给 `outputs` 函数: + +```nix{2-5,7} +{ + inputs = { + # NixOS 官方软件源,这里使用 nixos-23.11 分支 + nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; + }; + + outputs = { self, nixpkgs, ... }@inputs: { + # 省略掉前面的配置...... + }; +} +``` + +`inputs` 中的每一项依赖有许多类型与定义方式,可以是另一个 flake,也可以是一个普通的 Git 仓 +库,又或者一个本地路径。 +[Flakes 的其他玩法 - Flake 的 inputs](../other-usage-of-flakes/inputs.md) 中详细介绍了常见 +的依赖项类型与定义方式。 + +这里我们只定义了 `nixpkgs` 这一个依赖项,使用的是 flake 中最常见的引用方式,即 +`github:owner/name/reference`,这里的 `reference` 可以是分支名、commit-id 或 tag。 + +`nixpkgs` 在 `inputs` 中被定义后,就可以在后面的 `outputs` 函数的参数中使用此依赖项中的内 +容了,我们的示例中正是这么干的。 + +### 2. flake outputs + +再来看看 `outputs`,它是一个以 `inputs` 中的依赖项为参数的函数,函数的返回值是一个 +attribute set,这个返回的 attribute set 即为该 flake 的构建结果: + +```nix{10-18} +{ + description = "A simple NixOS flake"; + + inputs = { + # NixOS 官方软件源,这里使用 nixos-23.11 分支 + nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; + }; + + outputs = { self, nixpkgs, ... }@inputs: { + # hostname 为 my-nixos 的主机会使用这个配置 + nixosConfigurations.my-nixos = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./configuration.nix + ]; + }; + }; +} +``` + +flake 有很多的用途,也可以有很多不同类型的 +outputs,[Flake 的 outputs](../other-usage-of-flakes/outputs.md) 一节有更详细的介绍。这里 +我们只用到了 `nixosConfigurations` 这一类型的 outputs,它用于配置 NixOS 系统。 + +在我们运行 `sudo nixos-rebuild switch` 命令时,它会从 `/etc/nixos/flake.nix` 的 `outputs` +函数返回值中查找 `nixosConfigurations.my-nixos` (其中的 `my-nixos` 将会是你当前系统的 +hostname)这一属性,并使用其中的定义来配置你的 NixOS 系统。 + +实际我们也可以自定义 flake 的位置与 NixOS 配置的名称,而不是使用默认值。只需要在 +`nixos-rebuild` 命令后面添加 `--flake` 参数即可,一个例子: + +```nix +sudo nixos-rebuild switch --flake /path/to/your/flake#your-hostname +``` + +上述命令中的 `--flake /path/to/your/flake#your-hostname` 参数简要说明如下: + +1. `/path/to/your/flake` 为目标 flake 的位置,默认会使用 `/etc/nixos/` 这个路径。 +2. `#` 是一个分隔符,其后的 `your-hostname` 则是 NixOS 配置的名称。`nixos-rebuild` 默认会 + 以你当前系统的 hostname 为配置名称进行查找。 + +你甚至能直接引用一个远程的 GitHub 仓库作为你的 flake 来源,示例如下: + +```nix +sudo nixos-rebuild switch --flake github:owner/repo#your-hostname +``` + +### 3. `outputs` 函数的特殊参数 `self` {#special-parameter-self-of-outputs-function} + +虽然我们前面并未提到,但是前面的所有示例代码中,`outputs` 函数都还有一个特殊的参数 +`self`,这里我们简单介绍一下它的作用。 + +[nix flake - Nix Manual] 对其的描述是: + +> The special input named `self` refers to the outputs and source tree of this flake. + +所以说 `self` 是当前 flake 的 `outputs` 函数的返回值,同时也是当前 flake 源码的文件夹路径 +(source tree)。 + +这里我们并未使用到 `self` 这个参数,在后面一些更复杂的例子(或者你网上搜 +到的一些配置)中,我们会看到 `self` 的用法。 + +> 注意:你可能会在一些代码中看到,有人会使用 `self.outputs` 来引用当前 flake 的输出,这 +> 确实是可行的,但 Nix Manual 并未对其做任何说明,属于是 flake 的内部实现细节,不建议在 +> 你自己的代码中使用! + +### 4. `nixpkgs.lib.nixosSystem` 函数的简单介绍 {#simple-introduction-to-nixpkgs-lib-nixos-system} + +**一个 Flake 可以依赖其他 Flakes,从而使用它们提供的功能**。 + +默认情况下,一个 flake 会在其每个依赖项(即 `inputs` 中的每一项)的根目录下寻找 +`flake.nix` 文件并**懒惰求值**(lazy evaluation)它们的 `outputs` 函数,接着将这些函数返回 +的 attribute sets 作为参数传递给它自身的 `outputs` 函数,这样我们就能在当前 flake 中使用它 +所依赖的其他 flakes 提供的功能了。 + +更精确地说,对每个依赖项的 `outputs` 函数的求值都是懒惰(lazy)的,也就是说,一个 flake 的 +`outputs` 函数只有在被真正使用到的时候才会被求值,这样就能避免不必要的计算,从而提高效率。 + +上面的描述可能有点绕,我们还是结合本节中使用的 `flake.nix` 示例来看看这个过程。我们的 +`flake.nix` 声明了 `inputs.nixpkgs` 这个依赖项,因此 [nixpkgs/flake.nix] 会在我们执行 +`sudo nixos-rebuild switch` 这个命令时被求值。从 Nixpkgs 仓库的源码中能看到它的 flake +outputs 定义中有返回 `lib` 这个属性,我们的例子中就使用了 `lib` 属性中的 `nixosSystem` 这 +个函数来配置我们的 NixOS 系统: + +```nix{8-13} +{ + inputs = { + # NixOS 官方软件源,这里使用 nixos-23.11 分支 + nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; + }; + + outputs = { self, nixpkgs, ... }@inputs: { + nixosConfigurations.my-nixos = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./configuration.nix + ]; + }; + }; +} +``` + +`nixpkgs.lib.nixosSystem` 后面跟的 attribute set 就是该函数的参数,我们这里只设置了两个参 +数: + +1. `system`: 这个很好懂,就是系统架构参数。 +2. `modules`: 此函数是一个 modules 的列表,NixOS 的实际系统配置都定义在这些 modules 中。 + +`/etc/nixos/configuration.nix` 这个配置文件本身就是一个 Nixpkgs Module,因此可以直接将其添 +加到 `modules` 列表中使用。 + +新手阶段了解这些就足够了,探究 `nixpkgs.lib.nixosSystem` 函数的具体实现需要对 Nixpkgs 的模 +块系统有一定的了解。读者可以在学习了 +[模块化 NixOS 配置](./modularize-the-configuration.md) 一节后,再回过头来从 +[nixpkgs/flake.nix] 中找到 `nixpkgs.lib.nixosSystem` 的定义,跟踪它的源码,研究其实现方 +式。 + + +[nix flake - Nix Manual]: + https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake#flake-inputs +[nixpkgs/flake.nix]: https://github.com/NixOS/nixpkgs/tree/nixos-23.11/flake.nix +[nixpkgs/nixos/lib/eval-config.nix]: + https://github.com/NixOS/nixpkgs/tree/nixos-23.11/nixos/lib/eval-config.nix +[Module System - Nixpkgs]: + https://github.com/NixOS/nixpkgs/blob/23.11/doc/module-system/module-system.chapter.md +[nixpkgs/nixos-23.11/lib/modules.nix - _module.args]: + https://github.com/NixOS/nixpkgs/blob/nixos-23.11/lib/modules.nix#L122-L184 +[nixpkgs/nixos-23.11/nixos/doc/manual/development/option-types.section.md#L237-L244]: + https://github.com/NixOS/nixpkgs/blob/nixos-23.11/nixos/doc/manual/development/option-types.section.md?plain=1#L237-L244 + + diff --git a/docs/zh/nixos-with-flakes/nixos-with-flakes-enabled.md b/docs/zh/nixos-with-flakes/nixos-with-flakes-enabled.md index 552c4c0..374d87b 100644 --- a/docs/zh/nixos-with-flakes/nixos-with-flakes-enabled.md +++ b/docs/zh/nixos-with-flakes/nixos-with-flakes-enabled.md @@ -1,11 +1,14 @@ # 使用 Flakes 来管理你的 NixOS -## 启用 NixOS 的 Flakes 支持 {#enable-nix-flakes} - 与 NixOS 当前默认的配置方式相比,Flakes 提供了更好的可复现性,同时它清晰的包结构定义原生支 持了以其他 Git 仓库为依赖,便于代码分享,因此本书更建议使用 Flakes 来管理系统配置。 -目前 Flakes 作为一个实验特性,仍未被默认启用,我们需要手动修改 +本节我们介绍如何使用 Flakes 来管理 NixOS 系统配置,**阅读本节内容不需要提前对 Flakes 有任 +何了解**。 + +## 启用 NixOS 的 Flakes 支持 {#enable-nix-flakes} + +目前 Flakes 作为一个实验特性,仍未被默认启用,因此我们需要先手动修改 `/etc/nixos/configuration.nix` 文件,启用 Flakes 特性以及配套的船新 nix 命令行工具: ```nix{12,15} @@ -103,9 +106,14 @@ cat flake.nix - `/etc/nixos/hardware-configuration.nix`: 这是系统硬件配置文件,由 NixOS 生成,描述了系统 的硬件信息 -到这里为止, `/etc/nixos/flake.nix` 仅仅是 `/etc/nixos/configuration.nix` 的一个 thin -wrapper,它自身并没有提供任何新的功能,也没有引入任何破坏性的变更。在本书后面的内容中,我 -们会逐渐看到这样一个 wrapper 带来了哪些好处。 +## 总结 {#conclusion} + +本节中我们添加了一个非常简单的配置文件 `/etc/nixos/flake.nix`,它仅仅是 +`/etc/nixos/configuration.nix` 的一个 thin wrapper,它自身并没有提供任何新的功能,也没有引 +入任何破坏性的变更。 + +在本书后面的内容中,我们会学习了解 `flake.nix` 的结构与功能,并逐渐看到这样一个 wrapper 能 +为我们带来哪些好处。 > 注意:**本书描述的配置管理方式并非「Everything in a single file」,更推荐将配置内容分门 > 别类地存放到不同的 nix 文件中**,然后在 `flake.nix` 的 `modules` 参数列表中引入这些配置 @@ -114,402 +122,6 @@ wrapper,它自身并没有提供任何新的功能,也没有引入任何破 > 你的 NixOS 配置,[其他实用技巧 - 使用 Git 管理 NixOS 配置](./other-useful-tips.md) 将会 > 介绍几种使用 Git 管理 NixOS 配置的最佳实践。 -## `flake.nix` 配置详解 {#flake-nix-configuration-explained} - -上面我们创建了一个 `flake.nix` 文件并通过它来管理系统配置,但你对它的结构还是一头雾水,下 -面我们来详细解释一下这个文件的内容。 - -### 1. flake inputs - -首先看看其中的 `inputs` 属性,它是一个 attribute set,其中定义了这个 flake 的所有依赖项, -这些依赖项会在被拉取后,作为参数传递给 `outputs` 函数: - -```nix{2-5,7} -{ - inputs = { - # NixOS 官方软件源,这里使用 nixos-23.11 分支 - nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; - }; - - outputs = { self, nixpkgs, ... }@inputs: { - # 省略掉前面的配置...... - }; -} -``` - -`inputs` 中的每一项依赖有许多类型与定义方式,可以是另一个 flake,也可以是一个普通的 Git 仓 -库,又或者一个本地路径。 -[Flakes 的其他玩法 - Flake 的 inputs](../other-usage-of-flakes/inputs.md) 中详细介绍了常见 -的依赖项类型与定义方式。 - -这里我们只定义了 `nixpkgs` 这一个依赖项,使用的是 flake 中最常见的引用方式,即 -`github:owner/name/reference`,这里的 `reference` 可以是分支名、commit-id 或 tag。 - -`nixpkgs` 在 `inputs` 中被定义后,就可以在后面的 `outputs` 函数的参数中使用此依赖项中的内 -容了,我们的示例中正是这么干的。 - -### 2. flake outputs - -再来看看 `outputs`,它是一个以 `inputs` 中的依赖项为参数的函数,函数的返回值是一个 -attribute set,这个返回的 attribute set 即为该 flake 的构建结果: - -```nix{10-18} -{ - description = "A simple NixOS flake"; - - inputs = { - # NixOS 官方软件源,这里使用 nixos-23.11 分支 - nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; - }; - - outputs = { self, nixpkgs, ... }@inputs: { - # hostname 为 my-nixos 的主机会使用这个配置 - nixosConfigurations.my-nixos = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - ./configuration.nix - ]; - }; - }; -} -``` - -flake 有很多的用途,也可以有很多不同类型的 -outputs,[Flake 的 outputs](../other-usage-of-flakes/outputs.md) 一节有更详细的介绍。这里 -我们只用到了 `nixosConfigurations` 这一类型的 outputs,它用于配置 NixOS 系统。 - -在我们运行 `sudo nixos-rebuild switch` 命令时,它会从 `/etc/nixos/flake.nix` 的 `outputs` -函数返回值中查找 `nixosConfigurations.my-nixos` (其中的 `my-nixos` 将会是你当前系统的 -hostname)这一属性,并使用其中的定义来配置你的 NixOS 系统。 - -实际我们也可以自定义 flake 的位置与 NixOS 配置的名称,而不是使用默认值。只需要在 -`nixos-rebuild` 命令后面添加 `--flake` 参数即可,一个例子: - -```nix -sudo nixos-rebuild switch --flake /path/to/your/flake#your-hostname -``` - -上述命令中的 `--flake /path/to/your/flake#your-hostname` 参数简要说明如下: - -1. `/path/to/your/flake` 为目标 flake 的位置,默认会使用 `/etc/nixos/` 这个路径。 -2. `#` 是一个分隔符,其后的 `your-hostname` 则是 NixOS 配置的名称。`nixos-rebuild` 默认会 - 以你当前系统的 hostname 为配置名称进行查找。 - -你甚至能直接引用一个远程的 GitHub 仓库作为你的 flake 来源,示例如下: - -```nix -sudo nixos-rebuild switch --flake github:owner/repo#your-hostname -``` - -### 3. `outputs` 函数的特殊参数 `self` {#special-parameter-self-of-outputs-function} - -虽然我们前面并未提到,但是前面的所有示例代码中,`outputs` 函数都还有一个特殊的参数 -`self`,这里我们简单介绍一下它的作用。 - -[nix flake - Nix Manual] 对其的描述是: - -> The special input named `self` refers to the outputs and source tree of this flake. - -所以说 `self` 是当前 flake 的 `outputs` 函数的返回值,同时也是当前 flake 源码的文件夹路径 -(source tree)。 - -这里我们并未使用到 `self` 这个参数,在后面一些更复杂的例子(或者你网上搜 -到的一些配置)中,我们会看到 `self` 的用法。 - -> 注意:你可能会在一些代码中看到,有人会使用 `self.outputs` 来引用当前 flake 的输出,这 -> 确实是可行的,但 Nix Manual 并未对其做任何说明,属于是 flake 的内部实现细节,不建议在 -> 你自己的代码中使用! - -### 4. `nixpkgs.lib.nixosSystem` 函数的简单介绍 {#simple-introduction-to-nixpkgs-lib-nixos-system} - -**一个 Flake 可以依赖其他 Flakes,从而使用它们提供的功能**。 - -默认情况下,一个 flake 会在其每个依赖项(即 `inputs` 中的每一项)的根目录下寻找 -`flake.nix` 文件并**懒惰求值**(lazy evaluation)它们的 `outputs` 函数,接着将这些函数返回 -的 attribute sets 作为参数传递给它自身的 `outputs` 函数,这样我们就能在当前 flake 中使用它 -所依赖的其他 flakes 提供的功能了。 - -更精确地说,对每个依赖项的 `outputs` 函数的求值都是懒惰(lazy)的,也就是说,一个 flake 的 -`outputs` 函数只有在被真正使用到的时候才会被求值,这样就能避免不必要的计算,从而提高效率。 - -上面的描述可能有点绕,我们还是结合本节中使用的 `flake.nix` 示例来看看这个过程。我们的 -`flake.nix` 声明了 `inputs.nixpkgs` 这个依赖项,因此 [nixpkgs/flake.nix] 会在我们执行 -`sudo nixos-rebuild switch` 这个命令时被求值。从 Nixpkgs 仓库的源码中能看到它的 flake -outputs 定义中有返回 `lib` 这个属性,我们的例子中就使用了 `lib` 属性中的 `nixosSystem` 这 -个函数来配置我们的 NixOS 系统: - -```nix{8-13} -{ - inputs = { - # NixOS 官方软件源,这里使用 nixos-23.11 分支 - nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; - }; - - outputs = { self, nixpkgs, ... }@inputs: { - nixosConfigurations.my-nixos = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - ./configuration.nix - ]; - }; - }; -} -``` - -`nixpkgs.lib.nixosSystem` 后面跟的 attribute set 就是该函数的参数,我们这里只设置了两个参 -数: - -1. `system`: 这个很好懂,就是系统架构参数。 -2. `modules`: 此函数是一个 modules 的列表,NixOS 的实际系统配置都定义在这些 modules 中。 - -`/etc/nixos/configuration.nix` 这个配置文件本身就是一个 Nixpkgs Module,因此可以直接将其添 -加到 `modules` 列表中使用。 - -新手阶段了解这些就足够了,探究 `nixpkgs.lib.nixosSystem` 函数的具体实现需要对 Nixpkgs 的模 -块系统有一定的了解。读者可以在学习了 -[模块化 NixOS 配置](./modularize-the-configuration.md) 一节后,再回过头来从 -[nixpkgs/flake.nix] 中找到 `nixpkgs.lib.nixosSystem` 的定义,跟踪它的源码,研究其实现方 -式。 - -## Nixpkgs Module 结构的简单介绍 {#simple-introduction-to-nixpkgs-module-structure} - -> 在后面的 [模块化 NixOS 配置](./modularize-the-configuration.md) 一节中会详细介绍这套模块 -> 系统的工作方式,这里只介绍些基础知识。 - -为什么 `/etc/nixos/configuration.nix` 这个配置文件会符合 Nixpkgs Module 定义,从而能直接在 -`flake.nix` 中引用它呢?可能会有读者觉得这有点出乎意料。 - -这实际是因为 Nixpkgs 中包含了大量 NixOS 的实现源码,这些源码大都使用 Nix 语言编写。为了编 -写维护如此多的 Nix 代码,并且使用户能灵活地自定义其 NixOS 系统的各项功能,就必须要有一套 -Nix 代码的模块化系统。 - -这套 Nix 代码的模块系统的实现也同样在 Nixpkgs 仓库中,它主要被用于 NixOS 系统配置的模块 -化,但也有其他的应用,比如 nix-darwin 跟 home-manager 都大量使用了这套模块系统。 - -既然 NixOS 是基于这套模块系统构建的,那它的配置文件(包括 `/etc/nixos/configuration.nix`) -是一个Nixpkgs Module,也就显得非常自然了。 - -在学习后面的内容之前,我们需要先简单了解下这套模块系统的工作方式。 - -一个简化的 Nixpkgs Module 结构如下: - -```nix -{lib, config, options, pkgs, ...}: -{ - # 导入其他 Modules - imports = [ - # ...... - # ./xxx.nix - ]; - - for.bar.enable = true; - # other options declarations - # ... -} -``` - -可以看到它的定义实际是一个 Nix 函数,该函数有 5 个**由模块系统自动生成、自动注入、无需额外 -声明的参数**: - -1. `lib`: **nixpkgs 自带的函数库,提供了许多操作 Nix 表达式的实用函数** - - 详见 -2. `config`: 包含了当前环境中所有 option 的值,在后面学习模块系统时会大量使用它 -3. `options`: 当前环境中所有 Modules 中定义的所有 options 的集合 -4. `pkgs`: **一个包含所有 nixpkgs 包的集合,它也提供了许多相关的工具函数** - - 入门阶段可以认为它的默认值为 `nixpkgs.legacyPackages."${system}"`,可通过 - `nixpkgs.pkgs` 这个 option 来自定义 `pkgs` 的值 -5. `modulesPath`: 一个只在 NixOS 中可用的参数,是一个 Path,指向 - [nixpkgs/nixos/modules](https://github.com/NixOS/nixpkgs/tree/nixos-23.11/nixos/modules) - - 它在 - [nixpkgs/nixos/lib/eval-config-minimal.nix#L43](https://github.com/NixOS/nixpkgs/blob/nixos-23.11/nixos/lib/eval-config-minimal.nix#L43) - 中被定义 - - 通常被用于导入一些额外的 NixOS 模块,NixOS 自动生成的 `hardware-configuration.nix` 中 - 基本都能看到它 - -## 传递非默认参数到模块系统中 {#pass-non-default-parameters-to-submodules} - -而如果你需要将其他非默认参数传递到子模块,就需要使用一些特殊手段手动指定这些非默认参数。 - -Nixpkgs 的模块系统提供了两种方式来传递非默认参数: - -1. `nixpkgs.lib.nixosSystem` 函数的 `specialArgs` 参数 -1. 在任一 Module 中使用 `_module.args` 这个 option 来传递参数 - -这两个参数的官方文档藏得很深,而且语焉不详、晦涩难懂。读者感兴趣的话我把链接放在这里: - -1. `specialArgs`: NixOS Manual 跟 Nixpkgs Manual 中分别有与它有关的只言片语 - - Nixpkgs Manual: [Module System - Nixpkgs] - - NixOS Manual: - [nixpkgs/nixos-23.11/nixos/doc/manual/development/option-types.section.md#L237-L244] -1. `_module.args`: - - NixOS Manual: - [Appendix A. Configuration Options](https://nixos.org/manual/nixos/stable/options#opt-_module.args) - - Source Code: [nixpkgs/nixos-23.11/lib/modules.nix - _module.args] - -总之,`specialArgs` 与 `_module.args` 需要的值都是一个 attribute set,它们的功能也相同,都 -是将其 attribute set 中的所有参数传递到所有子模块中。这两者的区别在于: - -1. 在任何 Module 中都能使用 `_module.args` 这个 option,通过它互相传递参数,这要比只能在 - `nixpkgs.lib.nixosSystem` 函数中使用的 `specialArgs` 更灵活。 -1. `_module.args` 是在 Module 中声明使用的,因此必须在所有 Modules 都已经被求值后,才能使 - 用它。这导致**如果你在 `imports = [ ... ];` 中使用 `_module.args` 传递的参数,会报错 - `infinite recursion`,这种场景下你必须改用 `specialArgs` 才行**。 - -NixOS 社区比较推荐优先使用 `_module.args` 这个 options,仅在无法使用 `_module.args` 时才改 -用 `specialArgs`。 - -假设你想将某个依赖项传递到子模块中使用,可以使用 `specialArgs` 参数将 `inputs` 传递到所有 -子模块中: - -```nix{13} -{ - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; - another-input.url = "github:username/repo-name/branch-name"; - }; - - outputs = inputs@{ self, nixpkgs, another-input, ... }: { - nixosConfigurations.my-nixos = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - - # 将所有 inputs 参数设为所有子模块的特殊参数, - # 这样就能直接在子模块中使用 inputs 中的所有依赖项了 - specialArgs = { inherit inputs;}; - modules = [ - ./configuration.nix - ]; - }; - }; -} -``` - -或者使用 `_module.args` 这个 option 也能达成同样的效果: - -```nix{15} -{ - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; - another-input.url = "github:username/repo-name/branch-name"; - }; - - outputs = inputs@{ self, nixpkgs, another-input, ... }: { - nixosConfigurations.my-nixos = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - ./configuration.nix - { - # 将所有 inputs 参数设为所有子模块的特殊参数, - # 这样就能直接在子模块中使用 inputs 中的所有依赖项了 - _module.args = { inherit inputs; }; - } - ]; - }; - }; -} -``` - -选择上述两种方式之一修改你的配置,然后在 `/etc/nixos/configuration.nix` 中就可以使用 -`inputs` 这个参数了,模块系统会自动匹配到 `specialArgs` 中定义的 `inputs`,并将其注入到所 -有需要该参数的子模块中: - -```nix{3} -# Nix 会通过名称匹配, -# 自动将 specialArgs/_module.args 中的 inputs 注入到此函数的第三个参数 -{ config, pkgs, inputs, ... }: - -# 然后我们就能在这下面使用 inputs 这个参数了 -{ - # ...... -} -``` - -下一节将演示如何使用 `specialArgs`/`_module.args` 来从其他 flake 来源安装系统软件。 - -## 从其他 flake 来源安装系统软件 {#install-system-packages-from-other-flakes} - -管系统最常见的需求就是装软件,我们在上一节已经见识过如何通过 `environment.systemPackages` -来安装 `pkgs` 中的包,这些包都来自官方的 nixpkgs 仓库。 - -现在我们学习下如何安装其他 flake 来源的软件包,这比直接从 nixpkgs 安装要灵活很多,最主要的 -用途是安装 Nixpkgs 中还未添加或未更新的某软件的最新版本。 - -以 [helix](https://github.com/helix-editor/helix) 编辑器为例,这里演示下如何直接编译安装 -helix 的 master 分支。 - -首先在 `flake.nix` 中添加 helix 这个 inputs 数据源: - -```nix{6,12,18} -{ - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; - - # helix editor, use the master branch - helix.url = "github:helix-editor/helix/master"; - }; - - outputs = inputs@{ self, nixpkgs, ... }: { - nixosConfigurations.my-nixos = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { inherit inputs;}; - modules = [ - ./configuration.nix - - # 如下 Module 与前面的 `specialArgs` 参数功能完全一致 - # 选择其中一种即可 - # { _module.args = { inherit inputs; };} - ]; - - }; - }; -} -``` - -接下来在 `configuration.nix` 中就能引用这个 flake input 数据源了: - -```nix{1,10} -{ config, pkgs, inputs, ... }: -{ - # 省略无关配置...... - environment.systemPackages = with pkgs; [ - git - vim - wget - curl - # 这里从 helix 这个 inputs 数据源安装了 helix 程序 - inputs.helix.packages."${pkgs.system}".helix - ]; - # 省略其他配置...... -} -``` - -改好后再 `sudo nixos-rebuild switch` 部署,就能安装好 Helix 程序了。这次部署用时会比以往长 -挺多,因为 Nix 会从源码编译整个 Helix 程序。 - -部署完毕后,可直接在终端使用 `hx` 命令测试验证。 - -另外,如果你只是想尝试一下 Helix 的最新版本,再决定要不要真正地将它安装到系统里,有更简单 -的办法,一行命令就行(但如前所述,源码编译会很费时间): - -```bash -nix run github:helix-editor/helix/master -``` - -我们会在后面的 [新一代 Nix 命令行工具的使用](../other-usage-of-flakes/the-new-cli.md) 中详 -细介绍 `nix run` 的用法。 - -## 使用其他 Flakes 包提供的功能 - -其实这才是 Flakes 最主要的功能,一个 Flake 可以依赖其他 Flakes,从而使用它们提供的功能——就 -如同我们在写 TypeScript/Go/Rust 等程序时使用其他 Library 提供的功能一样。 - -上面使用 Helix 的官方 Flake 中提供的最新版本就是一个例子,其他更多的用例会在后面提到,这里 -引用几个后面会讲的例子: - -- [Getting Started with Home Manager](./start-using-home-manager.md): 这里引入了社区的 - Home-Manager 作为依赖项,从而能直接使用该 Flake 提供的功能。 -- [Downgrading or Upgrading Packages](./downgrade-or-upgrade-packages.md): 这里引入了不同 - 版本的 Nixpkgs 作为依赖项,从而能很灵活地选用不同版本的 Nixpkgs 中的包。 - [nix flake - Nix Manual]: https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake#flake-inputs [nixpkgs/flake.nix]: https://github.com/NixOS/nixpkgs/tree/nixos-23.11/flake.nix From 28616c8502e2c0d7fe44cdc8d7d6737c35c4cd27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikko=20Lukas=20R=C3=A4s=C3=A4nen?= <1522239+mikkolukas@users.noreply.github.com> Date: Sat, 23 Mar 2024 17:42:32 +0100 Subject: [PATCH 08/15] Fixed a single typo (#133) Corrected "Cconclusion" to "Conclusion" --- docs/nixos-with-flakes/nixos-with-flakes-enabled.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/nixos-with-flakes/nixos-with-flakes-enabled.md b/docs/nixos-with-flakes/nixos-with-flakes-enabled.md index 88450e2..63029ec 100644 --- a/docs/nixos-with-flakes/nixos-with-flakes-enabled.md +++ b/docs/nixos-with-flakes/nixos-with-flakes-enabled.md @@ -120,7 +120,7 @@ Currently, our flake includes these files: - `/etc/nixos/hardware-configuration.nix`: This is the system hardware configuration file, generated by NixOS, which describes the system's hardware information. -## Cconclusion +## Conclusion Up to this point, we have merely added a very simple configuration file, `/etc/nixos/flake.nix`, which has merely been a thin wrapper around From eb63d0288b8c2ef8244b9b3c37f4ecb4b503e029 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Tue, 26 Mar 2024 23:23:18 +0800 Subject: [PATCH 09/15] fix: license --- .github/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index ef67b78..c590fd7 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -19,7 +19,7 @@ But please respect the following restrictions: ## License -By contributing, you agree that your contributions will be licensed under its MIT License. +By contributing, you agree that your contributions will be licensed under [CC BY-SA 4.0](../LICENSE.md). ## Pull requests From 29f6473dad2944228da47320b2268e8caba9a7f6 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Tue, 26 Mar 2024 23:37:41 +0800 Subject: [PATCH 10/15] feat: migrate content about china's networking to nixos-cn --- docs/zh/introduction/installation.md | 68 ++-------------------------- 1 file changed, 5 insertions(+), 63 deletions(-) diff --git a/docs/zh/introduction/installation.md b/docs/zh/introduction/installation.md index 692e152..b1d2a3b 100644 --- a/docs/zh/introduction/installation.md +++ b/docs/zh/introduction/installation.md @@ -8,72 +8,14 @@ Nix 有多种安装方式: 本书主要介绍 NixOS 与 Flakes 的使用,因此不展开讨论。 -NixOS 的安装步骤很简单,这里不多介绍,仅列一下我觉得比较有用的参考资料: +NixOS 的安装不难,与许多传统发行版类似,它提供了一个对新手非常友好的 GUI 安装程序。请移步 +[NixOS-CN 的系统安装教程](https://nixos-cn.org/tutorials/installation/) 查看详细的安装步 +骤。 + +其他可能有用的参考资料: 1. [NixOS 官网](https://nixos.org/download.html) -1. [NixOS-CN 社区的保姆级安装教程](https://nixos-cn.org/tutorials/installation/) 1. [复用 flake 管理 NixOS WSL](https://zhuanlan.zhihu.com/p/627073511): 使用 WSL 的用户可 以参考下这篇文章 1. [ryan4yin/nix-darwin-kickstarter](https://github.com/ryan4yin/nix-darwin-kickstart): macOS 用户可以通过这个模板仓库结合本书的内容来学习使用 Nix. - -## 对中国大陆用户流畅使用 NixOS 的建议 - -国内用户在使用 NixOS 时会存在一些网络问题,一是 NixOS 高度依赖 GitHub 作为 channel/flake -数据源——在国内访问 GitHub 相当的慢,二是 NixOS 官方的包缓存服务器在国内访问速度较慢。 - -为了解决这些问题,你可以使用国内的镜像源,或者使用代理工具来加速访问。 - -这里我先介绍几个比较简单的配置方法。 - -### 1. 包缓存服务器的加速访问 - -首先,在执行后面给出的任何 `nix` 相关命令时,你都可以通过 `--option` 选项来指定镜像源,例 -如: - -```bash -# 使用上海交通大学的镜像源 -# 官方文档: https://mirror.sjtu.edu.cn/docs/nix-channels/store -nixos-rebuild switch --option substituters "https://mirror.sjtu.edu.cn/nix-channels/store" - -# 使用中国科学技术大学的镜像源 -# 官方文档: https://mirrors.ustc.edu.cn/help/nix-channels.html -nixos-rebuild switch --option substituters "https://mirrors.ustc.edu.cn/nix-channels/store" - -# 使用清华大学的镜像源 -# 官方文档: https://mirrors.tuna.tsinghua.edu.cn/help/nix-channels/ -nixos-rebuild switch --option substituters "https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store" - -# 其他 nix 命令同样可以使用 --option 选项,例如 nix shell -nix shell nixpkgs#cowsay --option substituters "https://mirrors.tuna.tsinghua.edu.cn/nix-channels/store" -``` - -你可以自己测试下上述几个镜像源的速度,选速度最快的一个。 - -### 2. Channel/Flake 的加速访问 - -对于 Flake Inputs 跟 Channels 的加速访问,这个就需要使用代理工具加速访问。 - -可以通过如下命令设置代理环境变量,实现使用 socks5/http 代理加速 nix 的网络访问: - -```bash -sudo mkdir /run/systemd/system/nix-daemon.service.d/ -cat << EOF >/run/systemd/system/nix-daemon.service.d/override.conf -[Service] -Environment="https_proxy=socks5h://localhost:7891" -EOF -sudo systemctl daemon-reload -sudo systemctl restart nix-daemon -``` - -**但请注意,系统重启后 `/run/` 目录下的内容会被清空,所以每次重启后都需要重新执行上述命 -令**! - -更详细的说明与其他用法介绍,参见 -[添加自定义缓存服务器](../nixos-with-flakes/add-custom-cache-servers.md) 一节,注意这部分 -内容可能需要一定的 NixOS 使用经验才能理解。 - -> 注意:使用一些商用代理或公共代理时你可能会遇到 GitHub 下载时报 HTTP 403 错误 -> ([nixos-and-flakes-book/issues/74](https://github.com/ryan4yin/nixos-and-flakes-book/issues/74)), -> 可尝试通过更换代理服务器或者设置 -> [access-tokens](https://github.com/NixOS/nix/issues/6536) 来解决。 From d7fb878559beabc6cdedc972e7e235709257b707 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Tue, 26 Mar 2024 23:37:41 +0800 Subject: [PATCH 11/15] feat: download packages via a proxy --- .../add-custom-cache-servers.md | 37 +++++++------------ .../add-custom-cache-servers.md | 32 ++++++---------- 2 files changed, 25 insertions(+), 44 deletions(-) diff --git a/docs/nixos-with-flakes/add-custom-cache-servers.md b/docs/nixos-with-flakes/add-custom-cache-servers.md index 165e73d..0ceb6f4 100644 --- a/docs/nixos-with-flakes/add-custom-cache-servers.md +++ b/docs/nixos-with-flakes/add-custom-cache-servers.md @@ -302,29 +302,6 @@ running on their machine. Here's how to set it up. Using methods like actual work is done by a background process called `nix-daemon`, not by commands directly executed in the Terminal. -The implementation code of `nix-daemon` is located at -[nixpkgs/nixos/modules/services/system/nix-daemon.nix](https://github.com/NixOS/nixpkgs/blob/nixos-23.11/nixos/modules/services/system/nix-daemon.nix#L184-L191), -which sets environment variables through the `systemd.services.nix-daemon.environment` -option. We can also add proxy-related environment variables to the running environment of -`nix-daemon` in the same way, as shown in the following example Module: - -```nix -{ - systemd.services.nix-daemon.environment = { - # socks5h means that the hostname is resolved by the SOCKS server - https_proxy = "socks5h://localhost:7891"; - # https_proxy = "http://localhost:7890"; # or use http protocol instead of socks5 - }; -} -``` - -After deploying this configuration, you can check if the environment variables have been -set by running `sudo cat /proc/$(pidof nix-daemon)/environ | tr '\0' '\n'`. - -**However, be aware that when the proxy server is not available, nix-daemon will be unable -to access any cache servers!** Therefore, I still recommend using a transparent proxy to -address acceleration issues. - If you only need to use a proxy temporarily, you can set the proxy environment variables with the following commands: @@ -338,10 +315,24 @@ sudo systemctl daemon-reload sudo systemctl restart nix-daemon ``` +After deploying this configuration, you can check if the environment variables have been +set by running `sudo cat /proc/$(pidof nix-daemon)/environ | tr '\0' '\n'`. + The settings in `/run/systemd/system/nix-daemon.service.d/override.conf` will be automatically deleted when the system restarts, or you can manually delete it and restart the nix-daemon service to restore the original settings. +If you want to permanently set the proxy, it is recommended to save the above commands as +a shell script and run it each time the system starts. Alternatively, you can use a +transparent proxy or TUN and other global proxy solutions. + +> There are also people in the community who permanently set the proxy for nix-daemon in a +> declarative way using `systemd.services.nix-daemon.environment`. However, if the proxy +> encounters problems, it will be very troublesome. Nix-daemon will not work properly, and +> most Nix commands will not run correctly. Moreover, the configuration of systemd itself +> is set to read-only protection, making it difficult to modify or delete the proxy +> settings. So, it is not recommended to use this method. + > When using some commercial or public proxies, you might encounter HTTP 403 errors when > downloading from GitHub (as described in > [nixos-and-flakes-book/issues/74](https://github.com/ryan4yin/nixos-and-flakes-book/issues/74)). diff --git a/docs/zh/nixos-with-flakes/add-custom-cache-servers.md b/docs/zh/nixos-with-flakes/add-custom-cache-servers.md index 2a7c6b2..533bba7 100644 --- a/docs/zh/nixos-with-flakes/add-custom-cache-servers.md +++ b/docs/zh/nixos-with-flakes/add-custom-cache-servers.md @@ -278,27 +278,6 @@ Nix 提供了 直接在 Terminal 中使用 `export HTTPS_PROXY=http://127.0.0.1:7890` 这类方式是无法生效的,因 为 nix 实际干活的是一个叫 `nix-daemon` 的后台进程,而不是直接在 Terminal 中执行的命令。 -nix-daemon 的实现代码是 -[nixpkgs/nixos/modules/services/system/nix-daemon.nix](https://github.com/NixOS/nixpkgs/blob/nixos-23.11/nixos/modules/services/system/nix-daemon.nix#L184-L191), -它通过 `systemd.services.nix-daemon.environment` 选项设置了环境变量,我们也能通过同样的手 -段来往 nix-daemon 的运行环境中添加代理相关的环境变量,一个示例 Module 如下: - -```nix -{ - systemd.services.nix-daemon.environment = { - # socks5h mean that the hostname is resolved by the SOCKS server - https_proxy = "socks5h://localhost:7891"; - # https_proxy = "http://localhost:7890"; # or use http prctocol instead of socks5 - }; -} -``` - -部署此配置后,可通过 `sudo cat /proc/$(pidof nix-daemon)/environ | tr '\0' '\n'` 查看 -nix-daemon 进程的所有环境变量,确认环境变量的设置是否生效。 - -**但是要注意,当代理服务器不可用时,nix-daemon 将无法访问任何缓存服务器**!所以我还是更建 -议使用旁路网关等透明代理方案。 - 如果你只是临时需要使用代理,可以通过如下命令设置代理环境变量: ```bash @@ -311,9 +290,20 @@ sudo systemctl daemon-reload sudo systemctl restart nix-daemon ``` +部署此配置后,可通过 `sudo cat /proc/$(pidof nix-daemon)/environ | tr '\0' '\n'` 查看 +nix-daemon 进程的所有环境变量,确认环境变量的设置是否生效。 + 位于 `/run/systemd/system/nix-daemon.service.d/override.conf` 的设置会在系统重启后被自动删 除,或者你可以手动删除它并重启 nix-daemon 服务来恢复原始设置。 +如果你希望永久设置代理,建议将上述命令保存为 shell 脚本,在每次启动系统时运行一下。或者也 +可以使用旁路网关或 TUN 等全局代理方案。 + +> 社区也有人通过 `systemd.services.nix-daemon.environment` 以声明式的方式为 nix-daemon 永 +> 久设置代理,但这种做法下一旦代理出了问题会非常麻烦,nix-daemon 将无法正常工作,进而导致 +> 大多数 nix 命令无法正常运行,而且 systemd 自身的配置被设置了只读保护,无法简单地修改配置 +> 删除代理设置。因此不建议使用这种方式。 + > 使用一些商用代理或公共代理时你可能会遇到 GitHub 下载时报 HTTP 403 错误 > ([nixos-and-flakes-book/issues/74](https://github.com/ryan4yin/nixos-and-flakes-book/issues/74)), > 可尝试通过更换代理服务器或者设置 From c464ebb554ddb133716222dcecd7cfc7452f70ea Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Thu, 4 Apr 2024 22:06:14 +0800 Subject: [PATCH 12/15] feat: bump vitepress to 1.0.2 (#141) --- package.json | 2 +- pnpm-lock.yaml | 698 ++++++++++++++++++------------------------------- 2 files changed, 249 insertions(+), 451 deletions(-) diff --git a/package.json b/package.json index d6d867c..3a28c32 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "type": "module", "devDependencies": { - "vitepress": "1.0.0-rc.45", + "vitepress": "1.0.2", "vitepress-export-pdf": "1.0.0-beta.0" }, "scripts": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d8daec9..e524fab 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,179 +20,196 @@ dependencies: devDependencies: vitepress: - specifier: 1.0.0-rc.45 - version: 1.0.0-rc.45(@algolia/client-search@4.22.1)(search-insights@2.13.0) + specifier: 1.0.2 + version: 1.0.2(@algolia/client-search@4.23.2)(search-insights@2.13.0) vitepress-export-pdf: specifier: 1.0.0-beta.0 - version: 1.0.0-beta.0(esbuild@0.20.2)(vitepress@1.0.0-rc.45) + version: 1.0.0-beta.0(esbuild@0.20.2)(vitepress@1.0.2) packages: - /@algolia/autocomplete-core@1.9.3(@algolia/client-search@4.22.1)(algoliasearch@4.22.1)(search-insights@2.13.0): + /@algolia/autocomplete-core@1.9.3(@algolia/client-search@4.23.2)(algoliasearch@4.23.2)(search-insights@2.13.0): resolution: {integrity: sha512-009HdfugtGCdC4JdXUbVJClA0q0zh24yyePn+KUGk3rP7j8FEe/m5Yo/z65gn6nP/cM39PxpzqKrL7A6fP6PPw==} dependencies: - '@algolia/autocomplete-plugin-algolia-insights': 1.9.3(@algolia/client-search@4.22.1)(algoliasearch@4.22.1)(search-insights@2.13.0) - '@algolia/autocomplete-shared': 1.9.3(@algolia/client-search@4.22.1)(algoliasearch@4.22.1) + '@algolia/autocomplete-plugin-algolia-insights': 1.9.3(@algolia/client-search@4.23.2)(algoliasearch@4.23.2)(search-insights@2.13.0) + '@algolia/autocomplete-shared': 1.9.3(@algolia/client-search@4.23.2)(algoliasearch@4.23.2) transitivePeerDependencies: - '@algolia/client-search' - algoliasearch - search-insights dev: true - /@algolia/autocomplete-plugin-algolia-insights@1.9.3(@algolia/client-search@4.22.1)(algoliasearch@4.22.1)(search-insights@2.13.0): + /@algolia/autocomplete-plugin-algolia-insights@1.9.3(@algolia/client-search@4.23.2)(algoliasearch@4.23.2)(search-insights@2.13.0): resolution: {integrity: sha512-a/yTUkcO/Vyy+JffmAnTWbr4/90cLzw+CC3bRbhnULr/EM0fGNvM13oQQ14f2moLMcVDyAx/leczLlAOovhSZg==} peerDependencies: search-insights: '>= 1 < 3' dependencies: - '@algolia/autocomplete-shared': 1.9.3(@algolia/client-search@4.22.1)(algoliasearch@4.22.1) + '@algolia/autocomplete-shared': 1.9.3(@algolia/client-search@4.23.2)(algoliasearch@4.23.2) search-insights: 2.13.0 transitivePeerDependencies: - '@algolia/client-search' - algoliasearch dev: true - /@algolia/autocomplete-preset-algolia@1.9.3(@algolia/client-search@4.22.1)(algoliasearch@4.22.1): + /@algolia/autocomplete-preset-algolia@1.9.3(@algolia/client-search@4.23.2)(algoliasearch@4.23.2): resolution: {integrity: sha512-d4qlt6YmrLMYy95n5TB52wtNDr6EgAIPH81dvvvW8UmuWRgxEtY0NJiPwl/h95JtG2vmRM804M0DSwMCNZlzRA==} peerDependencies: '@algolia/client-search': '>= 4.9.1 < 6' algoliasearch: '>= 4.9.1 < 6' dependencies: - '@algolia/autocomplete-shared': 1.9.3(@algolia/client-search@4.22.1)(algoliasearch@4.22.1) - '@algolia/client-search': 4.22.1 - algoliasearch: 4.22.1 + '@algolia/autocomplete-shared': 1.9.3(@algolia/client-search@4.23.2)(algoliasearch@4.23.2) + '@algolia/client-search': 4.23.2 + algoliasearch: 4.23.2 dev: true - /@algolia/autocomplete-shared@1.9.3(@algolia/client-search@4.22.1)(algoliasearch@4.22.1): + /@algolia/autocomplete-shared@1.9.3(@algolia/client-search@4.23.2)(algoliasearch@4.23.2): resolution: {integrity: sha512-Wnm9E4Ye6Rl6sTTqjoymD+l8DjSTHsHboVRYrKgEt8Q7UHm9nYbqhN/i0fhUYA3OAEH7WA8x3jfpnmJm3rKvaQ==} peerDependencies: '@algolia/client-search': '>= 4.9.1 < 6' algoliasearch: '>= 4.9.1 < 6' dependencies: - '@algolia/client-search': 4.22.1 - algoliasearch: 4.22.1 + '@algolia/client-search': 4.23.2 + algoliasearch: 4.23.2 dev: true - /@algolia/cache-browser-local-storage@4.22.1: - resolution: {integrity: sha512-Sw6IAmOCvvP6QNgY9j+Hv09mvkvEIDKjYW8ow0UDDAxSXy664RBNQk3i/0nt7gvceOJ6jGmOTimaZoY1THmU7g==} + /@algolia/cache-browser-local-storage@4.23.2: + resolution: {integrity: sha512-PvRQdCmtiU22dw9ZcTJkrVKgNBVAxKgD0/cfiqyxhA5+PHzA2WDt6jOmZ9QASkeM2BpyzClJb/Wr1yt2/t78Kw==} dependencies: - '@algolia/cache-common': 4.22.1 + '@algolia/cache-common': 4.23.2 dev: true - /@algolia/cache-common@4.22.1: - resolution: {integrity: sha512-TJMBKqZNKYB9TptRRjSUtevJeQVXRmg6rk9qgFKWvOy8jhCPdyNZV1nB3SKGufzvTVbomAukFR8guu/8NRKBTA==} + /@algolia/cache-common@4.23.2: + resolution: {integrity: sha512-OUK/6mqr6CQWxzl/QY0/mwhlGvS6fMtvEPyn/7AHUx96NjqDA4X4+Ju7aXFQKh+m3jW9VPB0B9xvEQgyAnRPNw==} dev: true - /@algolia/cache-in-memory@4.22.1: - resolution: {integrity: sha512-ve+6Ac2LhwpufuWavM/aHjLoNz/Z/sYSgNIXsinGofWOysPilQZPUetqLj8vbvi+DHZZaYSEP9H5SRVXnpsNNw==} + /@algolia/cache-in-memory@4.23.2: + resolution: {integrity: sha512-rfbi/SnhEa3MmlqQvgYz/9NNJ156NkU6xFxjbxBtLWnHbpj+qnlMoKd+amoiacHRITpajg6zYbLM9dnaD3Bczw==} dependencies: - '@algolia/cache-common': 4.22.1 + '@algolia/cache-common': 4.23.2 dev: true - /@algolia/client-account@4.22.1: - resolution: {integrity: sha512-k8m+oegM2zlns/TwZyi4YgCtyToackkOpE+xCaKCYfBfDtdGOaVZCM5YvGPtK+HGaJMIN/DoTL8asbM3NzHonw==} + /@algolia/client-account@4.23.2: + resolution: {integrity: sha512-VbrOCLIN/5I7iIdskSoSw3uOUPF516k4SjDD4Qz3BFwa3of7D9A0lzBMAvQEJJEPHWdVraBJlGgdJq/ttmquJQ==} dependencies: - '@algolia/client-common': 4.22.1 - '@algolia/client-search': 4.22.1 - '@algolia/transporter': 4.22.1 + '@algolia/client-common': 4.23.2 + '@algolia/client-search': 4.23.2 + '@algolia/transporter': 4.23.2 dev: true - /@algolia/client-analytics@4.22.1: - resolution: {integrity: sha512-1ssi9pyxyQNN4a7Ji9R50nSdISIumMFDwKNuwZipB6TkauJ8J7ha/uO60sPJFqQyqvvI+px7RSNRQT3Zrvzieg==} + /@algolia/client-analytics@4.23.2: + resolution: {integrity: sha512-lLj7irsAztGhMoEx/SwKd1cwLY6Daf1Q5f2AOsZacpppSvuFvuBrmkzT7pap1OD/OePjLKxicJS8wNA0+zKtuw==} dependencies: - '@algolia/client-common': 4.22.1 - '@algolia/client-search': 4.22.1 - '@algolia/requester-common': 4.22.1 - '@algolia/transporter': 4.22.1 + '@algolia/client-common': 4.23.2 + '@algolia/client-search': 4.23.2 + '@algolia/requester-common': 4.23.2 + '@algolia/transporter': 4.23.2 dev: true - /@algolia/client-common@4.22.1: - resolution: {integrity: sha512-IvaL5v9mZtm4k4QHbBGDmU3wa/mKokmqNBqPj0K7lcR8ZDKzUorhcGp/u8PkPC/e0zoHSTvRh7TRkGX3Lm7iOQ==} + /@algolia/client-common@4.23.2: + resolution: {integrity: sha512-Q2K1FRJBern8kIfZ0EqPvUr3V29ICxCm/q42zInV+VJRjldAD9oTsMGwqUQ26GFMdFYmqkEfCbY4VGAiQhh22g==} dependencies: - '@algolia/requester-common': 4.22.1 - '@algolia/transporter': 4.22.1 + '@algolia/requester-common': 4.23.2 + '@algolia/transporter': 4.23.2 dev: true - /@algolia/client-personalization@4.22.1: - resolution: {integrity: sha512-sl+/klQJ93+4yaqZ7ezOttMQ/nczly/3GmgZXJ1xmoewP5jmdP/X/nV5U7EHHH3hCUEHeN7X1nsIhGPVt9E1cQ==} + /@algolia/client-personalization@4.23.2: + resolution: {integrity: sha512-vwPsgnCGhUcHhhQG5IM27z8q7dWrN9itjdvgA6uKf2e9r7vB+WXt4OocK0CeoYQt3OGEAExryzsB8DWqdMK5wg==} dependencies: - '@algolia/client-common': 4.22.1 - '@algolia/requester-common': 4.22.1 - '@algolia/transporter': 4.22.1 + '@algolia/client-common': 4.23.2 + '@algolia/requester-common': 4.23.2 + '@algolia/transporter': 4.23.2 dev: true - /@algolia/client-search@4.22.1: - resolution: {integrity: sha512-yb05NA4tNaOgx3+rOxAmFztgMTtGBi97X7PC3jyNeGiwkAjOZc2QrdZBYyIdcDLoI09N0gjtpClcackoTN0gPA==} + /@algolia/client-search@4.23.2: + resolution: {integrity: sha512-CxSB29OVGSE7l/iyoHvamMonzq7Ev8lnk/OkzleODZ1iBcCs3JC/XgTIKzN/4RSTrJ9QybsnlrN/bYCGufo7qw==} dependencies: - '@algolia/client-common': 4.22.1 - '@algolia/requester-common': 4.22.1 - '@algolia/transporter': 4.22.1 + '@algolia/client-common': 4.23.2 + '@algolia/requester-common': 4.23.2 + '@algolia/transporter': 4.23.2 dev: true - /@algolia/logger-common@4.22.1: - resolution: {integrity: sha512-OnTFymd2odHSO39r4DSWRFETkBufnY2iGUZNrMXpIhF5cmFE8pGoINNPzwg02QLBlGSaLqdKy0bM8S0GyqPLBg==} + /@algolia/logger-common@4.23.2: + resolution: {integrity: sha512-jGM49Q7626cXZ7qRAWXn0jDlzvoA1FvN4rKTi1g0hxKsTTSReyYk0i1ADWjChDPl3Q+nSDhJuosM2bBUAay7xw==} dev: true - /@algolia/logger-console@4.22.1: - resolution: {integrity: sha512-O99rcqpVPKN1RlpgD6H3khUWylU24OXlzkavUAMy6QZd1776QAcauE3oP8CmD43nbaTjBexZj2nGsBH9Tc0FVA==} + /@algolia/logger-console@4.23.2: + resolution: {integrity: sha512-oo+lnxxEmlhTBTFZ3fGz1O8PJ+G+8FiAoMY2Qo3Q4w23xocQev6KqDTA1JQAGPDxAewNA2VBwWOsVXeXFjrI/Q==} dependencies: - '@algolia/logger-common': 4.22.1 + '@algolia/logger-common': 4.23.2 dev: true - /@algolia/requester-browser-xhr@4.22.1: - resolution: {integrity: sha512-dtQGYIg6MteqT1Uay3J/0NDqD+UciHy3QgRbk7bNddOJu+p3hzjTRYESqEnoX/DpEkaNYdRHUKNylsqMpgwaEw==} + /@algolia/recommend@4.23.2: + resolution: {integrity: sha512-Q75CjnzRCDzgIlgWfPnkLtrfF4t82JCirhalXkSSwe/c1GH5pWh4xUyDOR3KTMo+YxxX3zTlrL/FjHmUJEWEcg==} dependencies: - '@algolia/requester-common': 4.22.1 + '@algolia/cache-browser-local-storage': 4.23.2 + '@algolia/cache-common': 4.23.2 + '@algolia/cache-in-memory': 4.23.2 + '@algolia/client-common': 4.23.2 + '@algolia/client-search': 4.23.2 + '@algolia/logger-common': 4.23.2 + '@algolia/logger-console': 4.23.2 + '@algolia/requester-browser-xhr': 4.23.2 + '@algolia/requester-common': 4.23.2 + '@algolia/requester-node-http': 4.23.2 + '@algolia/transporter': 4.23.2 dev: true - /@algolia/requester-common@4.22.1: - resolution: {integrity: sha512-dgvhSAtg2MJnR+BxrIFqlLtkLlVVhas9HgYKMk2Uxiy5m6/8HZBL40JVAMb2LovoPFs9I/EWIoFVjOrFwzn5Qg==} - dev: true - - /@algolia/requester-node-http@4.22.1: - resolution: {integrity: sha512-JfmZ3MVFQkAU+zug8H3s8rZ6h0ahHZL/SpMaSasTCGYR5EEJsCc8SI5UZ6raPN2tjxa5bxS13BRpGSBUens7EA==} + /@algolia/requester-browser-xhr@4.23.2: + resolution: {integrity: sha512-TO9wLlp8+rvW9LnIfyHsu8mNAMYrqNdQ0oLF6eTWFxXfxG3k8F/Bh7nFYGk2rFAYty4Fw4XUtrv/YjeNDtM5og==} dependencies: - '@algolia/requester-common': 4.22.1 + '@algolia/requester-common': 4.23.2 dev: true - /@algolia/transporter@4.22.1: - resolution: {integrity: sha512-kzWgc2c9IdxMa3YqA6TN0NW5VrKYYW/BELIn7vnLyn+U/RFdZ4lxxt9/8yq3DKV5snvoDzzO4ClyejZRdV3lMQ==} + /@algolia/requester-common@4.23.2: + resolution: {integrity: sha512-3EfpBS0Hri0lGDB5H/BocLt7Vkop0bTTLVUBB844HH6tVycwShmsV6bDR7yXbQvFP1uNpgePRD3cdBCjeHmk6Q==} + dev: true + + /@algolia/requester-node-http@4.23.2: + resolution: {integrity: sha512-SVzgkZM/malo+2SB0NWDXpnT7nO5IZwuDTaaH6SjLeOHcya1o56LSWXk+3F3rNLz2GVH+I/rpYKiqmHhSOjerw==} dependencies: - '@algolia/cache-common': 4.22.1 - '@algolia/logger-common': 4.22.1 - '@algolia/requester-common': 4.22.1 + '@algolia/requester-common': 4.23.2 + dev: true + + /@algolia/transporter@4.23.2: + resolution: {integrity: sha512-GY3aGKBy+8AK4vZh8sfkatDciDVKad5rTY2S10Aefyjh7e7UGBP4zigf42qVXwU8VOPwi7l/L7OACGMOFcjB0Q==} + dependencies: + '@algolia/cache-common': 4.23.2 + '@algolia/logger-common': 4.23.2 + '@algolia/requester-common': 4.23.2 dev: true /@antfu/utils@0.7.6: resolution: {integrity: sha512-pvFiLP2BeOKA/ZOS6jxx4XhKzdVLHDhGlFEaZ2flWWYf2xOqVniqpk38I04DFRyz+L0ASggl7SkItTc+ZLju4w==} dev: false - /@babel/code-frame@7.23.5: - resolution: {integrity: sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==} + /@babel/code-frame@7.24.2: + resolution: {integrity: sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/highlight': 7.23.4 - chalk: 2.4.2 + '@babel/highlight': 7.24.2 + picocolors: 1.0.0 dev: true - /@babel/helper-string-parser@7.23.4: - resolution: {integrity: sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==} + /@babel/helper-string-parser@7.24.1: + resolution: {integrity: sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ==} engines: {node: '>=6.9.0'} /@babel/helper-validator-identifier@7.22.20: resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} engines: {node: '>=6.9.0'} - /@babel/highlight@7.23.4: - resolution: {integrity: sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==} + /@babel/highlight@7.24.2: + resolution: {integrity: sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==} engines: {node: '>=6.9.0'} dependencies: '@babel/helper-validator-identifier': 7.22.20 chalk: 2.4.2 js-tokens: 4.0.0 + picocolors: 1.0.0 dev: true - /@babel/parser@7.24.0: - resolution: {integrity: sha512-QuP/FxEAzMSjXygs8v4N9dvdXzEHN4W1oF3PxuWAtPo08UdM17u89RDMgjLn/mlc56iM0HlLmVkO/wgR+rDgHg==} + /@babel/parser@7.24.4: + resolution: {integrity: sha512-zTvEBcghmeBma9QIGunWevvBAp4/Qu9Bdq+2k0Ot4fVMD6v3dsC9WOcRSKk7tRRyBM/53yKMJko9xOatGQAwSg==} engines: {node: '>=6.0.0'} hasBin: true dependencies: @@ -202,7 +219,7 @@ packages: resolution: {integrity: sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-string-parser': 7.23.4 + '@babel/helper-string-parser': 7.24.1 '@babel/helper-validator-identifier': 7.22.20 to-fast-properties: 2.0.0 @@ -244,11 +261,11 @@ packages: resolution: {integrity: sha512-+sbxb71sWre+PwDK7X2T8+bhS6clcVMLwBPznX45Qu6opJcgRjAp7gYSDzVFp187J+feSj5dNBN1mJoi6ckkUQ==} dev: true - /@docsearch/js@3.6.0(@algolia/client-search@4.22.1)(search-insights@2.13.0): + /@docsearch/js@3.6.0(@algolia/client-search@4.23.2)(search-insights@2.13.0): resolution: {integrity: sha512-QujhqINEElrkIfKwyyyTfbsfMAYCkylInLYMRqHy7PHc8xTBQCow73tlo/Kc7oIwBrCLf0P3YhjlOeV4v8hevQ==} dependencies: - '@docsearch/react': 3.6.0(@algolia/client-search@4.22.1)(search-insights@2.13.0) - preact: 10.19.6 + '@docsearch/react': 3.6.0(@algolia/client-search@4.23.2)(search-insights@2.13.0) + preact: 10.20.1 transitivePeerDependencies: - '@algolia/client-search' - '@types/react' @@ -257,7 +274,7 @@ packages: - search-insights dev: true - /@docsearch/react@3.6.0(@algolia/client-search@4.22.1)(search-insights@2.13.0): + /@docsearch/react@3.6.0(@algolia/client-search@4.23.2)(search-insights@2.13.0): resolution: {integrity: sha512-HUFut4ztcVNmqy9gp/wxNbC7pTOHhgVVkHVGCACTuLhUKUhKAF9KYHJtMiLUJxEqiFLQiuri1fWF8zqwM/cu1w==} peerDependencies: '@types/react': '>= 16.8.0 < 19.0.0' @@ -274,24 +291,15 @@ packages: search-insights: optional: true dependencies: - '@algolia/autocomplete-core': 1.9.3(@algolia/client-search@4.22.1)(algoliasearch@4.22.1)(search-insights@2.13.0) - '@algolia/autocomplete-preset-algolia': 1.9.3(@algolia/client-search@4.22.1)(algoliasearch@4.22.1) + '@algolia/autocomplete-core': 1.9.3(@algolia/client-search@4.23.2)(algoliasearch@4.23.2)(search-insights@2.13.0) + '@algolia/autocomplete-preset-algolia': 1.9.3(@algolia/client-search@4.23.2)(algoliasearch@4.23.2) '@docsearch/css': 3.6.0 - algoliasearch: 4.22.1 + algoliasearch: 4.23.2 search-insights: 2.13.0 transitivePeerDependencies: - '@algolia/client-search' dev: true - /@esbuild/aix-ppc64@0.19.12: - resolution: {integrity: sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [aix] - requiresBuild: true - dev: true - optional: true - /@esbuild/aix-ppc64@0.20.2: resolution: {integrity: sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==} engines: {node: '>=12'} @@ -301,15 +309,6 @@ packages: dev: true optional: true - /@esbuild/android-arm64@0.19.12: - resolution: {integrity: sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==} - engines: {node: '>=12'} - cpu: [arm64] - os: [android] - requiresBuild: true - dev: true - optional: true - /@esbuild/android-arm64@0.20.2: resolution: {integrity: sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==} engines: {node: '>=12'} @@ -319,15 +318,6 @@ packages: dev: true optional: true - /@esbuild/android-arm@0.19.12: - resolution: {integrity: sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==} - engines: {node: '>=12'} - cpu: [arm] - os: [android] - requiresBuild: true - dev: true - optional: true - /@esbuild/android-arm@0.20.2: resolution: {integrity: sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==} engines: {node: '>=12'} @@ -337,15 +327,6 @@ packages: dev: true optional: true - /@esbuild/android-x64@0.19.12: - resolution: {integrity: sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==} - engines: {node: '>=12'} - cpu: [x64] - os: [android] - requiresBuild: true - dev: true - optional: true - /@esbuild/android-x64@0.20.2: resolution: {integrity: sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==} engines: {node: '>=12'} @@ -355,15 +336,6 @@ packages: dev: true optional: true - /@esbuild/darwin-arm64@0.19.12: - resolution: {integrity: sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==} - engines: {node: '>=12'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - /@esbuild/darwin-arm64@0.20.2: resolution: {integrity: sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==} engines: {node: '>=12'} @@ -373,15 +345,6 @@ packages: dev: true optional: true - /@esbuild/darwin-x64@0.19.12: - resolution: {integrity: sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==} - engines: {node: '>=12'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - /@esbuild/darwin-x64@0.20.2: resolution: {integrity: sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==} engines: {node: '>=12'} @@ -391,15 +354,6 @@ packages: dev: true optional: true - /@esbuild/freebsd-arm64@0.19.12: - resolution: {integrity: sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==} - engines: {node: '>=12'} - cpu: [arm64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - /@esbuild/freebsd-arm64@0.20.2: resolution: {integrity: sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==} engines: {node: '>=12'} @@ -409,15 +363,6 @@ packages: dev: true optional: true - /@esbuild/freebsd-x64@0.19.12: - resolution: {integrity: sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==} - engines: {node: '>=12'} - cpu: [x64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - /@esbuild/freebsd-x64@0.20.2: resolution: {integrity: sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==} engines: {node: '>=12'} @@ -427,15 +372,6 @@ packages: dev: true optional: true - /@esbuild/linux-arm64@0.19.12: - resolution: {integrity: sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==} - engines: {node: '>=12'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-arm64@0.20.2: resolution: {integrity: sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==} engines: {node: '>=12'} @@ -445,15 +381,6 @@ packages: dev: true optional: true - /@esbuild/linux-arm@0.19.12: - resolution: {integrity: sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==} - engines: {node: '>=12'} - cpu: [arm] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-arm@0.20.2: resolution: {integrity: sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==} engines: {node: '>=12'} @@ -463,15 +390,6 @@ packages: dev: true optional: true - /@esbuild/linux-ia32@0.19.12: - resolution: {integrity: sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==} - engines: {node: '>=12'} - cpu: [ia32] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-ia32@0.20.2: resolution: {integrity: sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==} engines: {node: '>=12'} @@ -481,15 +399,6 @@ packages: dev: true optional: true - /@esbuild/linux-loong64@0.19.12: - resolution: {integrity: sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==} - engines: {node: '>=12'} - cpu: [loong64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-loong64@0.20.2: resolution: {integrity: sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==} engines: {node: '>=12'} @@ -499,15 +408,6 @@ packages: dev: true optional: true - /@esbuild/linux-mips64el@0.19.12: - resolution: {integrity: sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==} - engines: {node: '>=12'} - cpu: [mips64el] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-mips64el@0.20.2: resolution: {integrity: sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==} engines: {node: '>=12'} @@ -517,15 +417,6 @@ packages: dev: true optional: true - /@esbuild/linux-ppc64@0.19.12: - resolution: {integrity: sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-ppc64@0.20.2: resolution: {integrity: sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==} engines: {node: '>=12'} @@ -535,15 +426,6 @@ packages: dev: true optional: true - /@esbuild/linux-riscv64@0.19.12: - resolution: {integrity: sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==} - engines: {node: '>=12'} - cpu: [riscv64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-riscv64@0.20.2: resolution: {integrity: sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==} engines: {node: '>=12'} @@ -553,15 +435,6 @@ packages: dev: true optional: true - /@esbuild/linux-s390x@0.19.12: - resolution: {integrity: sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==} - engines: {node: '>=12'} - cpu: [s390x] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-s390x@0.20.2: resolution: {integrity: sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==} engines: {node: '>=12'} @@ -571,15 +444,6 @@ packages: dev: true optional: true - /@esbuild/linux-x64@0.19.12: - resolution: {integrity: sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==} - engines: {node: '>=12'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /@esbuild/linux-x64@0.20.2: resolution: {integrity: sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==} engines: {node: '>=12'} @@ -589,15 +453,6 @@ packages: dev: true optional: true - /@esbuild/netbsd-x64@0.19.12: - resolution: {integrity: sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==} - engines: {node: '>=12'} - cpu: [x64] - os: [netbsd] - requiresBuild: true - dev: true - optional: true - /@esbuild/netbsd-x64@0.20.2: resolution: {integrity: sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==} engines: {node: '>=12'} @@ -607,15 +462,6 @@ packages: dev: true optional: true - /@esbuild/openbsd-x64@0.19.12: - resolution: {integrity: sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==} - engines: {node: '>=12'} - cpu: [x64] - os: [openbsd] - requiresBuild: true - dev: true - optional: true - /@esbuild/openbsd-x64@0.20.2: resolution: {integrity: sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==} engines: {node: '>=12'} @@ -625,15 +471,6 @@ packages: dev: true optional: true - /@esbuild/sunos-x64@0.19.12: - resolution: {integrity: sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==} - engines: {node: '>=12'} - cpu: [x64] - os: [sunos] - requiresBuild: true - dev: true - optional: true - /@esbuild/sunos-x64@0.20.2: resolution: {integrity: sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==} engines: {node: '>=12'} @@ -643,15 +480,6 @@ packages: dev: true optional: true - /@esbuild/win32-arm64@0.19.12: - resolution: {integrity: sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==} - engines: {node: '>=12'} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@esbuild/win32-arm64@0.20.2: resolution: {integrity: sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==} engines: {node: '>=12'} @@ -661,15 +489,6 @@ packages: dev: true optional: true - /@esbuild/win32-ia32@0.19.12: - resolution: {integrity: sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==} - engines: {node: '>=12'} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@esbuild/win32-ia32@0.20.2: resolution: {integrity: sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==} engines: {node: '>=12'} @@ -679,15 +498,6 @@ packages: dev: true optional: true - /@esbuild/win32-x64@0.19.12: - resolution: {integrity: sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==} - engines: {node: '>=12'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@esbuild/win32-x64@0.20.2: resolution: {integrity: sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==} engines: {node: '>=12'} @@ -771,118 +581,134 @@ packages: unicode-trie: 0.3.1 dev: true - /@rollup/rollup-android-arm-eabi@4.13.0: - resolution: {integrity: sha512-5ZYPOuaAqEH/W3gYsRkxQATBW3Ii1MfaT4EQstTnLKViLi2gLSQmlmtTpGucNP3sXEpOiI5tdGhjdE111ekyEg==} + /@rollup/rollup-android-arm-eabi@4.14.0: + resolution: {integrity: sha512-jwXtxYbRt1V+CdQSy6Z+uZti7JF5irRKF8hlKfEnF/xJpcNGuuiZMBvuoYM+x9sr9iWGnzrlM0+9hvQ1kgkf1w==} cpu: [arm] os: [android] requiresBuild: true dev: true optional: true - /@rollup/rollup-android-arm64@4.13.0: - resolution: {integrity: sha512-BSbaCmn8ZadK3UAQdlauSvtaJjhlDEjS5hEVVIN3A4bbl3X+otyf/kOJV08bYiRxfejP3DXFzO2jz3G20107+Q==} + /@rollup/rollup-android-arm64@4.14.0: + resolution: {integrity: sha512-fI9nduZhCccjzlsA/OuAwtFGWocxA4gqXGTLvOyiF8d+8o0fZUeSztixkYjcGq1fGZY3Tkq4yRvHPFxU+jdZ9Q==} cpu: [arm64] os: [android] requiresBuild: true dev: true optional: true - /@rollup/rollup-darwin-arm64@4.13.0: - resolution: {integrity: sha512-Ovf2evVaP6sW5Ut0GHyUSOqA6tVKfrTHddtmxGQc1CTQa1Cw3/KMCDEEICZBbyppcwnhMwcDce9ZRxdWRpVd6g==} + /@rollup/rollup-darwin-arm64@4.14.0: + resolution: {integrity: sha512-BcnSPRM76/cD2gQC+rQNGBN6GStBs2pl/FpweW8JYuz5J/IEa0Fr4AtrPv766DB/6b2MZ/AfSIOSGw3nEIP8SA==} cpu: [arm64] os: [darwin] requiresBuild: true dev: true optional: true - /@rollup/rollup-darwin-x64@4.13.0: - resolution: {integrity: sha512-U+Jcxm89UTK592vZ2J9st9ajRv/hrwHdnvyuJpa5A2ngGSVHypigidkQJP+YiGL6JODiUeMzkqQzbCG3At81Gg==} + /@rollup/rollup-darwin-x64@4.14.0: + resolution: {integrity: sha512-LDyFB9GRolGN7XI6955aFeI3wCdCUszFWumWU0deHA8VpR3nWRrjG6GtGjBrQxQKFevnUTHKCfPR4IvrW3kCgQ==} cpu: [x64] os: [darwin] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm-gnueabihf@4.13.0: - resolution: {integrity: sha512-8wZidaUJUTIR5T4vRS22VkSMOVooG0F4N+JSwQXWSRiC6yfEsFMLTYRFHvby5mFFuExHa/yAp9juSphQQJAijQ==} + /@rollup/rollup-linux-arm-gnueabihf@4.14.0: + resolution: {integrity: sha512-ygrGVhQP47mRh0AAD0zl6QqCbNsf0eTo+vgwkY6LunBcg0f2Jv365GXlDUECIyoXp1kKwL5WW6rsO429DBY/bA==} cpu: [arm] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm64-gnu@4.13.0: - resolution: {integrity: sha512-Iu0Kno1vrD7zHQDxOmvweqLkAzjxEVqNhUIXBsZ8hu8Oak7/5VTPrxOEZXYC1nmrBVJp0ZcL2E7lSuuOVaE3+w==} + /@rollup/rollup-linux-arm64-gnu@4.14.0: + resolution: {integrity: sha512-x+uJ6MAYRlHGe9wi4HQjxpaKHPM3d3JjqqCkeC5gpnnI6OWovLdXTpfa8trjxPLnWKyBsSi5kne+146GAxFt4A==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm64-musl@4.13.0: - resolution: {integrity: sha512-C31QrW47llgVyrRjIwiOwsHFcaIwmkKi3PCroQY5aVq4H0A5v/vVVAtFsI1nfBngtoRpeREvZOkIhmRwUKkAdw==} + /@rollup/rollup-linux-arm64-musl@4.14.0: + resolution: {integrity: sha512-nrRw8ZTQKg6+Lttwqo6a2VxR9tOroa2m91XbdQ2sUUzHoedXlsyvY1fN4xWdqz8PKmf4orDwejxXHjh7YBGUCA==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-riscv64-gnu@4.13.0: - resolution: {integrity: sha512-Oq90dtMHvthFOPMl7pt7KmxzX7E71AfyIhh+cPhLY9oko97Zf2C9tt/XJD4RgxhaGeAraAXDtqxvKE1y/j35lA==} + /@rollup/rollup-linux-powerpc64le-gnu@4.14.0: + resolution: {integrity: sha512-xV0d5jDb4aFu84XKr+lcUJ9y3qpIWhttO3Qev97z8DKLXR62LC3cXT/bMZXrjLF9X+P5oSmJTzAhqwUbY96PnA==} + cpu: [ppc64le] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-riscv64-gnu@4.14.0: + resolution: {integrity: sha512-SDDhBQwZX6LPRoPYjAZWyL27LbcBo7WdBFWJi5PI9RPCzU8ijzkQn7tt8NXiXRiFMJCVpkuMkBf4OxSxVMizAw==} cpu: [riscv64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-x64-gnu@4.13.0: - resolution: {integrity: sha512-yUD/8wMffnTKuiIsl6xU+4IA8UNhQ/f1sAnQebmE/lyQ8abjsVyDkyRkWop0kdMhKMprpNIhPmYlCxgHrPoXoA==} + /@rollup/rollup-linux-s390x-gnu@4.14.0: + resolution: {integrity: sha512-RxB/qez8zIDshNJDufYlTT0ZTVut5eCpAZ3bdXDU9yTxBzui3KhbGjROK2OYTTor7alM7XBhssgoO3CZ0XD3qA==} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-x64-gnu@4.14.0: + resolution: {integrity: sha512-C6y6z2eCNCfhZxT9u+jAM2Fup89ZjiG5pIzZIDycs1IwESviLxwkQcFRGLjnDrP+PT+v5i4YFvlcfAs+LnreXg==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-x64-musl@4.13.0: - resolution: {integrity: sha512-9RyNqoFNdF0vu/qqX63fKotBh43fJQeYC98hCaf89DYQpv+xu0D8QFSOS0biA7cGuqJFOc1bJ+m2rhhsKcw1hw==} + /@rollup/rollup-linux-x64-musl@4.14.0: + resolution: {integrity: sha512-i0QwbHYfnOMYsBEyjxcwGu5SMIi9sImDVjDg087hpzXqhBSosxkE7gyIYFHgfFl4mr7RrXksIBZ4DoLoP4FhJg==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-arm64-msvc@4.13.0: - resolution: {integrity: sha512-46ue8ymtm/5PUU6pCvjlic0z82qWkxv54GTJZgHrQUuZnVH+tvvSP0LsozIDsCBFO4VjJ13N68wqrKSeScUKdA==} + /@rollup/rollup-win32-arm64-msvc@4.14.0: + resolution: {integrity: sha512-Fq52EYb0riNHLBTAcL0cun+rRwyZ10S9vKzhGKKgeD+XbwunszSY0rVMco5KbOsTlwovP2rTOkiII/fQ4ih/zQ==} cpu: [arm64] os: [win32] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-ia32-msvc@4.13.0: - resolution: {integrity: sha512-P5/MqLdLSlqxbeuJ3YDeX37srC8mCflSyTrUsgbU1c/U9j6l2g2GiIdYaGD9QjdMQPMSgYm7hgg0551wHyIluw==} + /@rollup/rollup-win32-ia32-msvc@4.14.0: + resolution: {integrity: sha512-e/PBHxPdJ00O9p5Ui43+vixSgVf4NlLsmV6QneGERJ3lnjIua/kim6PRFe3iDueT1rQcgSkYP8ZBBXa/h4iPvw==} cpu: [ia32] os: [win32] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-x64-msvc@4.13.0: - resolution: {integrity: sha512-UKXUQNbO3DOhzLRwHSpa0HnhhCgNODvfoPWv2FCXme8N/ANFfhIPMGuOT+QuKd16+B5yxZ0HdpNlqPvTMS1qfw==} + /@rollup/rollup-win32-x64-msvc@4.14.0: + resolution: {integrity: sha512-aGg7iToJjdklmxlUlJh/PaPNa4PmqHfyRMLunbL3eaMO0gp656+q1zOKkpJ/CVe9CryJv6tAN1HDoR8cNGzkag==} cpu: [x64] os: [win32] requiresBuild: true dev: true optional: true - /@shikijs/core@1.2.0: - resolution: {integrity: sha512-OlFvx+nyr5C8zpcMBnSGir0YPD6K11uYhouqhNmm1qLiis4GA7SsGtu07r9gKS9omks8RtQqHrJL4S+lqWK01A==} + /@shikijs/core@1.2.4: + resolution: {integrity: sha512-ClaUWpt8oTzjcF0MM1P81AeWyzc1sNSJlAjMG80CbwqbFqXSNz+NpQVUC0icobt3sZn43Sn27M4pHD/Jmp3zHw==} dev: true - /@shikijs/transformers@1.2.0: - resolution: {integrity: sha512-xKn7DtA65DQV4FOfYsrvqM80xOy2xuXnxWWKsZmHv1VII/IOuDUDsWDu3KnpeLH6wqNJWp1GRoNUsHR1aw/VhQ==} + /@shikijs/transformers@1.2.4: + resolution: {integrity: sha512-ysGkpsHxRxLmz8nGKeFdV+gKj1NXt+88sM/34kfKVWTWIXg5gsFOJxJBbG7k+fUR5JlD6sNh65W9qPXrbVE1wQ==} dependencies: - shiki: 1.2.0 + shiki: 1.2.4 dev: true /@tootallnate/quickjs-emscripten@0.23.0: @@ -916,8 +742,8 @@ packages: resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==} dev: false - /@types/node@20.11.28: - resolution: {integrity: sha512-M/GPWVS2wLkSkNHVeLkrF2fD5Lx5UC4PxA0uZcKc6QqbIQUJyW1jVjueJYi1z8n0I5PxYrtpnPnWglE+y9A0KA==} + /@types/node@20.12.4: + resolution: {integrity: sha512-E+Fa9z3wSQpzgYQdYmme5X3OTuejnnTx88A6p6vkkJosR3KBz+HpE3kqNm98VE6cfLFcISx7zW7MsJkH6KwbTw==} requiresBuild: true dependencies: undici-types: 5.26.5 @@ -942,29 +768,29 @@ packages: resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} requiresBuild: true dependencies: - '@types/node': 20.11.28 + '@types/node': 20.12.4 dev: true optional: true - /@vitejs/plugin-vue@5.0.4(vite@5.1.6)(vue@3.4.21): + /@vitejs/plugin-vue@5.0.4(vite@5.2.8)(vue@3.4.21): resolution: {integrity: sha512-WS3hevEszI6CEVEx28F8RjTX97k3KsrcY6kvTg7+Whm5y3oYvcqzVeGCU3hxSAn4uY2CLCkeokkGKpoctccilQ==} engines: {node: ^18.0.0 || >=20.0.0} peerDependencies: vite: ^5.0.0 vue: ^3.2.25 dependencies: - vite: 5.1.6 + vite: 5.2.8 vue: 3.4.21 dev: true /@vue/compiler-core@3.4.21: resolution: {integrity: sha512-MjXawxZf2SbZszLPYxaFCjxfibYrzr3eYbKxwpLR9EQN+oaziSu3qKVbwBERj1IFIB8OLUewxB5m/BFzi613og==} dependencies: - '@babel/parser': 7.24.0 + '@babel/parser': 7.24.4 '@vue/shared': 3.4.21 entities: 4.5.0 estree-walker: 2.0.2 - source-map-js: 1.0.2 + source-map-js: 1.2.0 /@vue/compiler-dom@3.4.21: resolution: {integrity: sha512-IZC6FKowtT1sl0CR5DpXSiEB5ayw75oT2bma1BEhV7RRR1+cfwLrxc2Z8Zq/RGFzJ8w5r9QtCOvTjQgdn0IKmA==} @@ -975,15 +801,15 @@ packages: /@vue/compiler-sfc@3.4.21: resolution: {integrity: sha512-me7epoTxYlY+2CUM7hy9PCDdpMPfIwrOvAXud2Upk10g4YLv9UBW7kL798TvMeDhPthkZ0CONNrK2GoeI1ODiQ==} dependencies: - '@babel/parser': 7.24.0 + '@babel/parser': 7.24.4 '@vue/compiler-core': 3.4.21 '@vue/compiler-dom': 3.4.21 '@vue/compiler-ssr': 3.4.21 '@vue/shared': 3.4.21 estree-walker: 2.0.2 - magic-string: 0.30.8 - postcss: 8.4.35 - source-map-js: 1.0.2 + magic-string: 0.30.9 + postcss: 8.4.38 + source-map-js: 1.2.0 /@vue/compiler-ssr@3.4.21: resolution: {integrity: sha512-M5+9nI2lPpAsgXOGQobnIueVqc9sisBFexh5yMIMRAPYLa7+5wEJs8iqOZc1WAa9WQbx9GR2twgznU8LTIiZ4Q==} @@ -991,20 +817,20 @@ packages: '@vue/compiler-dom': 3.4.21 '@vue/shared': 3.4.21 - /@vue/devtools-api@7.0.17(vue@3.4.21): - resolution: {integrity: sha512-UWU9tqzUBv+ttUxYLaQcL5IxSSdF+i6yheFiEtz7mh88YZUYkxpEmT43iKBs3YsC54ROwPD2iZIndnju6PWfOQ==} + /@vue/devtools-api@7.0.25(vue@3.4.21): + resolution: {integrity: sha512-fL6DlRp4MSXCLYcqYvKU7QhQZWE3Hfu7X8pC25BS74coJi7uJeSWs4tmrITcwFihNmC9S5GPiffkMdckkeWjzg==} dependencies: - '@vue/devtools-kit': 7.0.17(vue@3.4.21) + '@vue/devtools-kit': 7.0.25(vue@3.4.21) transitivePeerDependencies: - vue dev: true - /@vue/devtools-kit@7.0.17(vue@3.4.21): - resolution: {integrity: sha512-znPLSOoTP3RnR9fvkq5M+nnpEA+WocybzOo5ID73vYkE0/n0VcfU8Ld0j4AHQjV/omTdAzh6QLpPlUYdIHXg+w==} + /@vue/devtools-kit@7.0.25(vue@3.4.21): + resolution: {integrity: sha512-wbLkSnOTsKHPb1mB9koFHUoSAF8Dp6Ii/ocR2+DeXFY4oKqIjCeJb/4Lihk4rgqEhCy1WwxLfTgNDo83VvDYkQ==} peerDependencies: vue: ^3.0.0 dependencies: - '@vue/devtools-shared': 7.0.17 + '@vue/devtools-shared': 7.0.25 hookable: 5.5.3 mitt: 3.0.1 perfect-debounce: 1.0.0 @@ -1012,8 +838,8 @@ packages: vue: 3.4.21 dev: true - /@vue/devtools-shared@7.0.17: - resolution: {integrity: sha512-QNg2TMQBFFffRbTKE9NjytXBywGR77p2UMi/gJ0ow58S+1jkAvL8ikU/JnSs9ePvsVtspHX32m2cdfe4DJ4ygw==} + /@vue/devtools-shared@7.0.25: + resolution: {integrity: sha512-5+XYhcHSXuJSguYnNwL6/e6VTmXwCfryWQOkffh9ZU2zMByybqqqBrMWqvBkqTmMFCjPdzulo66xXbVbwLaElQ==} dependencies: rfdc: 1.3.1 dev: true @@ -1123,8 +949,8 @@ packages: - vue dev: true - /agent-base@7.1.0: - resolution: {integrity: sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==} + /agent-base@7.1.1: + resolution: {integrity: sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==} engines: {node: '>= 14'} dependencies: debug: 4.3.4 @@ -1132,23 +958,24 @@ packages: - supports-color dev: true - /algoliasearch@4.22.1: - resolution: {integrity: sha512-jwydKFQJKIx9kIZ8Jm44SdpigFwRGPESaxZBaHSV0XWN2yBJAOT4mT7ppvlrpA4UGzz92pqFnVKr/kaZXrcreg==} + /algoliasearch@4.23.2: + resolution: {integrity: sha512-8aCl055IsokLuPU8BzLjwzXjb7ty9TPcUFFOk0pYOwsE5DMVhE3kwCMFtsCFKcnoPZK7oObm+H5mbnSO/9ioxQ==} dependencies: - '@algolia/cache-browser-local-storage': 4.22.1 - '@algolia/cache-common': 4.22.1 - '@algolia/cache-in-memory': 4.22.1 - '@algolia/client-account': 4.22.1 - '@algolia/client-analytics': 4.22.1 - '@algolia/client-common': 4.22.1 - '@algolia/client-personalization': 4.22.1 - '@algolia/client-search': 4.22.1 - '@algolia/logger-common': 4.22.1 - '@algolia/logger-console': 4.22.1 - '@algolia/requester-browser-xhr': 4.22.1 - '@algolia/requester-common': 4.22.1 - '@algolia/requester-node-http': 4.22.1 - '@algolia/transporter': 4.22.1 + '@algolia/cache-browser-local-storage': 4.23.2 + '@algolia/cache-common': 4.23.2 + '@algolia/cache-in-memory': 4.23.2 + '@algolia/client-account': 4.23.2 + '@algolia/client-analytics': 4.23.2 + '@algolia/client-common': 4.23.2 + '@algolia/client-personalization': 4.23.2 + '@algolia/client-search': 4.23.2 + '@algolia/logger-common': 4.23.2 + '@algolia/logger-console': 4.23.2 + '@algolia/recommend': 4.23.2 + '@algolia/requester-browser-xhr': 4.23.2 + '@algolia/requester-common': 4.23.2 + '@algolia/requester-node-http': 4.23.2 + '@algolia/transporter': 4.23.2 dev: true /ansi-regex@5.0.1: @@ -1208,8 +1035,8 @@ packages: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} dev: true - /bare-events@2.2.1: - resolution: {integrity: sha512-9GYPpsPFvrWBkelIhOhTWtkeZxVxZOdb3VnFTCzlOo3OjvmTvzLoZFUT8kNFACx0vJej6QPney1Cf9BvzCNE/A==} + /bare-events@2.2.2: + resolution: {integrity: sha512-h7z00dWdG0PYOQEvChhOSWvOfkIKsdZGkWr083FgN/HyoQuebSew/cgirYqh9SCuy/hRvxc5Vy6Fw8xAmYHLkQ==} requiresBuild: true dev: true optional: true @@ -1466,37 +1293,6 @@ packages: is-arrayish: 0.2.1 dev: true - /esbuild@0.19.12: - resolution: {integrity: sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==} - engines: {node: '>=12'} - hasBin: true - requiresBuild: true - optionalDependencies: - '@esbuild/aix-ppc64': 0.19.12 - '@esbuild/android-arm': 0.19.12 - '@esbuild/android-arm64': 0.19.12 - '@esbuild/android-x64': 0.19.12 - '@esbuild/darwin-arm64': 0.19.12 - '@esbuild/darwin-x64': 0.19.12 - '@esbuild/freebsd-arm64': 0.19.12 - '@esbuild/freebsd-x64': 0.19.12 - '@esbuild/linux-arm': 0.19.12 - '@esbuild/linux-arm64': 0.19.12 - '@esbuild/linux-ia32': 0.19.12 - '@esbuild/linux-loong64': 0.19.12 - '@esbuild/linux-mips64el': 0.19.12 - '@esbuild/linux-ppc64': 0.19.12 - '@esbuild/linux-riscv64': 0.19.12 - '@esbuild/linux-s390x': 0.19.12 - '@esbuild/linux-x64': 0.19.12 - '@esbuild/netbsd-x64': 0.19.12 - '@esbuild/openbsd-x64': 0.19.12 - '@esbuild/sunos-x64': 0.19.12 - '@esbuild/win32-arm64': 0.19.12 - '@esbuild/win32-ia32': 0.19.12 - '@esbuild/win32-x64': 0.19.12 - dev: true - /esbuild@0.20.2: resolution: {integrity: sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==} engines: {node: '>=12'} @@ -1734,7 +1530,7 @@ packages: resolution: {integrity: sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==} engines: {node: '>= 14'} dependencies: - agent-base: 7.1.0 + agent-base: 7.1.1 debug: 4.3.4 transitivePeerDependencies: - supports-color @@ -1744,7 +1540,7 @@ packages: resolution: {integrity: sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==} engines: {node: '>= 14'} dependencies: - agent-base: 7.1.0 + agent-base: 7.1.1 debug: 4.3.4 transitivePeerDependencies: - supports-color @@ -1885,8 +1681,8 @@ packages: engines: {node: '>=12'} dev: true - /magic-string@0.30.8: - resolution: {integrity: sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==} + /magic-string@0.30.9: + resolution: {integrity: sha512-S1+hd+dIrC8EZqKyT9DstTH/0Z+f76kmmvZnkfQVmOpDEF9iVgdYif3Q/pIWHmCoo59bQVGW0kVL3e2nl+9+Sw==} engines: {node: '>=12'} dependencies: '@jridgewell/sourcemap-codec': 1.4.15 @@ -2017,13 +1813,13 @@ packages: engines: {node: '>= 14'} dependencies: '@tootallnate/quickjs-emscripten': 0.23.0 - agent-base: 7.1.0 + agent-base: 7.1.1 debug: 4.3.4 get-uri: 6.0.3 http-proxy-agent: 7.0.2 https-proxy-agent: 7.0.4 pac-resolver: 7.0.1 - socks-proxy-agent: 8.0.2 + socks-proxy-agent: 8.0.3 transitivePeerDependencies: - supports-color dev: true @@ -2059,7 +1855,7 @@ packages: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} dependencies: - '@babel/code-frame': 7.23.5 + '@babel/code-frame': 7.24.2 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 @@ -2101,16 +1897,16 @@ packages: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} - /postcss@8.4.35: - resolution: {integrity: sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==} + /postcss@8.4.38: + resolution: {integrity: sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==} engines: {node: ^10 || ^12 || >=14} dependencies: nanoid: 3.3.7 picocolors: 1.0.0 - source-map-js: 1.0.2 + source-map-js: 1.2.0 - /preact@10.19.6: - resolution: {integrity: sha512-gympg+T2Z1fG1unB8NH29yHJwnEaCH37Z32diPDku316OTnRPeMbiRV9kTrfZpocXjdfnWuFUl/Mj4BHaf6gnw==} + /preact@10.20.1: + resolution: {integrity: sha512-JIFjgFg9B2qnOoGiYMVBtrcFxHqn+dNXbq76bVmcaHYJFYR4lW67AOcXgAYQQTDYXDOg/kTZrKPNCdRgJ2UJmw==} dev: true /progress@2.0.3: @@ -2122,14 +1918,14 @@ packages: resolution: {integrity: sha512-Rb5RVBy1iyqOtNl15Cw/llpeLH8bsb37gM1FUfKQ+Wck6xHlbAhWGUFiTRHtkjqGTA5pSHz6+0hrPW/oECihPQ==} engines: {node: '>= 14'} dependencies: - agent-base: 7.1.0 + agent-base: 7.1.1 debug: 4.3.4 http-proxy-agent: 7.0.2 https-proxy-agent: 7.0.4 lru-cache: 7.18.3 pac-proxy-agent: 7.0.1 proxy-from-env: 1.1.0 - socks-proxy-agent: 8.0.2 + socks-proxy-agent: 8.0.3 transitivePeerDependencies: - supports-color dev: true @@ -2221,26 +2017,28 @@ packages: resolution: {integrity: sha512-r5a3l5HzYlIC68TpmYKlxWjmOP6wiPJ1vWv2HeLhNsRZMrCkxeqxiHlQ21oXmQ4F3SiryXBHhAD7JZqvOJjFmg==} dev: true - /rollup@4.13.0: - resolution: {integrity: sha512-3YegKemjoQnYKmsBlOHfMLVPPA5xLkQ8MHLLSw/fBrFaVkEayL51DilPpNNLq1exr98F2B1TzrV0FUlN3gWRPg==} + /rollup@4.14.0: + resolution: {integrity: sha512-Qe7w62TyawbDzB4yt32R0+AbIo6m1/sqO7UPzFS8Z/ksL5mrfhA0v4CavfdmFav3D+ub4QeAgsGEe84DoWe/nQ==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true dependencies: '@types/estree': 1.0.5 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.13.0 - '@rollup/rollup-android-arm64': 4.13.0 - '@rollup/rollup-darwin-arm64': 4.13.0 - '@rollup/rollup-darwin-x64': 4.13.0 - '@rollup/rollup-linux-arm-gnueabihf': 4.13.0 - '@rollup/rollup-linux-arm64-gnu': 4.13.0 - '@rollup/rollup-linux-arm64-musl': 4.13.0 - '@rollup/rollup-linux-riscv64-gnu': 4.13.0 - '@rollup/rollup-linux-x64-gnu': 4.13.0 - '@rollup/rollup-linux-x64-musl': 4.13.0 - '@rollup/rollup-win32-arm64-msvc': 4.13.0 - '@rollup/rollup-win32-ia32-msvc': 4.13.0 - '@rollup/rollup-win32-x64-msvc': 4.13.0 + '@rollup/rollup-android-arm-eabi': 4.14.0 + '@rollup/rollup-android-arm64': 4.14.0 + '@rollup/rollup-darwin-arm64': 4.14.0 + '@rollup/rollup-darwin-x64': 4.14.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.14.0 + '@rollup/rollup-linux-arm64-gnu': 4.14.0 + '@rollup/rollup-linux-arm64-musl': 4.14.0 + '@rollup/rollup-linux-powerpc64le-gnu': 4.14.0 + '@rollup/rollup-linux-riscv64-gnu': 4.14.0 + '@rollup/rollup-linux-s390x-gnu': 4.14.0 + '@rollup/rollup-linux-x64-gnu': 4.14.0 + '@rollup/rollup-linux-x64-musl': 4.14.0 + '@rollup/rollup-win32-arm64-msvc': 4.14.0 + '@rollup/rollup-win32-ia32-msvc': 4.14.0 + '@rollup/rollup-win32-x64-msvc': 4.14.0 fsevents: 2.3.3 dev: true @@ -2269,10 +2067,10 @@ packages: lru-cache: 6.0.0 dev: true - /shiki@1.2.0: - resolution: {integrity: sha512-xLhiTMOIUXCv5DqJ4I70GgQCtdlzsTqFLZWcMHHG3TAieBUbvEGthdrlPDlX4mL/Wszx9C6rEcxU6kMlg4YlxA==} + /shiki@1.2.4: + resolution: {integrity: sha512-Q9n9jKiOjJCRPztA9POn3/uZXNySHDNKAsPNpmtHDcFyi6ZQhx5vQKZW3Nhrwn8TWW3RudSRk66zqY603EZDeg==} dependencies: - '@shikijs/core': 1.2.0 + '@shikijs/core': 1.2.4 dev: true /signal-exit@3.0.7: @@ -2304,11 +2102,11 @@ packages: engines: {node: '>= 6.0.0', npm: '>= 3.0.0'} dev: true - /socks-proxy-agent@8.0.2: - resolution: {integrity: sha512-8zuqoLv1aP/66PHF5TqwJ7Czm3Yv32urJQHrVyhD7mmA6d61Zv8cIXQYPTWwmg6qlupnPvs/QKDmfa4P/qct2g==} + /socks-proxy-agent@8.0.3: + resolution: {integrity: sha512-VNegTZKhuGq5vSD6XNKlbqWhyt/40CgoEw8XxD6dhnm8Jq9IEa3nIa4HwnM8XOqU0CdB0BwWVXusqiFXfHB3+A==} engines: {node: '>= 14'} dependencies: - agent-base: 7.1.0 + agent-base: 7.1.1 debug: 4.3.4 socks: 2.8.1 transitivePeerDependencies: @@ -2323,8 +2121,8 @@ packages: smart-buffer: 4.2.0 dev: true - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} + /source-map-js@1.2.0: + resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} engines: {node: '>=0.10.0'} /source-map@0.6.1: @@ -2356,7 +2154,7 @@ packages: fast-fifo: 1.3.2 queue-tick: 1.0.1 optionalDependencies: - bare-events: 2.2.1 + bare-events: 2.2.2 dev: true /string-width@4.2.3: @@ -2492,8 +2290,8 @@ packages: hasBin: true dev: true - /vite@5.1.6: - resolution: {integrity: sha512-yYIAZs9nVfRJ/AiOLCA91zzhjsHUgMjB+EigzFb6W2XTLO8JixBCKCjvhKZaye+NKYHCrkv3Oh50dH9EdLU2RA==} + /vite@5.2.8: + resolution: {integrity: sha512-OyZR+c1CE8yeHw5V5t59aXsUPPVTHMDjEZz8MgguLL/Q7NblxhZUlTu9xSPqlsUO/y+X7dlU05jdhvyycD55DA==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: @@ -2520,14 +2318,14 @@ packages: terser: optional: true dependencies: - esbuild: 0.19.12 - postcss: 8.4.35 - rollup: 4.13.0 + esbuild: 0.20.2 + postcss: 8.4.38 + rollup: 4.14.0 optionalDependencies: fsevents: 2.3.3 dev: true - /vitepress-export-pdf@1.0.0-beta.0(esbuild@0.20.2)(vitepress@1.0.0-rc.45): + /vitepress-export-pdf@1.0.0-beta.0(esbuild@0.20.2)(vitepress@1.0.2): resolution: {integrity: sha512-DTI1A0ntWy08OXNWmwZC9lSEG69z/tTzng8MVwdvttG4mIHOrEwD9NUZucQPr6o5YgpWDIEsm/J92/Yt+/IgRg==} engines: {node: '>=14.6.0'} hasBin: true @@ -2537,7 +2335,7 @@ packages: '@condorhero/vuepress-plugin-export-pdf-core': 3.0.2(esbuild@0.20.2) debug: 4.3.4 hash-sum: 2.0.0 - vitepress: 1.0.0-rc.45(@algolia/client-search@4.22.1)(search-insights@2.13.0) + vitepress: 1.0.2(@algolia/client-search@4.23.2)(search-insights@2.13.0) transitivePeerDependencies: - bufferutil - encoding @@ -2555,12 +2353,12 @@ packages: - vue dev: false - /vitepress@1.0.0-rc.45(@algolia/client-search@4.22.1)(search-insights@2.13.0): - resolution: {integrity: sha512-/OiYsu5UKpQKA2c0BAZkfyywjfauDjvXyv6Mo4Ra57m5n4Bxg1HgUGoth1CLH2vwUbR/BHvDA9zOM0RDvgeSVQ==} + /vitepress@1.0.2(@algolia/client-search@4.23.2)(search-insights@2.13.0): + resolution: {integrity: sha512-bEj9yTEdWyewJFOhEREZF+mXuAgOq27etuJZT6DZSp+J3XpQstXMJc5piSVwhZBtuj8OfA0iXy+jdP1c71KMYQ==} hasBin: true peerDependencies: - markdown-it-mathjax3: ^4.3.2 - postcss: ^8.4.35 + markdown-it-mathjax3: ^4 + postcss: ^8 peerDependenciesMeta: markdown-it-mathjax3: optional: true @@ -2568,19 +2366,19 @@ packages: optional: true dependencies: '@docsearch/css': 3.6.0 - '@docsearch/js': 3.6.0(@algolia/client-search@4.22.1)(search-insights@2.13.0) - '@shikijs/core': 1.2.0 - '@shikijs/transformers': 1.2.0 + '@docsearch/js': 3.6.0(@algolia/client-search@4.23.2)(search-insights@2.13.0) + '@shikijs/core': 1.2.4 + '@shikijs/transformers': 1.2.4 '@types/markdown-it': 13.0.7 - '@vitejs/plugin-vue': 5.0.4(vite@5.1.6)(vue@3.4.21) - '@vue/devtools-api': 7.0.17(vue@3.4.21) + '@vitejs/plugin-vue': 5.0.4(vite@5.2.8)(vue@3.4.21) + '@vue/devtools-api': 7.0.25(vue@3.4.21) '@vueuse/core': 10.9.0(vue@3.4.21) '@vueuse/integrations': 10.9.0(focus-trap@7.5.4)(vue@3.4.21) focus-trap: 7.5.4 mark.js: 8.11.1 minisearch: 6.3.0 - shiki: 1.2.0 - vite: 5.1.6 + shiki: 1.2.4 + vite: 5.2.8 vue: 3.4.21 transitivePeerDependencies: - '@algolia/client-search' From 177871a1c797ebe241e736106710c948cfda954f Mon Sep 17 00:00:00 2001 From: Tim Siegel Date: Sat, 6 Apr 2024 21:31:40 -0400 Subject: [PATCH 13/15] introduction/index.md: fix word choice for clarity (#142) A "slippery experience" is not a common phrase, and brings to mind something challenging, hard to grasp, or likely to lose control of at any moment. A "smooth experience" is a common phrase, meaning no rough edges, encountering no snags or friction or unexpected pitfalls. --- docs/introduction/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/introduction/index.md b/docs/introduction/index.md index 2ea372a..b5ad134 100644 --- a/docs/introduction/index.md +++ b/docs/introduction/index.md @@ -87,4 +87,4 @@ main configuration is completely shared, and the configuration modified on any h seamlessly synchronized to other hosts through Git. Nix almost completely shielded me from the differences between OS and architecture at the -bottom of the three machines, and the experience was very slippery! +bottom of the three machines, and the experience was very smooth! From 445abd38bea64fa988b3a5daa3b61d6c58ecf3cb Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Sun, 7 Apr 2024 20:44:51 +0800 Subject: [PATCH 14/15] chore: update content about nix cache servers --- docs/nixos-with-flakes/add-custom-cache-servers.md | 14 ++------------ .../nixos-with-flakes/add-custom-cache-servers.md | 11 +---------- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/docs/nixos-with-flakes/add-custom-cache-servers.md b/docs/nixos-with-flakes/add-custom-cache-servers.md index 0ceb6f4..7ecfb31 100644 --- a/docs/nixos-with-flakes/add-custom-cache-servers.md +++ b/docs/nixos-with-flakes/add-custom-cache-servers.md @@ -10,22 +10,12 @@ local build process and significantly improving build speed. ## Why Add Custom Cache Servers {#why-add-custom-cache-servers} -> Note: The methods introduced here can only accelerate the download of packages; many -> `inputs` data sources will still be fetched from GitHub. Also, if the cache is not -> found, local builds will be executed, which typically requires downloading source code -> and building dependencies from GitHub or somewhere else, which may make it slow. To -> completely address the speed issue, it is still recommended to use solutions such as a -> transparent proxy running on your router or local machine. - Two reasons: 1. Add cache servers for some third-party projects, such as the nix-community cache server [https://nix-community.cachix.org](https://nix-community.cachix.org), which can significantly improve the build speed of these third-party projects. -2. Adding a mirrored cache server to accelerate downloads. - 1. The access speed of the official cache server in China is slow. Without a local - global proxy, it is almost unusable. Adding Chinese Nix cache mirrors like - ustc/sjtu/tuna can alleviate this issue. +1. Add cache server mirror sites closest to the user to speed up downloads. ## How to Add Custom Cache Servers {#how-to-add-custom-cache-servers} @@ -296,7 +286,7 @@ In other words, you can use it like this: > machine can completely solve the issue of slow package downloads in NixOS, the > configuration is rather cumbersome and often requires additional hardware. -More users may prefer to directly speed up package downloads by using a HTTP/Socks5 proxy +Some users may prefer to directly speed up package downloads by using a HTTP/Socks5 proxy running on their machine. Here's how to set it up. Using methods like `export HTTPS_PROXY=http://127.0.0.1:7890` in the Terminal will not work because the actual work is done by a background process called `nix-daemon`, not by commands directly diff --git a/docs/zh/nixos-with-flakes/add-custom-cache-servers.md b/docs/zh/nixos-with-flakes/add-custom-cache-servers.md index 533bba7..97534c8 100644 --- a/docs/zh/nixos-with-flakes/add-custom-cache-servers.md +++ b/docs/zh/nixos-with-flakes/add-custom-cache-servers.md @@ -8,17 +8,11 @@ Nix 提供了官方缓存服务器 ,它缓存了 nixp ## 为什么要添加自定义缓存服务器 {#why-add-custom-cache-servers} -> 注意:这里介绍的手段只能加速部分包的下载,许多 inputs 数据源仍然会从 Github 拉取。另外如 -> 果找不到缓存,会执行本地构建,这通常仍然需要从国外下载源码与构建依赖,因此仍然会很慢。为 -> 了完全解决速度问题,仍然建议使用旁路网关或 TUN 等全局代理方案。 - 两个原因: 1. 添加一些第三方项目的缓存服务器,例如 nix-community 的缓存服务器 ,这可以大大提升这些第三方项目的构建速度。 1. 添加离用户最近的缓存服务器镜像站,用于加速下载。 - 1. 官方缓存服务器在中国的访问速度非常慢,如果没有局域网全局代理的话,基本上是无法使用 - 的。添加国内的 ustc/sjtu/tuna 等 Nix 缓存镜像源可以缓解此问题。 ## 如何添加自定义缓存服务器 {#how-to-add-custom-cache-servers} @@ -270,10 +264,7 @@ Nix 提供了 > 参考了 Issue: > [roaming laptop: network proxy configuration - NixOS/nixpkgs](https://github.com/NixOS/nixpkgs/issues/27535#issuecomment-1178444327) -虽然前面提到了,旁路网关可以完全解决 NixOS 的包下载速度问题,但是旁路网关的配置比较麻烦, -而且经常需要额外的硬件支持。 - -更多的用户可能会希望能直接通过 HTTP/Socks5 代理来加速包下载,这里介绍下怎么设置。 +有些用户可能会希望能直接通过 HTTP/Socks5 代理来加速包下载,这里介绍下怎么设置。 直接在 Terminal 中使用 `export HTTPS_PROXY=http://127.0.0.1:7890` 这类方式是无法生效的,因 为 nix 实际干活的是一个叫 `nix-daemon` 的后台进程,而不是直接在 Terminal 中执行的命令。 From 3d77080e71c839d087272abc915d3fab58fd0c27 Mon Sep 17 00:00:00 2001 From: kev <31861128+miooochi@users.noreply.github.com> Date: Sun, 7 Apr 2024 21:32:48 +0800 Subject: [PATCH 15/15] docs: add host-custom-binary-cache-with-s3.md (#140) * fix: correct a typo * docs: add host-custom-binary-cache-with-s3.md * docs(zh): add host-custom-binary-cache-with-s3.md * feat(config.ts): enable routing * patch: reordering * fix: fix inconsistent typos * fix: use nix run nixpkgs#pwgen as per suggestion * fix: use MinIO as per suggestion * feat: add background * patch: rework nix-cache-info creation * patch: clarify nix-cache-write.json usage * fix: comment console output line as per suggestion * fix: apply minior fixes * fix: improve clarify as per suggestion * feat: add prerequisites * refactor: rework zh version * fix: fix inconsistent quotations * feat: add step to create aws-credentials * style: add spaces between English and Chinese Characters --------- Co-authored-by: kev <31861128+yqlbu@users.noreply.github.com> Co-authored-by: Ryan Yin --- docs/.vitepress/config.ts | 8 + .../host-custom-binary-cache-with-s3.md | 267 ++++++++++++++++++ .../host-custom-binary-cache-with-s3.md | 243 ++++++++++++++++ 3 files changed, 518 insertions(+) create mode 100644 docs/best-practices/host-custom-binary-cache-with-s3.md create mode 100644 docs/zh/best-practices/host-custom-binary-cache-with-s3.md diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index b9240bb..d91c424 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -261,6 +261,10 @@ function themeConfigEnglish() { text: "Debugging Derivations and Nix Expressions", link: "/best-practices/debugging.md", }, + { + text: "Host Custom Binary Cache with S3", + link: "/best-practices/host-custom-binary-cache-with-s3.md", + }, ], }, @@ -463,6 +467,10 @@ function themeConfigChinese() { text: "调试 Nix 软件包与 Nix 表达式", link: "/zh/best-practices/debugging.md", }, + { + text: "使用 S3 托管自定义二进制缓存", + link: "/zh/best-practices/host-custom-binary-cache-with-s3.md", + }, ], }, { diff --git a/docs/best-practices/host-custom-binary-cache-with-s3.md b/docs/best-practices/host-custom-binary-cache-with-s3.md new file mode 100644 index 0000000..6fa3f74 --- /dev/null +++ b/docs/best-practices/host-custom-binary-cache-with-s3.md @@ -0,0 +1,267 @@ +# Host Custom Binary Cache with S3 {#host-custom-binary-cache-with-s3} + +## TL;DR + +A guide on how to set up your own S3 nix binary cache using MinIO S3 server. + +## How Software Stored in Nix? {#how-software-stored-in-nix} + +Multiple versions of the same software package can be installed on a system, making it +possible to satisfy various dependency chains at a time. This enables the installation of +multiple packages that depend on the same third package, but on different versions of it. +To achieve this, all packages are installed in the global nix store under `/nix/store/` +and are then symlinked to the respective locations. To verify a package's uniqueness, its +whole directory is hashed, and the hash put into the name of the package's main folder. +Every software built from the same Nix expression that uses the same dependency software +versions results in the same hash, no matter what system it was built on. If any of the +dependency software versions were changed, this will result in a new hash for the final +package. + +Using symlinks to install a package and link all the right dependencies to it also enables +atomic updating. To make this clearer, let's think of an example where software X is +installed in an older version and should be updated. Software X is installed in its very +own directory in the global nix store and symlinked to the right directory, let's say +`/usr/local/bin/`. When the update is triggered, the new version of X is installed into +the global nix store without interfering with its older version. Once the installation +with all its dependencies in the nix store is completed, the final step is to change the +symlink to `/usr/local/bin/`. Since creating a new symlink that overwrites the old one is +an atomic operation in Unix, it is impossible for this operation to fail and leave the +package in a corrupted state. The only possible problem would be that it fails before or +after the symlink creation. Either way, the result would be that we either have the old +version of X or the newly installed version, but nothing in between. + +Quoted from the original work of +https://medium.com/earlybyte/the-s3-nix-cache-manual-e320da6b1a9b + +## Nix Binary Caches {#nix-binary-caches} + +No matter how great every aspect of Nix sounds, its design has also a major drawback, +which is that every package build triggers the build process for the whole dependency +chain from scratch. This can take quite a while, since even compilers such as gcc or ghc +must be built in advance. Such build processes can eat up a remarkable amount of memory, +introducing an additional hurdle if one wants to use it on restricted platforms such as +the Raspberry Pi. + +To overcome the drawback of always building everything from scratch and the chance of +losing access to prebuilt versions of packages, it is also possible to build your Nix +binary cache using an S3 server such as MinIO (https://min.io/). + +The process of setting up your cache, populating it with binaries and use the binaries +from your newly built cache will be described step by step. For this manual, I assume that +you already have nix in place, and that you already have a running MinIO server somewhere +in your environment. If not, you may check out the +[official deployment guide](https://min.io/docs/minio/linux/operations/installation.html) +from MinIO. You'll need to ensure that MinIO is accessible via `HTTPS` using a trusted +certificate. Let's Encrypt will be helpful here. + +In this post, let's explore how we can self-host an S3-compatible server, MinIO, as a +binary cache store. + +Quoted from the original work of +https://medium.com/earlybyte/the-s3-nix-cache-manual-e320da6b1a9b + +## How To Use S3 as a Binary Cache Server {#how-to-use-s3-as-a-binary-cache-server} + +### Prerequisites {#prerequisites} + +- Set up MinIO somewhere in your environment. +- Hold a valid SSL certificates either public or private. For demonstration purpose, we + will use `minio.homelab.local` (private certificate) in the steps mentioned in this + tutorial. If you plan to use a private certificate, you MUST resolve the DNS challenges + on your own. Hence, it is recommended to use a public certificate. +- Install `minio-client` in your environment. + +### Generate Password {#generate-password} + +```bash +nix run nixpkgs#pwgen -- -c -n -y -s -B 32 1 +# oenu1Yuch3rohz2ahveid0koo4giecho +``` + +### Set Up MinIO Client {#set-up-minio-client} + +Install the MinIO command-line client `mc`. + +```nix +{ pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + minio-client # A replacement for ls, cp, mkdir, diff, and rsync commands for filesystems and object storage + ]; +} +``` + +Create or edit `~/.mc/config.json`. + +```json +{ + "version": "10", + "aliases": { + "s3": { + "url": "https://s3.homelab.local", + "accessKey": "minio", + "secretKey": "oenu1Yuch3rohz2ahveid0koo4giecho", + "api": "s3v4", + "path": "auto" + } + } +} +``` + +On the machine we use to build the nix packages, we need the S3 credentials in places. Set +up a file `~/.aws/credentials` and populate it with the credentials of our nixbuilder +user. Replace `` with the password generated by the `pwgen` command. + +```bash +[default] +aws_access_key_id=nixbuilder +aws_secret_access_key= +``` + +### Setup S3 Bucket as Binary Cache {#setup-s3-bucket-as-binary-cache} + +Create the `nix-cache` bucket. + +```bash +mc mb s3/nix-cache +``` + +Create the `nixbuilder` MinIO user and assign a password. + +```bash +mc admin user add s3 nixbuilder +``` + +Create a file called `nix-cache-write.json` in your current working directory with the +following contents: + +```json +{ + "Id": "AuthenticatedWrite", + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "AuthenticatedWrite", + "Action": [ + "s3:AbortMultipartUpload", + "s3:GetBucketLocation", + "s3:GetObject", + "s3:ListBucket", + "s3:ListBucketMultipartUploads", + "s3:ListMultipartUploadParts", + "s3:PutObject" + ], + "Effect": "Allow", + "Resource": ["arn:aws:s3:::nix-cache", "arn:aws:s3:::nix-cache/*"], + "Principal": "nixbuilder" + } + ] +} +``` + +Create a policy with `nix-cache-write.json` that allows `nixbuilder` to upload files to +the cache. + +```bash +mc admin policy add s3 nix-cache-write nix-cache-write.json +``` + +Associate the policy that we created above with the `nixbuilder` user. + +```bash +mc admin policy set s3 nix-cache-write user=nixbuilder +``` + +Allow anonymous users to download files without authenticating. + +```bash +mc anonymous set download s3/nix-cache +``` + +Create a file called `nix-cache-info` in your working directory. This file tells Nix that +the bucket is indeed a binary cache. + +```bash +cat > nix-cache-info < ~/.config/nix/secret.key +nix key convert-secret-to-public < ~/.config/nix/secret.key > ~/.config/nix/public.key +cat ~/.config/nix/public.key +# s3.homelab.local-1:m0J/oDlLEuG6ezc6MzmpLCN2MYjssO3NMIlr9JdxkTs= +``` + +### Activate Binary Cache with Flake {#activate-binary-cache-with-flake} + +Put the following lines in `configuration.nix` or any of your custom NixOS module: + +```nix +{ + nix = { + settings = { + # Substituters will be appended to the default substituters when fetching packages. + extra-substituters = [ + "https://s3.homelab.local/nix-cache/" + ]; + extra-trusted-public-keys = [ + "s3.homelab.local-1:m0J/oDlLEuG6ezc6MzmpLCN2MYjssO3NMIlr9JdxkTs=" + ]; + }; + }; +} +``` + +Rebuild the system. + +```bash +sudo nixos-rebuild switch --upgrade --flake .# +``` + +### Push Paths to the Store {#push-paths-to-the-store} + +Sign some paths in the local store. + +```bash +nix store sign --recursive --key-file ~/.config/nix/secret.key /run/current-system +``` + +Copy those paths to the cache. + +```bash +nix copy --to 's3://nix-cache?profile=nixbuilder&endpoint=s3.homelab.local' /run/current-system +``` + +### Add Automatic Object Expiration Policy {#add-automatic-object-expiration-policy} + +```bash +mc ilm rule add s3/nix-cache --expire-days "DAYS" +# Example: mc ilm rule add s3/nix-cache --expire-days "7" +``` + +### References {#references} + +Here are some of the sources that I used in making this document: + +- [Blog post by Jeff on Nix binary caches](https://jcollie.github.io/nixos/2022/04/27/nixos-binary-cache-2022.html) +- [Binary cache in the NixOS wiki](https://nixos.wiki/wiki/Binary_Cache) +- [Serving a Nox store via S3 in the NixOS manual](https://nixos.org/manual/nix/stable/package-management/s3-substituter.html) +- [Serving a Nix store via HTTP in the NixOS manual](https://nixos.org/manual/nix/stable/package-management/binary-cache-substituter.html) diff --git a/docs/zh/best-practices/host-custom-binary-cache-with-s3.md b/docs/zh/best-practices/host-custom-binary-cache-with-s3.md new file mode 100644 index 0000000..ec91b43 --- /dev/null +++ b/docs/zh/best-practices/host-custom-binary-cache-with-s3.md @@ -0,0 +1,243 @@ +# 使用 S3 自定义二进制缓存托管 + +## 简介 + +一个关于如何使用 MinIO S3 服务器设置自己的 S3 Nix 二进制缓存的指南。 + +## Nix 中的软件如何存储? + +可以在系统上安装同一软件包的多个版本,从而能够同时满足各种依赖链。这使得可以安装多个依赖于 +同一个第三方软件包的软件包,但使用不同版本的它。为了实现这一点,所有软件包都安装在全局的 +Nix 存储中,路径为 `/nix/store/`,然后通过符号链接到相应的位置。为了验证软件包的唯一性,其 +整个目录被哈希,并将哈希放入软件包的主文件夹的名称中。从使用相同依赖软件版本构建的相同 Nix +表达式构建的每个软件包都会产生相同的哈希,无论它是在什么系统上构建的。如果任何依赖软件的版 +本发生更改,这将导致最终软件包的新哈希。 + +使用符号链接来“安装”软件包并将所有正确的依赖项链接到它还使得原子更新成为可能。为了使这一点 +更清楚,让我们来考虑一个例子,其中软件 X 安装在旧版本中并且应该进行更新。软件 X 安装在全局 +Nix 存储中的自己的目录中,并符号链接到正确的目录,比如 `/usr/local/bin/`。当触发更新时,X +的新版本会安装到全局 Nix 存储中,而不会干扰其旧版本。一旦安装完成,包括其所有依赖项在内的 +最终软件包在 Nix 存储中,最后一步是将符号链接更改为 `/usr/local/bin/`。由于在 Unix 中创建 +新的符号链接来覆盖旧的符号链接是一个原子操作,因此这个操作不可能失败并使软件包处于损坏状 +态。唯一可能的问题是在符号链接创建之前或之后失败。无论哪种方式,结果都是我们要么有旧版本的 +X,要么有新安装的版本,但中间没有任何东西。 + +引用自原作:https://medium.com/earlybyte/the-s3-nix-cache-manual-e320da6b1a9b + +## Nix 二进制缓存 + +无论 Nix 的每个方面听起来多么棒,它的设计也有一个主要缺点,那就是每次构建软件包都会触发整 +个依赖链的构建过程。这可能需要相当长的时间,因为甚至像 gcc 或 ghc 这样的编译器都必须提前构 +建。这样的构建过程可能会消耗大量内存,在受限平台(如树莓派)上使用它时会引入额外的障碍。 + +为了克服总是从头开始构建一切以及丢失对软件包预构建版本的访问权限的缺点,还可以使用 S3 服务 +器(如 MinIO)构建自己的 Nix 二进制缓存。 + +设置您的缓存,填充它的二进制文件并使用您新构建的缓存中的二进制文件的过程将被逐步描述。对于 +本手册,我假设您已经有了 Nix,并且在您的环境中已经运行了 MinIO 服务器。如果没有,您可以查 +看 MinIO 的[官方部署指南](https://min.io/docs/minio/linux/operations/installation.html)。 +您需要确保通过信任的证书以 `HTTPS` 方式访问 MinIO。在这里,Let's Encrypt 将非常有用。 + +在本文中,让我们探讨如何自托管一个 S3 兼容服务器 MinIO 作为二进制缓存存储。 + +引用自原作:https://medium.com/earlybyte/the-s3-nix-cache-manual-e320da6b1a9b + +## 如何将 S3 用作二进制缓存服务器 + +### 先决条件 + +- 在您的环境中设置 MinIO。 +- 拥有有效的 SSL 证书,可以是公共证书也可以是私有证书。在本教程中,我们将使用 + `minio.homelab.local`(私有证书)的示例步骤。如果您计划使用私有证书,您必须自己解决 DNS + 挑战。因此,建议使用公共证书。 +- 在您的环境中安装 `minio-client`。 + +### 生成密码 + +```bash +nix run nixpkgs#pwgen -- -c -n -y -s -B 32 1 +# oenu1Yuch3rohz2ahveid0koo4giecho +``` + +### 设置 MinIO 客户端 + +安装 MinIO 命令行客户端 `mc`。 + +```nix +{ pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + minio-client # 用于文件系统和对象存储的 ls、cp、mkdir、diff 和 rsync 命令的替代品 + ]; +} +``` + +创建或编辑 `~/.mc/config.json`。 + +```json +{ + "version": "10", + "aliases": { + "s3": { + "url": "https://s3.homelab.local", + "accessKey": "minio", + "secretKey": "oenu1Yuch3rohz2ahveid0koo4giecho", + "api": "s3v4", + "path": "auto" + } + } +} +``` + +在我们用来构建 Nix 包的机器上,我们需要在一些地方使用 S3 凭据。设置一个文件 +`~/.aws/credentials` 并用我们的 nixbuilder 用户的凭据填充它。用 `pwgen` 命令生成的密码替换 +``。 + +```plaintext +[default] +aws_access_key_id=nixbuilder +aws_secret_access_key= +``` + +### 设置 S3 存储桶作为二进制缓存 + +创建 `nix-cache` 存储桶。 + +```bash +mc mb s3/nix-cache +``` + +创建 `nixbuilder` MinIO 用户并分配密码。 + +```bash +mc admin user add s3 nixbuilder +``` + +在当前工作目录中创建名为 `nix-cache-write.json` 的文件,并具有以下内容: + +```json +{ + "Id": "AuthenticatedWrite", + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "AuthenticatedWrite", + "Action": [ + "s3:AbortMultipartUpload", + "s3:GetBucketLocation", + "s3:GetObject", + "s3:ListBucket", + "s3:ListBucketMultipartUploads", + "s3:ListMultipartUploadParts", + "s3:PutObject" + ], + "Effect": "Allow", + "Resource": ["arn:aws:s3:::nix-cache", "arn:aws:s3:::nix-cache/*"], + "Principal": "nixbuilder" + } + ] +} +``` + +使用 `nix-cache-write.json` 创建允许 `nixbuilder` 上载文件到缓存的策略。 + +```bash +mc admin policy add s3 nix-cache-write nix-cache-write.json +``` + +将我们上面创建的策略与 `nixbuilder` 用户关联。 + +```bash +mc admin policy set s3 nix-cache-write user=nixbuilder +``` + +允许匿名用户在不进行身份验证的情况下下载文件。 + +```bash +mc anonymous set download s3/nix-cache +``` + +在工作目录中创建名为 `nix-cache-info` 的文件。此文件告诉 Nix 桶确实是一个二进制缓存。 + +```bash +cat > nix-cache-info < ~/.config/nix/secret.key +nix key convert-secret-to-public < ~/.config/nix/secret.key > ~/.config/nix/public.key +cat ~/.config/nix/public.key +# s3.homelab.local-1:m0J/oDlLEuG6ezc6MzmpLCN2MYjssO3NMIlr9JdxkTs= +``` + +### 使用 Flake 激活二进制缓存 + +将以下内容放入 `configuration.nix` 或您的任何自定义 NixOS 模块中: + +```nix +{ + nix = { + settings = { + # 在获取软件包时,替代器将被附加到默认的替代器。 + extra-substituters = [ + "https://s3.homelab.local/nix-cache/" + ]; + extra-trusted-public-keys = [ + "s3.homelab.local-1:m0J/oDlLEuG6ezc6MzmpLCN2MYjssO3NMIlr9JdxkTs=" + ]; + }; + }; +} +``` + +重新构建系统。 + +```bash +sudo nixos-rebuild switch --upgrade --flake .# +``` + +### 推送路径到存储 + +对本地存储中的一些路径进行签名。 + +```bash +nix store sign --recursive --key-file ~/.config/nix/secret.key /run/current-system +``` + +将这些路径复制到缓存。 + +```bash +nix copy --to 's3://nix-cache?profile=nixbuilder&endpoint=s3.homelab.local' /run/current-system +``` + +### 添加自动对象到期策略 + +```bash +mc ilm rule add s3/nix-cache --expire-days "DAYS" +# 例如:mc ilm rule add s3/nix-cache --expire-days "7" +``` + +### 参考资料 + +以下是我在编写本文档时使用的一些来源: + +- [Jeff 的博客文章:Nix 二进制缓存](https://jcollie.github.io/nixos/2022/04/27/nixos-binary-cache-2022.html) +- [NixOS wiki 上的二进制缓存](https://nixos.wiki/wiki/Binary_Cache) +- [NixOS 手册中关于通过 S3 提供 Nix 存储](https://nixos.org/manual/nix/stable/package-management/s3-substituter.html) +- [NixOS 手册中关于通过 HTTP 提供 Nix 存储](https://nixos.org/manual/nix/stable/package-management/binary-cache-substituter.html)