cli: default template url should come from the package itself rather than our gitea
This allow easier testing and also forks.
This commit is contained in:
@@ -1,35 +1,26 @@
|
||||
{ self, inputs, ... }:
|
||||
{
|
||||
flake.templates = {
|
||||
new-clan = {
|
||||
description = "Initialize a new clan flake";
|
||||
path = ./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;
|
||||
flake = (import ./flake.nix).outputs {} // {
|
||||
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;
|
||||
};
|
||||
clan-core = self;
|
||||
in
|
||||
{
|
||||
type = "derivation";
|
||||
name = "minimal-clan-flake-check";
|
||||
inherit (evaled.nixosConfigurations.foo.config.system.build.vm) drvPath outPath;
|
||||
};
|
||||
in
|
||||
{
|
||||
type = "derivation";
|
||||
name = "minimal-clan-flake-check";
|
||||
inherit (evaled.nixosConfigurations.foo.config.system.build.vm) drvPath outPath;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
16
templates/flake.nix
Normal file
16
templates/flake.nix
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
outputs =
|
||||
{ ... }:
|
||||
{
|
||||
templates = {
|
||||
default = {
|
||||
description = "Initialize a new clan flake";
|
||||
path = ./new-clan;
|
||||
};
|
||||
minimal = {
|
||||
description = "for clans managed via (G)UI";
|
||||
path = ./minimal;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user