1
0
forked from clan/clan-core

templates: add minimal clan flake template for (G)UI

This commit is contained in:
DavHau 2024-06-08 15:19:36 -07:00
parent 6e3c2506c9
commit e7995ad344
2 changed files with 36 additions and 1 deletions

View File

@ -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;
}

View File

@ -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;
};
}