diff options
| author | Martin Fischer <martin@push-f.com> | 2026-10-10 07:46:57 +0200 |
|---|---|---|
| committer | Martin Fischer <martin@push-f.com> | 2026-10-11 14:40:57 +0200 |
| commit | b5745bceb059a59eefd396d08a094b7eddfd6569 (patch) | |
| tree | 173f79d8aaf3970990db6d553ddd5cfc4ccd1fc1 /nixos | |
| parent | 36a954ef72f119793bbbbc419428a2716cd3464e (diff) | |
refactor: merge channel config to channels.toml
Diffstat (limited to 'nixos')
| -rw-r--r-- | nixos/README.md | 4 | ||||
| -rw-r--r-- | nixos/channels.toml | 6 | ||||
| -rw-r--r-- | nixos/hosts/ev/metadata.toml | 1 | ||||
| -rw-r--r-- | nixos/hosts/hamac/metadata.toml | 1 | ||||
| -rw-r--r-- | nixos/hosts/tente/metadata.toml | 1 | ||||
| -rwxr-xr-x | nixos/rebuild | 4 |
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 ' |
