From d0f4bcdc2d5249368eaae452a43a7b668f6744fd Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Sat, 10 Oct 2026 07:46:57 +0200 Subject: refactor: merge channel config to channels.toml --- nixos/README.md | 4 ++-- nixos/channels.toml | 6 ++++++ nixos/hosts/ev/metadata.toml | 1 - nixos/hosts/hamac/metadata.toml | 1 - nixos/hosts/tente/metadata.toml | 1 - nixos/rebuild | 4 ++-- 6 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 nixos/channels.toml delete mode 100644 nixos/hosts/ev/metadata.toml delete mode 100644 nixos/hosts/hamac/metadata.toml delete mode 100644 nixos/hosts/tente/metadata.toml 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 ' -- cgit v1.3.1