diff --git a/clanServices/syncthing/flake-module.nix b/clanServices/syncthing/flake-module.nix index 63368048d..64afbda26 100644 --- a/clanServices/syncthing/flake-module.nix +++ b/clanServices/syncthing/flake-module.nix @@ -22,6 +22,7 @@ in ../../clanServices/syncthing # Required modules ../../nixosModules/clanCore + ../../nixosModules/machineModules # Dependencies like clan-cli ../../pkgs/clan-cli ]; diff --git a/clanServices/zerotier/flake-module.nix b/clanServices/zerotier/flake-module.nix index 78933d589..49b36f770 100644 --- a/clanServices/zerotier/flake-module.nix +++ b/clanServices/zerotier/flake-module.nix @@ -21,6 +21,7 @@ in ../../clanServices/zerotier # Required modules ../../nixosModules/clanCore + ../../nixosModules/machineModules # Dependencies like clan-cli ../../pkgs/clan-cli ]; diff --git a/lib/inventory/distributed-service/flake-module.nix b/lib/inventory/distributed-service/flake-module.nix index 621e069f7..8cddb90ba 100644 --- a/lib/inventory/distributed-service/flake-module.nix +++ b/lib/inventory/distributed-service/flake-module.nix @@ -21,6 +21,7 @@ in ../../../flakeModules ../../../lib ../../../nixosModules/clanCore + ../../../nixosModules/machineModules ../../../machines ../../../inventory.json ../../../modules diff --git a/modules/clan/default.nix b/modules/clan/default.nix index af742cbcc..8a55c44a0 100644 --- a/modules/clan/default.nix +++ b/modules/clan/default.nix @@ -6,7 +6,7 @@ inherit (clan-core) clanLib; }; imports = [ + ./top-level-interface.nix ./module.nix - ./interface.nix ]; } diff --git a/modules/clan/module.nix b/modules/clan/module.nix index cdd616b40..ab433b68a 100644 --- a/modules/clan/module.nix +++ b/modules/clan/module.nix @@ -100,7 +100,7 @@ let _: machine: machine.extendModules { modules = [ - (lib.modules.importApply ../machineModules/overridePkgs.nix { + (lib.modules.importApply ../../nixosModules/machineModules/overridePkgs.nix { pkgs = pkgsFor.${system}; }) ]; @@ -167,6 +167,9 @@ in { ... }@args: let _class = + # _class was added in https://github.com/NixOS/nixpkgs/pull/395141 + # Clan relies on it to determine which modules to load + # people need to use at least that version of nixpkgs args._class or (throw '' Your version of nixpkgs is incompatible with the latest clan. Please update nixpkgs input to the latest nixos-unstable or nixpkgs-unstable. @@ -176,7 +179,7 @@ in in { imports = [ - (lib.modules.importApply ../machineModules/forName.nix { + (lib.modules.importApply ../../nixosModules/machineModules/forName.nix { inherit (config.inventory) meta; inherit name diff --git a/modules/clan/templates.nix b/modules/clan/templates.nix index 91042f821..84c24791b 100644 --- a/modules/clan/templates.nix +++ b/modules/clan/templates.nix @@ -1,3 +1,28 @@ +/** + The templates submodule + + 'clan.templates' + + Different kinds supported: + + - clan templates: 'clan.templates.clan' + - disko templates: 'clan.templates.disko' + - machine templates: 'clan.templates.machine' + + A template has the form: + + ```nix + { + description: string; # short summary what the template contains + path: path; # path to the template + } + ``` + + The clan API copies the template from the given 'path' + into a target folder. For example, + + `./machines/` for 'machine' templates. +*/ { lib, ... diff --git a/modules/clan/interface.nix b/modules/clan/top-level-interface.nix similarity index 100% rename from modules/clan/interface.nix rename to modules/clan/top-level-interface.nix diff --git a/modules/machineModules/forName.nix b/nixosModules/machineModules/forName.nix similarity index 92% rename from modules/machineModules/forName.nix rename to nixosModules/machineModules/forName.nix index 361f58dfb..a485f2c60 100644 --- a/modules/machineModules/forName.nix +++ b/nixosModules/machineModules/forName.nix @@ -3,6 +3,7 @@ directory, meta, }: +# The following is a nixos/darwin module { _class, lib, diff --git a/modules/machineModules/overridePkgs.nix b/nixosModules/machineModules/overridePkgs.nix similarity index 100% rename from modules/machineModules/overridePkgs.nix rename to nixosModules/machineModules/overridePkgs.nix