Update README.md
This commit is contained in:
1 parent
e1a08112a7
commit
dc06d29cf1
1 file changed
+6
-38
@@ -1,40 +1,8 @@
|
|||||||
### installation
|
### How to use
|
||||||
first, you must edit /etc/nixos/configuration.nix to include the following:
|
My recommendation would be to clone this repo, make a copy of it, delete the contents of `modules/hosts/` in your copy, and create your own host modules from scratch using mine as a reference for how they are constructed.
|
||||||
```
|
The directory structure (i.e. the location of the actual files) within the `modules/` directory does not matter, since all `*.nix` files contained anywhere below `modules/` are automatically found, imported and merged.
|
||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
imports = [
|
|
||||||
<...>
|
|
||||||
];
|
|
||||||
|
|
||||||
nix.settings.experimental-features = [
|
Make sure to check the default values for options, since for example the default `info.userName` value is `"grey"`, which will cause things to break if it is not set to match your own username.
|
||||||
"nix-command"
|
Adding the line `features.documentation.enable = true;` to your host config will build a static website that runs on http://localhost:8080, which describes all of the options I have created for this flake. For general NixOS / Home Manager options, I recommend [NixOS Search](https://search.nixos.org/options).
|
||||||
"flakes"
|
|
||||||
];
|
|
||||||
|
|
||||||
<...>
|
The `modules/global/` directory is probably also something to be aware of, since this is for config that is considered global (applied to all hosts) *for me*, and will not necessarily apply to you.
|
||||||
|
|
||||||
networking.hostname = "<hostname>";
|
|
||||||
|
|
||||||
<...>
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
git
|
|
||||||
];
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
then, run `sudo nixos-rebuild switch` once to apply those changes.
|
|
||||||
|
|
||||||
reboot, to make sure that everything applied properly.
|
|
||||||
|
|
||||||
make sure to `cp /etc/nixos/hardware-configuration ~/nixos/hosts/<hostname>` to apply the generated hardware config for your system
|
|
||||||
|
|
||||||
finally, run `sudo nixos-rebuild switch --flake /home/grey/nixos#<hostname>` to apply the flake.
|
|
||||||
|
|
||||||
reboot again, and you should now land on your desktop/login screen!
|
|
||||||
|
|
||||||
now you have access to `nh os switch ~/nixos`, and shouldn't touch the global config ever again.
|
|
||||||
Reference in new issue
Block a user