diff --git a/docs/site/manual/migration-guide.md b/docs/site/manual/migration-guide.md index 551a3ef0e..d14637d04 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 = { @@ -99,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; + }; }; } ``` 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 {