about summary refs log tree commit diff
path: root/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.8
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.8')
-rw-r--r--pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.842
1 files changed, 37 insertions, 5 deletions
diff --git a/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.8 b/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.8
index 89c8e511154d8..9ef46b564dda0 100644
--- a/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.8
+++ b/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.8
@@ -19,6 +19,8 @@
 .Op Fl -fast
 .Op Fl -rollback
 .br
+.Op Fl -file | f Ar path
+.Op Fl -attr | A Ar attrPath
 .Op Fl -flake Ar flake-uri
 .Op Fl -no-flake
 .Op Fl -recreate-lock-file
@@ -62,11 +64,15 @@
 .Sh DESCRIPTION
 This command updates the system so that it corresponds to the
 configuration specified in
-.Pa /etc/nixos/configuration.nix
-or
-.Pa /etc/nixos/flake.nix Ns
-\&. Thus, every time you modify the configuration or any other NixOS module, you
-must run
+.Pa /etc/nixos/configuration.nix Ns
+,
+.Pa /etc/nixos/flake.nix
+or the file and attribute specified by the
+.Fl -file
+and/or
+.Fl -attr
+options. Thus, every time you modify the configuration or any other NixOS
+module, you must run
 .Nm
 to make the changes take effect. It builds the new system in
 .Pa /nix/store Ns
@@ -386,6 +392,32 @@ system with
 .Ic sudo Ns
 \&. Setting this option allows deploying as a non-root user.
 .
+.It Fl -file Ar path , Fl f Ar path
+Enable and build the NixOS system from the specified file. The file must
+evaluate to an attribute set, and it must contain a valid NixOS configuration
+at attribute
+.Va attrPath Ns
+\&. This is useful for building a NixOS system from a nix file that is not
+a flake or a NixOS configuration module. Attribute set a with valid NixOS
+configuration can be made using
+.Va nixos
+function in nixpkgs or importing and calling
+.Pa nixos/lib/eval-config.nix
+from nixpkgs. If specified without
+.Fl -attr
+option, builds the configuration from the top-level
+attribute of the file.
+.
+.It Fl -attr Ar attrPath , Fl A Ar attrPath
+Enable and build the NixOS system from nix file and use the specified attribute
+path from file specified by the
+.Fl -file
+option. If specified without
+.Fl -file
+option, uses
+.Pa default.nix
+in current directory.
+.
 .It Fl -flake Va flake-uri Ns Op Va #name
 Build the NixOS system from the specified flake. It defaults to the directory
 containing the target of the symlink