From b2bd12c7c0039c33b81e1e88b825e1606ee899e2 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Fri, 29 Nov 2024 07:38:10 +0100 Subject: refactor: enable host-specific configuration --- nixos/README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'nixos/README.md') 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. -- cgit v1.2.3