initial commit
This commit is contained in:
commit
95085a0d24
16 changed files with 294 additions and 0 deletions
21
modules/common/default.nix
Normal file
21
modules/common/default.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./users.nix
|
||||
];
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
programs.htop.enable = true;
|
||||
|
||||
networking.domain = "v2.bytestall.info";
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
vim
|
||||
dig
|
||||
powertop
|
||||
];
|
||||
|
||||
}
|
||||
16
modules/common/users.nix
Normal file
16
modules/common/users.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{ ... }:
|
||||
{
|
||||
users = {
|
||||
mutableUsers = false;
|
||||
users.lzebulon = {
|
||||
isNormalUser = true;
|
||||
hashedPassword = "$y$j9T$l3Sr.4rBoWPTNx9AQNd6n0$rHprSWYdDIv0sjrMz1/47fZSboNL95/v43HZCbsuSM3";
|
||||
extraGroups = [ "wheel" ];
|
||||
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKCR6uatrqbCViftPwQ17JNVN8KBC02sPAOu+uRKGhLR lzebulon"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
8
modules/default.nix
Normal file
8
modules/default.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{...}:
|
||||
{
|
||||
imports = [
|
||||
./common
|
||||
];
|
||||
|
||||
nix.settings.experimental-features = [ "flakes" "nix-command" ];
|
||||
}
|
||||
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