initial commit
This commit is contained in:
commit
95085a0d24
16 changed files with 294 additions and 0 deletions
27
modules/virtual/default.nix
Normal file
27
modules/virtual/default.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{ lib
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.virtualMachines;
|
||||
in
|
||||
{
|
||||
options.virtualMachines = {
|
||||
enable = mkEnableOption "Enable Module";
|
||||
|
||||
vmHost = mkOption {
|
||||
type = with types; attrsOf (submodule (import ./vm-options.nix { inherit cfg; }));
|
||||
default = { };
|
||||
example = literalExpression ''
|
||||
Todo
|
||||
'';
|
||||
description = ''
|
||||
Declaration d'une vm
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable { };
|
||||
|
||||
}
|
||||
37
modules/virtual/vm-options.nix
Normal file
37
modules/virtual/vm-options.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{ cfg }:
|
||||
{ config
|
||||
, lib
|
||||
, name
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
inherit (lib) literalExpression mkOption types;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
vmid = mkOption {
|
||||
type = types.int;
|
||||
description = "id de la vm";
|
||||
};
|
||||
|
||||
networking = {
|
||||
macAddress = mkOption {
|
||||
type = with types; listOf str;
|
||||
example = [ "02:00:00:00:00:00" ];
|
||||
description = ''
|
||||
Mac adresse de l'interface reseau de la vm.
|
||||
Les mac adresses safes sont les suivantes :
|
||||
|
||||
x2:xx:xx:xx:xx:xx
|
||||
x6:xx:xx:xx:xx:xx
|
||||
xA:xx:xx:xx:xx:xx
|
||||
xE:xx:xx:xx:xx:xx
|
||||
|
||||
avec x n'importe quel valeur
|
||||
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue