summaryrefslogtreecommitdiff
path: root/nixos/README.md
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2024-11-29 07:38:10 +0100
committerMartin Fischer <martin@push-f.com>2024-12-11 08:37:49 +0100
commitb2bd12c7c0039c33b81e1e88b825e1606ee899e2 (patch)
tree086e64c980ea2da3b555f2a3cd8e2d4fcde29f6f /nixos/README.md
parentdfb73342a094871a54185d90841430be087e109c (diff)
refactor: enable host-specific configuration
Diffstat (limited to 'nixos/README.md')
-rw-r--r--nixos/README.md9
1 files changed, 6 insertions, 3 deletions
diff --git a/nixos/README.md b/nixos/README.md
index 6c4bcb1..1a9c50e 100644
--- a/nixos/README.md
+++ b/nixos/README.md
@@ -31,10 +31,13 @@ We're assuming that you just installed NixOS by going through the [official inst
```
nixos-generate-config --dir .
```
-3. Pin Nixpkgs to the [latest stable version](https://nixos.org/manual/nixos/stable/release-notes) using npins:
+3. Rename the files to `$host-configuration.nix` and `$host-hardware-configuration.nix` where `$host` is the configured hostname.
+ Add `# channel="..."` to the start of the `$host-configuration.nix` file where `...` is the key of a channel pinned in `npins/sources.json`.
+ A new channel can be pinned with:
+
```
nix-shell -p npins --run \
- 'npins init --bare && npins add --name nixos channel nixos-23.11'
+ 'npins add --name nixos channel nixos-23.11'
```
4. Remove all stateful channels:
```
@@ -42,7 +45,7 @@ We're assuming that you just installed NixOS by going through the [official inst
```
5. Rebuild:
```
- sudo ./rebuild switch
+ sudo HOSTNAME=$host ./rebuild switch
```
6. Log out and back in again.