You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This creates the necessary configuration files under `/mnt/etc/nixos/`, which
74
-
you can then customize as needed and copy them to your local machine in order to
75
-
include them in your flake.
50
+
If you already have a flake, you can use it by adding [disko configuration](https://github.com/nix-community/disko?tab=readme-ov-file#how-to-use-disko) to it.
76
51
77
52
### 3. Configure your SSH key
78
53
@@ -128,6 +103,10 @@ and add `--env-password` to the `nixos-anywhere` command.
128
103
129
104
### 7. (Optional) Test your NixOS and Disko configuration
130
105
106
+
Skip this step and continue with Step 8, if you don't have a hardware configuration
107
+
(hardware-configuration.nix or facter.json) generated yet or make sure you don't
108
+
import non-existing hardware-configuration.nix or facter.json during running the vm test.
109
+
131
110
The following command will automatically test your nixos configuration and run
132
111
disko inside a virtual machine, where
133
112
@@ -142,7 +121,64 @@ disko inside a virtual machine, where
142
121
nix run github:nix-community/nixos-anywhere -- --flake <path to configuration>#<configuration name> --vm-test
143
122
```
144
123
145
-
### 8. Run it
124
+
### 8. Prepare hardware configuration
125
+
126
+
If you are not using a virtual machine, it is recommended to let `nixos-anywhere` generate a hardware configuration during installation.
127
+
This ensures that, for example, drivers needed to detect disks are set up correctly.
128
+
129
+
To allow `nixos-anywhere` to import its generated configuration into your NixOS configuration, you need to add an import for the hardware configuration upfront.
to your `nixos-anywhere` command. The second flag, `./hardware-configuration.nix`, is the path where `nixos-generate-config` will write the configuration.
147
+
Adjust it to the path where the `hardware-configuration.nix` for this machine should be stored.
148
+
149
+
#### 8.1 nixos-facter
150
+
151
+
Instead of `nixos-generate-config`, you can also use the new [nixos-facter](https://github.com/numtide/nixos-facter) command.
152
+
`nixos-facter` is currently experimental but provides more comprehensive hardware reports and more advanced hardware configuration modules.
0 commit comments