From 7493ab3e59bf23acd28abbc1a1ba587c7c9946c4 Mon Sep 17 00:00:00 2001 From: Brian McGee Date: Mon, 31 Mar 2025 10:40:47 +0100 Subject: [PATCH 1/3] fix(docs): correct flake sample in migration guide diff --git a/docs/site/manual/migration-guide.md b/docs/site/manual/migration-guide.md index 551a3ef0..38be9a0e 100644 --- a/docs/site/manual/migration-guide.md +++ b/docs/site/manual/migration-guide.md @@ -77,13 +77,18 @@ For the provide flake example, your flake should now look like this: ```nix { inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + + inputs.clan-core = { + url = "git+https://git.clan.lol/clan/clan-core"; + inputs.nixpkgs.follows = "nixpkgs"; + }; - outputs = { self, nixpkgs, ... }: + outputs = { self, nixpkgs, clan-core, ... }: let clan = clan-core.lib.buildClan { self = self; # this needs to point at the repository root specialArgs = {}; - inventory.meta.name = "NEEDS_TO_BE_UNIQUE"; # TODO: Changeme + meta.name = throw "Change me to something unique"; machines = { berlin = { --- docs/site/manual/migration-guide.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/site/manual/migration-guide.md b/docs/site/manual/migration-guide.md index 551a3ef0e..38be9a0e2 100644 --- a/docs/site/manual/migration-guide.md +++ b/docs/site/manual/migration-guide.md @@ -77,13 +77,18 @@ For the provide flake example, your flake should now look like this: ```nix { inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + + inputs.clan-core = { + url = "git+https://git.clan.lol/clan/clan-core"; + inputs.nixpkgs.follows = "nixpkgs"; + }; - outputs = { self, nixpkgs, ... }: + outputs = { self, nixpkgs, clan-core, ... }: let clan = clan-core.lib.buildClan { self = self; # this needs to point at the repository root specialArgs = {}; - inventory.meta.name = "NEEDS_TO_BE_UNIQUE"; # TODO: Changeme + meta.name = throw "Change me to something unique"; machines = { berlin = { From 0c7cf305e2b132eabdb5daefecc472d7c65012b1 Mon Sep 17 00:00:00 2001 From: Brian McGee Date: Mon, 31 Mar 2025 10:50:57 +0100 Subject: [PATCH 2/3] fix(docs): tighten up validation for meta.name and improved description --- lib/inventory/build-inventory/meta-interface.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/inventory/build-inventory/meta-interface.nix b/lib/inventory/build-inventory/meta-interface.nix index d062f72d0..558201234 100644 --- a/lib/inventory/build-inventory/meta-interface.nix +++ b/lib/inventory/build-inventory/meta-interface.nix @@ -4,11 +4,14 @@ let metaOptions = { name = lib.mkOption { - type = types.str; + type = types.strMatching "[a-zA-Z0-9_-]*"; + example = "my_clan"; description = '' Name of the clan. Needs to be (globally) unique, as this determines the folder name where the flake gets downloaded to. + + Should only contain alphanumeric characters, `_` and `-`. ''; }; description = lib.mkOption { From 9d6dfbd3e96d93bdf126a840783445318f11c181 Mon Sep 17 00:00:00 2001 From: Brian McGee Date: Mon, 31 Mar 2025 11:58:28 +0100 Subject: [PATCH 3/3] fix(docs): add the requirement to export clan.templates in flake outputs to migration guide --- docs/site/manual/migration-guide.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/site/manual/migration-guide.md b/docs/site/manual/migration-guide.md index 38be9a0e2..d14637d04 100644 --- a/docs/site/manual/migration-guide.md +++ b/docs/site/manual/migration-guide.md @@ -104,7 +104,12 @@ For the provide flake example, your flake should now look like this: in { nixosConfigurations = clan.nixosConfigurations; + inherit (clan) clanInternals; + + clan = { + inherit (clan) templates; + }; }; } ```