initial commit

This commit is contained in:
Lzebulon 2025-08-06 00:18:58 +02:00
commit 95085a0d24
Signed by: lzebulon
GPG key ID: D6CDAB8050CBBE7D
16 changed files with 294 additions and 0 deletions

View 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
View 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
View file

@ -0,0 +1,8 @@
{...}:
{
imports = [
./common
];
nix.settings.experimental-features = [ "flakes" "nix-command" ];
}

View 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 { };
}

View 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
'';
};
};
};
}