aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2026-10-10 07:46:57 +0200
committerMartin Fischer <martin@push-f.com>2026-10-10 10:59:49 +0200
commitd0f4bcdc2d5249368eaae452a43a7b668f6744fd (patch)
tree4e5b2f7faf298f3ac5f579188081cae83bb3c75f
parenta385e5b507947f9085138ec3609d860c4cdcff70 (diff)
refactor: merge channel config to channels.toml
-rw-r--r--nixos/README.md4
-rw-r--r--nixos/channels.toml6
-rw-r--r--nixos/hosts/ev/metadata.toml1
-rw-r--r--nixos/hosts/hamac/metadata.toml1
-rw-r--r--nixos/hosts/tente/metadata.toml1
-rwxr-xr-xnixos/rebuild4
6 files changed, 10 insertions, 7 deletions
diff --git a/nixos/README.md b/nixos/README.md
index 075f812..b65f510 100644
--- a/nixos/README.md
+++ b/nixos/README.md
@@ -32,8 +32,8 @@ We're assuming that you just installed NixOS by going through the [official inst
nixos-generate-config --dir .
```
3. Rename the `configuration.nix` to `default.nix`.
- Create a `metadata.toml` file with a `channel` field
- where the value is the key of a channel pinned in `npins/sources.json`.
+ Add the host to `channels.toml`, mapping the hostname to the key of a channel pinned in `npins/sources.json`.
+
A new channel can be pinned with:
```
diff --git a/nixos/channels.toml b/nixos/channels.toml
new file mode 100644
index 0000000..577063c
--- /dev/null
+++ b/nixos/channels.toml
@@ -0,0 +1,6 @@
+# Maps hostnames to Nixpkgs channels pinned in npins/sources.json.
+# The channel determines the Nixpkgs source, whose evaluation is passed as pkgs.
+
+ev = "nixos-small"
+hamac = "nixos"
+tente = "nixos-small"
diff --git a/nixos/hosts/ev/metadata.toml b/nixos/hosts/ev/metadata.toml
deleted file mode 100644
index 58f0301..0000000
--- a/nixos/hosts/ev/metadata.toml
+++ /dev/null
@@ -1 +0,0 @@
-channel = "nixos-small"
diff --git a/nixos/hosts/hamac/metadata.toml b/nixos/hosts/hamac/metadata.toml
deleted file mode 100644
index fc34e27..0000000
--- a/nixos/hosts/hamac/metadata.toml
+++ /dev/null
@@ -1 +0,0 @@
-channel = "nixos"
diff --git a/nixos/hosts/tente/metadata.toml b/nixos/hosts/tente/metadata.toml
deleted file mode 100644
index 58f0301..0000000
--- a/nixos/hosts/tente/metadata.toml
+++ /dev/null
@@ -1 +0,0 @@
-channel = "nixos-small"
diff --git a/nixos/rebuild b/nixos/rebuild
index d6a06a8..bb44fe8 100755
--- a/nixos/rebuild
+++ b/nixos/rebuild
@@ -32,8 +32,8 @@ nixpkgsPath=$(
--expr '
{ host }:
let
- toml = builtins.readFile ./hosts/${host}/metadata.toml;
- channel = (builtins.fromTOML toml).channel;
+ toml = builtins.readFile ./channels.toml;
+ channel = (builtins.fromTOML toml).${host};
in
(import ./npins).${channel}.outPath
'