From 69553dfc36b650405cf02675873d51f654d23b06 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 21 Feb 2025 18:50:06 +0100 Subject: [PATCH 1/4] Mark the nix CLI as *the* interface in the manual, deprecate nix-* --- doc/manual/source/SUMMARY.md.in | 6 +++--- doc/manual/source/command-ref/experimental-commands.md | 8 -------- doc/manual/source/command-ref/subcommands.md | 3 +++ 3 files changed, 6 insertions(+), 11 deletions(-) delete mode 100644 doc/manual/source/command-ref/experimental-commands.md create mode 100644 doc/manual/source/command-ref/subcommands.md diff --git a/doc/manual/source/SUMMARY.md.in b/doc/manual/source/SUMMARY.md.in index 64447e611..228bbc882 100644 --- a/doc/manual/source/SUMMARY.md.in +++ b/doc/manual/source/SUMMARY.md.in @@ -54,7 +54,9 @@ - [Command Reference](command-ref/index.md) - [Common Options](command-ref/opt-common.md) - [Common Environment Variables](command-ref/env-common.md) - - [Main Commands](command-ref/main-commands.md) + - [Subcommands](command-ref/subcommands.md) +{{#include ./command-ref/new-cli/SUMMARY.md}} + - [Deprecated Commands](command-ref/main-commands.md) - [nix-build](command-ref/nix-build.md) - [nix-shell](command-ref/nix-shell.md) - [nix-store](command-ref/nix-store.md) @@ -98,8 +100,6 @@ - [nix-hash](command-ref/nix-hash.md) - [nix-instantiate](command-ref/nix-instantiate.md) - [nix-prefetch-url](command-ref/nix-prefetch-url.md) - - [Experimental Commands](command-ref/experimental-commands.md) -{{#include ./command-ref/new-cli/SUMMARY.md}} - [Files](command-ref/files.md) - [nix.conf](command-ref/conf-file.md) - [Profiles](command-ref/files/profiles.md) diff --git a/doc/manual/source/command-ref/experimental-commands.md b/doc/manual/source/command-ref/experimental-commands.md deleted file mode 100644 index 1190729a2..000000000 --- a/doc/manual/source/command-ref/experimental-commands.md +++ /dev/null @@ -1,8 +0,0 @@ -# Experimental Commands - -This section lists [experimental commands](@docroot@/development/experimental-features.md#xp-feature-nix-command). - -> **Warning** -> -> These commands may be removed in the future, or their syntax may -> change in incompatible ways. diff --git a/doc/manual/source/command-ref/subcommands.md b/doc/manual/source/command-ref/subcommands.md new file mode 100644 index 000000000..6a2673233 --- /dev/null +++ b/doc/manual/source/command-ref/subcommands.md @@ -0,0 +1,3 @@ +# Subcommands + +This section lists all the subcommands of the `nix` CLI. From a1d27ff6d21ffbb07411d3f2a2ca3034b7c320a2 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 21 Feb 2025 19:13:51 +0100 Subject: [PATCH 2/4] Include Determinate Nix version number in the manual --- doc/manual/{book.toml => book.toml.in} | 2 +- doc/manual/meson.build | 6 +++++- doc/manual/package.nix | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) rename doc/manual/{book.toml => book.toml.in} (95%) diff --git a/doc/manual/book.toml b/doc/manual/book.toml.in similarity index 95% rename from doc/manual/book.toml rename to doc/manual/book.toml.in index 3b4044fba..13c553f01 100644 --- a/doc/manual/book.toml +++ b/doc/manual/book.toml.in @@ -1,5 +1,5 @@ [book] -title = "Determinate Nix Reference Manual" +title = "Determinate Nix Reference Manual @version@" src = "source" [output.html] diff --git a/doc/manual/meson.build b/doc/manual/meson.build index f0e71458a..c251fadb1 100644 --- a/doc/manual/meson.build +++ b/doc/manual/meson.build @@ -4,6 +4,8 @@ project('nix-manual', license : 'LGPL-2.1-or-later', ) +fs = import('fs') + nix = find_program('nix', native : true) mdbook = find_program('mdbook', native : true) @@ -83,6 +85,7 @@ manual = custom_target( ''' @0@ @INPUT0@ @CURRENT_SOURCE_DIR@ > @DEPFILE@ @0@ @INPUT1@ summary @2@ < @CURRENT_SOURCE_DIR@/source/SUMMARY.md.in > @2@/source/SUMMARY.md + sed -e 's|@version@|@3@|g' < @INPUT2@ > @2@/book.toml rsync -r --include='*.md' @CURRENT_SOURCE_DIR@/ @2@/ (cd @2@; RUST_LOG=warn @1@ build -d @2@ 3>&2 2>&1 1>&3) | { grep -Fv "because fragment resolution isn't implemented" || :; } 3>&2 2>&1 1>&3 rm -rf @2@/manual @@ -92,12 +95,13 @@ manual = custom_target( python.full_path(), mdbook.full_path(), meson.current_build_dir(), + fs.read('../../.version-determinate').strip(), ), ], input : [ generate_manual_deps, 'substitute.py', - 'book.toml', + 'book.toml.in', 'anchors.jq', 'custom.css', nix3_cli_files, diff --git a/doc/manual/package.nix b/doc/manual/package.nix index 8f5d0dfe1..6d93e6f1a 100644 --- a/doc/manual/package.nix +++ b/doc/manual/package.nix @@ -30,6 +30,7 @@ mkMesonDerivation (finalAttrs: { fileset.difference (fileset.unions [ ../../.version + ../../.version-determinate # Too many different types of files to filter for now ../../doc/manual ./. From 247ec94041baf5d959ce9b08897819ad4ee85d8a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 21 Feb 2025 19:19:02 +0100 Subject: [PATCH 3/4] Remove unnecessary ./.version-determinate symlink --- src/libstore/.version-determinate | 1 - src/libstore/meson.build | 2 +- src/libstore/package.nix | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) delete mode 120000 src/libstore/.version-determinate diff --git a/src/libstore/.version-determinate b/src/libstore/.version-determinate deleted file mode 120000 index c4121e0c3..000000000 --- a/src/libstore/.version-determinate +++ /dev/null @@ -1 +0,0 @@ -../../.version-determinate \ No newline at end of file diff --git a/src/libstore/meson.build b/src/libstore/meson.build index aaaa5956d..85192c299 100644 --- a/src/libstore/meson.build +++ b/src/libstore/meson.build @@ -22,7 +22,7 @@ configdata = configuration_data() # TODO rename, because it will conflict with downstream projects configdata.set_quoted('PACKAGE_VERSION', meson.project_version()) -configdata.set_quoted('DETERMINATE_NIX_VERSION', fs.read('.version-determinate').strip()) +configdata.set_quoted('DETERMINATE_NIX_VERSION', fs.read('../../.version-determinate').strip()) configdata.set_quoted('SYSTEM', host_machine.cpu_family() + '-' + host_machine.system()) diff --git a/src/libstore/package.nix b/src/libstore/package.nix index fc68f100b..543694438 100644 --- a/src/libstore/package.nix +++ b/src/libstore/package.nix @@ -39,7 +39,6 @@ mkMesonLibrary (finalAttrs: { ../../.version ./.version ../../.version-determinate - ./.version-determinate ./meson.build ./meson.options ./linux/meson.build From f7aaa319781e708471b751d541953003b6548917 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 21 Feb 2025 19:23:03 +0100 Subject: [PATCH 4/4] Tweak title --- doc/manual/book.toml.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/manual/book.toml.in b/doc/manual/book.toml.in index 13c553f01..7ecbaab03 100644 --- a/doc/manual/book.toml.in +++ b/doc/manual/book.toml.in @@ -1,5 +1,5 @@ [book] -title = "Determinate Nix Reference Manual @version@" +title = "Determinate Nix @version@ Reference Manual" src = "source" [output.html]