forked from clan/clan-core
Merge pull request 'templates: add minimal clan flake template for (G)UI' (#1595) from DavHau/clan-core:DavHau-dave into main
This commit is contained in:
commit
ef42bcc525
@ -1,4 +1,4 @@
|
|||||||
{ self, ... }:
|
{ self, inputs, ... }:
|
||||||
{
|
{
|
||||||
flake.templates = {
|
flake.templates = {
|
||||||
new-clan = {
|
new-clan = {
|
||||||
@ -10,5 +10,26 @@
|
|||||||
path = ./empty;
|
path = ./empty;
|
||||||
};
|
};
|
||||||
default = self.templates.new-clan;
|
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;
|
||||||
}
|
}
|
||||||
|
14
templates/minimal/flake.nix
Normal file
14
templates/minimal/flake.nix
Normal 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;
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user