Skip to content

Commit ce22863

Browse files
committed
docs: add nixos-cli-activate(1) man page, re-organize env vars page
1 parent bdb8285 commit ce22863

3 files changed

Lines changed: 99 additions & 7 deletions

File tree

cmd/activate/activate.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ func ActivateCommand() *cobra.Command {
1414
var opts cmdOpts.ActivateOpts
1515

1616
commands := map[string]string{
17-
"boot": "Make this configuration the boot default",
17+
"boot": "Generate boot entries and make this the default configuration",
1818
"check": "Run pre-activation checks and exit",
1919
"dry-activate": "Show what would be activated but do not perform it",
20-
"switch": "Activate this configuration and make it the boot default",
21-
"test": "Activate this configuration, but don't make it the boot default",
20+
"switch": "Activate this configuration, generate entries, and make this the default configuration",
21+
"test": "Activate this configuration, but do not generate boot entries",
2222
}
2323

2424
cmd := cobra.Command{

doc/man/nixos-cli-activate.1.scd

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
NIXOS-CLI-ACTIVATE(1)
2+
3+
# NAME
4+
5+
nixos activate - run activation routines for a NixOS system
6+
7+
# SYNOPSIS
8+
9+
*nixos activate* <ACTION> [options]
10+
11+
# DESCRIPTION
12+
13+
Run activation routines for a given NixOS system.
14+
15+
This command handles migrating (switching) between built NixOS configurations,
16+
built from a NixOS configuration's _config.system.build.toplevel_ build output.
17+
18+
If ran directly by a user, the switch script, located at
19+
_/run/current-system/bin/switch-to-configuration_, will be executed. If using
20+
the activation interface NixOS module, this calls back out to _nixos activate_
21+
with the correct parameters for the given generation.
22+
23+
This activation script is mostly backwards-compatible with the existing
24+
_switch-to-configuration-ng_ script that is provided in upstream _nixpkgs_.
25+
26+
This is a low-level command, and should be regarded accordingly.
27+
28+
# ARGUMENTS
29+
30+
*ACTION*
31+
The activation routine to run.
32+
33+
Can be exactly one of the following values:
34+
35+
- *boot* - Generate boot entries and make this the default configuration
36+
- *check* - Run pre-activation checks and exit
37+
- *dry-activate* - Show what would be activated but do not perform it
38+
- *switch* - Activate this configuration, generate entries, and make this
39+
the default configuration
40+
- *test* - Activate this configuration, but do not generate boot entries
41+
42+
# OPTIONS
43+
44+
*-s*, *--specialisation* <NAME>
45+
Activate a specialisation *NAME* from the available specialisations.
46+
47+
If none are provided, then the base configuration without specialisations
48+
is assumed. Check *nixos-cli-settings(5)* for more information.
49+
50+
This is only available in user-direct invocation mode, to figure out which
51+
specialisation to use, and does not exist during actual activation mode.
52+
53+
*-h*, *--help*
54+
Show the help message for this command.
55+
56+
# SEE ALSO
57+
58+
*nixos-cli-apply(1)*
59+
60+
*nixos-cli-env*(5)
61+
62+
# AUTHORS
63+
64+
Maintained by the *nixos-cli* team. See the main man page *nixos-cli(1)* for
65+
details.

doc/man/nixos-cli-env.5.scd

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,42 @@ Among other things.
7575

7676
Mostly useful for internal implementation, rather than for end-users.
7777

78-
*NIXOS_CLI_DEBUG_MODE*
79-
Show log messages for when developing TUIs. Only useful for during
80-
development.
81-
8278
*NIXOS_CLI_SUPPRESS_NO_SETTINGS_WARNING*
8379
Suppress the settings warning. Useful for non-NixOS systems where there is
8480
no settings file configured by default and the warnings get noisy/clutter
8581
logs.
8682

83+
*NIXOS_NO_CHECK*
84+
_nixos activate_ skips running its pre-switch checks if this is set to 1.
85+
86+
*NIXOS_NO_SYNC*
87+
_nixos activate_ skips syncing the Nix store to disk before activating. Can
88+
speed up activations at the cost of risking data loss if interrupted.
89+
90+
*STC_DISPLAY_ALL_UNITS*
91+
Show all actual units that are being modified by _nixos activate_.
92+
93+
## DEVELOPMENT MODE VARIABLES
94+
95+
These variables are useful to know about for developers working on this CLI only.
96+
97+
Do not set directly unless running this in development.
98+
99+
*NIXOS_CLI_ATTEMPTING_ACTIVATION*
100+
Used to control _nixos activate_'s execution, and prevent it from infinitely
101+
recursing when a user invokes it directly.
102+
103+
*NIXOS_CLI_DEBUG_MODE*
104+
Show log messages for when developing TUIs. Only useful for during
105+
development.
106+
107+
*\_\_NIXOS_SWITCH_TO_CONFIGURATION_PARENT_EXE*
108+
Set to prevent user activation invocations from infinitely recursing.
109+
110+
If this is not set correctly to the running executable during user
111+
switching, then it is not being executed correctly and must immediately
112+
exit.
113+
87114
# SEE ALSO
88115

89116
*nixos-cli-config(5)*

0 commit comments

Comments
 (0)