diff --git a/templates/flake-module.nix b/templates/flake-module.nix index 4f5c842e..a20ebd3b 100644 --- a/templates/flake-module.nix +++ b/templates/flake-module.nix @@ -1,4 +1,4 @@ -{ self, ... }: +{ self, inputs, ... }: { flake.templates = { new-clan = { @@ -10,5 +10,26 @@ path = ./empty; }; default = self.templates.new-clan; + minimal = { + description = "for clans managed via (G)UI"; + path = ./minimal; + }; }; + flake.checks.x86_64-linux.template-minimal = + let + path = self.templates.minimal.path; + initialized = inputs.nixpkgs.legacyPackages.x86_64-linux.runCommand "minimal-clan-flake" { } '' + mkdir $out + cp -r ${path}/* $out + mkdir -p $out/machines/foo + echo '{ "nixpkgs": { "hostPlatform": "x86_64-linux" } }' > $out/machines/foo/settings.json + ''; + evaled = (import "${initialized}/flake.nix").outputs { + self = evaled // { + outPath = initialized; + }; + clan-core = self; + }; + in + evaled.nixosConfigurations.foo.config.system.build.vm; } diff --git a/templates/minimal/flake.nix b/templates/minimal/flake.nix new file mode 100644 index 00000000..78301b9c --- /dev/null +++ b/templates/minimal/flake.nix @@ -0,0 +1,14 @@ +{ + inputs.clan-core.url = "git+https://git.clan.lol/clan/clan-core"; + + outputs = + { self, clan-core, ... }: + let + # Usage see: https://docs.clan.lol + clan = clan-core.lib.buildClan { directory = self; }; + in + { + # all machines managed by Clan + inherit (clan) nixosConfigurations clanInternals; + }; +}