réorganisation du fichier

extraction-donnees-privees
Jean-Pierre PRUNARET 9 years ago
parent 021f6499f9
commit e3d982a1fd

@ -1,5 +1,6 @@
{ config, lib, pkgs, ... }:
# exemple utilisé pour commencer bird.nix
let
inherit (lib) mkEnableOption mkIf mkMerge mkOption singleton types;
cfg = config.r6d.config-generator;
@ -23,20 +24,20 @@ in
#* Utilisé pour afecter des capacités aux machines
r6d.profiles = {
# Domaine
isDubronetwork = mkEnableOption "Pour distinguer les machines dubronetwork";
isPrunetwork = mkEnableOption "Pour distinguer les machines prunetwork";
isDubronetwork = mkEnableOption "Pour distinguer les machines dubronetwork.";
isPrunetwork = mkEnableOption "Pour distinguer les machines prunetwork.";
# Utilisation machine
isServer = mkEnableOption "Pour indiquer qu'il s'agit d'un serveur";
isDesktop = mkEnableOption "Pour indiquer une machine avec interface graphique.";
isWorkstation = mkEnableOption "Pour indiquer que la machine sert à travailler";
isHome = mkEnableOption "Pour indiquer que la machine sert à la maison (divertissement & autre)";
isHome = mkEnableOption "Pour indiquer que la machine sert à la maison (divertissement & autre).";
isServer = mkEnableOption "Pour indiquer qu'il s'agit d'un serveur.";
isWorkstation = mkEnableOption "Pour indiquer que la machine sert à travailler.";
};
#* Utilisé dans les fichiers .nix
r6d.config-generator = {
enable = mkEnableOption "Generation de la configuration d'une machine";
enable = mkEnableOption "Génération de la configuration d'une machine.";
auto-upgrade = mkEnableOption "Profil pour activer les mises à jour automatiques.";
docker = mkEnableOption "Profil pour l'utilisation de Docker";
docker = mkEnableOption "Profil pour l'utilisation de Docker.";
jeux = mkEnableOption "Profil pour les jeux vidéos.";
laptop = mkEnableOption "Profil pour les outils spécifiques aux ordinateurs portables..";
locate = mkEnableOption "Profil pour activer la fonction locate.";
@ -57,7 +58,42 @@ in
r6d.config-generator.enable = true;
}
# Conditional stuff.
# Conditional stuff
## Définition des profils génériques
(mkIf pfl.isDesktop {
})
(mkIf pfl.isHome {
r6d.profiles.isDesktop = true;
})
(mkIf pfl.isServer {
r6d.config-generator.nix-serve-server = true;
})
(mkIf pfl.isWorkstation {
r6d.profiles.isDesktop = true;
r6d.config-generator.docker = true;
})
(mkIf pfl.isDubronetwork {
r6d.config-generator.auto-upgrade = true;
r6d.config-generator.nix-serve-client = true;
})
(mkIf (pfl.isDubronetwork && pfl.isHome) {
r6d.config-generator.jeux = true;
})
(mkIf (pfl.isDubronetwork && pfl.isServer) {
r6d.config-generator.nix-serve-server = true;
})
(mkIf (pfl.isDubronetwork && pfl.isWorkstation) {
r6d.config-generator.nix-serve-server = true;
r6d.config-generator.virtualbox = true;
})
(mkIf pfl.isPrunetwork {
r6d.config-generator.auto-upgrade = true;
r6d.config-generator.swap = true;
})
## Affectation des profils aux machines
(mkIf (host == "radx.prunetwork.fr") {
r6d.profiles.isHome = true;
@ -96,35 +132,5 @@ in
r6d.profiles.isHome = true;
r6d.profiles.isWorkstation = true;
})
## Contenu des Profils
(mkIf pfl.isHome {
r6d.profiles.isDesktop = true;
#r6d.config-generator.jeux = true;
})
(mkIf pfl.isServer {
r6d.config-generator.nix-serve-server = true;
})
(mkIf pfl.isWorkstation {
r6d.profiles.isDesktop = true;
r6d.config-generator.docker = true;
})
(mkIf pfl.isPrunetwork {
r6d.config-generator.auto-upgrade = true;
r6d.config-generator.swap = true;
})
(mkIf pfl.isDubronetwork {
r6d.config-generator.auto-upgrade = true;
r6d.config-generator.nix-serve-client = true;
})
(mkIf (pfl.isDubronetwork && pfl.isServer) {
r6d.config-generator.nix-serve-server = true;
})
(mkIf (pfl.isDubronetwork && pfl.isWorkstation) {
r6d.config-generator.nix-serve-server = true;
r6d.config-generator.virtualbox = true;
})
];
}

Loading…
Cancel
Save