réorganisation du fichier
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
# exemple utilisé pour commencer bird.nix
|
||||||
let
|
let
|
||||||
inherit (lib) mkEnableOption mkIf mkMerge mkOption singleton types;
|
inherit (lib) mkEnableOption mkIf mkMerge mkOption singleton types;
|
||||||
cfg = config.r6d.config-generator;
|
cfg = config.r6d.config-generator;
|
||||||
@@ -23,20 +24,20 @@ in
|
|||||||
#* Utilisé pour afecter des capacités aux machines
|
#* Utilisé pour afecter des capacités aux machines
|
||||||
r6d.profiles = {
|
r6d.profiles = {
|
||||||
# Domaine
|
# Domaine
|
||||||
isDubronetwork = mkEnableOption "Pour distinguer les machines dubronetwork";
|
isDubronetwork = mkEnableOption "Pour distinguer les machines dubronetwork.";
|
||||||
isPrunetwork = mkEnableOption "Pour distinguer les machines prunetwork";
|
isPrunetwork = mkEnableOption "Pour distinguer les machines prunetwork.";
|
||||||
# Utilisation machine
|
# Utilisation machine
|
||||||
isServer = mkEnableOption "Pour indiquer qu'il s'agit d'un serveur";
|
|
||||||
isDesktop = mkEnableOption "Pour indiquer une machine avec interface graphique.";
|
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
|
#* Utilisé dans les fichiers .nix
|
||||||
r6d.config-generator = {
|
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.";
|
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.";
|
jeux = mkEnableOption "Profil pour les jeux vidéos.";
|
||||||
laptop = mkEnableOption "Profil pour les outils spécifiques aux ordinateurs portables..";
|
laptop = mkEnableOption "Profil pour les outils spécifiques aux ordinateurs portables..";
|
||||||
locate = mkEnableOption "Profil pour activer la fonction locate.";
|
locate = mkEnableOption "Profil pour activer la fonction locate.";
|
||||||
@@ -57,7 +58,42 @@ in
|
|||||||
r6d.config-generator.enable = true;
|
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
|
## Affectation des profils aux machines
|
||||||
(mkIf (host == "radx.prunetwork.fr") {
|
(mkIf (host == "radx.prunetwork.fr") {
|
||||||
r6d.profiles.isHome = true;
|
r6d.profiles.isHome = true;
|
||||||
@@ -96,35 +132,5 @@ in
|
|||||||
r6d.profiles.isHome = true;
|
r6d.profiles.isHome = true;
|
||||||
r6d.profiles.isWorkstation = 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;
|
|
||||||
})
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user