forked from clan/clan-core
templates: add minimal clan flake template for (G)UI
This commit is contained in:
parent
6e3c2506c9
commit
e7995ad344
@ -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;
|
||||
}
|
||||
|
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