mirror of
https://github.com/matter-labs/teepot.git
synced 2025-07-21 07:03:56 +02:00
feat(tdx): add nix build for TDX google VMs
Signed-off-by: Harald Hoyer <harald@matterlabs.dev>
This commit is contained in:
parent
8270c389e4
commit
dc1e756ec6
11 changed files with 638 additions and 16 deletions
3
lib/default.nix
Normal file
3
lib/default.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{ ... }: {
|
||||
nixosGenerate = import ./nixos-generate.nix;
|
||||
}
|
33
lib/nixos-generate.nix
Normal file
33
lib/nixos-generate.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{ pkgs
|
||||
, nixosSystem
|
||||
, formatModule
|
||||
, system
|
||||
, specialArgs ? { }
|
||||
, modules ? [ ]
|
||||
}:
|
||||
let
|
||||
image = nixosSystem {
|
||||
inherit pkgs specialArgs;
|
||||
modules =
|
||||
[
|
||||
formatModule
|
||||
(
|
||||
{ lib, ... }: {
|
||||
options = {
|
||||
fileExtension = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Declare the path of the wanted file in the output directory";
|
||||
default = "";
|
||||
};
|
||||
formatAttr = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Declare the default attribute to build";
|
||||
};
|
||||
};
|
||||
}
|
||||
)
|
||||
]
|
||||
++ modules;
|
||||
};
|
||||
in
|
||||
image.config.system.build.${image.config.formatAttr}
|
Loading…
Add table
Add a link
Reference in a new issue