Compare commits

..

15 Commits

6 changed files with 104 additions and 0 deletions

View File

@@ -42,6 +42,8 @@ in
edition-photo = mkEnableOption "Profil pour la création/édition de photos.";
edition-video = mkEnableOption "Profil pour la création/édition de video.";
fail2ban = mkEnableOption "Profil pour activer Fail2ban.";
hydra-builder = mkEnableOption "Profil pour une machine qui compile pour hydra.";
hydra-core = mkEnableOption "Profil pour un serveur hydra.";
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.";
@@ -181,6 +183,8 @@ in
};
r6d.config-generator = {
hydra-builder = true;
hydra-core = true;
print = true;
virtualbox = true;
};

View File

@@ -16,3 +16,8 @@ case "$TERM" in
xterm) TERM=xterm-256color;;
screen) TERM=screen-256color;;
esac
# info gnupg, invocate gpg agent
GPG_TTY=$(tty)
export GPG_TTY

View File

@@ -42,6 +42,7 @@ in
p7zip # compression de fichier
parted # partitionnement de disque
pciutils
pinentry # pour taper les mots de passe gpg
psmisc # fournis les utilitaires comme killall, fuser, pstree
python # python -- python -m SimpleHTTPServer 8000
python34Packages.glances # monitoring
@@ -56,6 +57,7 @@ in
];
shellAliases = {
byobu = "byobu-tmux";
gpg = "gpg2";
jacques-a-dit = "sudo";
tree = "tree -C";
tree1 = "tree -d -L 1";

View File

@@ -34,6 +34,8 @@ in
./auto-upgrade.nix # mise à jour automatique du système
./laptop.nix # appli & configuration adaptée pour un PC portable
./print.nix # configuration de base de cups
./service-hydra-build.nix # service de construction de paquet. -> la machine compile des paquets
./service-hydra-core.nix # service pour l'instance d'hydra
./service-laptop.nix # services spécifiques aux pc portables
./service-locate.nix # service locate
./swap.nix # définition de l'utilisation du swap

View File

@@ -0,0 +1,31 @@
{ config, lib, pkgs, ... }:
let
inherit (lib) mkIf mkMerge mkThenElse;
cfg = config.r6d.config-generator;
computers = config.r6d.computers;
profiles = config.r6d.profiles;
in
mkIf cfg.hydra-builder {
# Paquets
environment.systemPackages = with pkgs; [
];
# Services
virtualisation.virtualbox.host.enable = true;
nix.gc.automatic = true;
users.users."hydrabld" = {
description = "Execution des job hydra";
group = "nixbld";
isNormalUser = false;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGYpjcWJCf8dXpv2LmoIaNVbwZXEC50QUU6Az+lqeD89 hydra radx"
];
};
}

View File

@@ -0,0 +1,60 @@
{ config, lib, pkgs, ... }:
let
inherit (lib) mkIf mkMerge mkThenElse;
cfg = config.r6d.config-generator;
computers = config.r6d.computers;
profiles = config.r6d.profiles;
in
mkIf cfg.hydra-core {
# Paquets
environment.systemPackages = with pkgs; [
];
# Services
## Hydra
# 2. créer un utilisateur pour gérer hydra
# su - hydra
# hydra-create-user jpierre03 --password xxx --role 'admin'
services.hydra = {
enable = true;
hydraURL = "http://hydra.${config.networking.hostName}";
notificationSender = "hydra@${config.networking.hostName}";
listenHost = "localhost";
minimumDiskFree = 50; # Go
};
## Ménage
#nix.gc.automatic = true;
## Délégation des actions de compilation à la compilefarm
### Machines connues
# 2. récupérer la clef publique du serveur ssh : ssh-keyscan localhost + l'ajouter dans les knownHosts
programs.ssh.knownHosts = {
"monstre.dubronetwork.fr".publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBTTrLhq1Cwm0rpnwEIxSLqVrJWZnt+/9dt+SKd8NiIc";
"pedro.dubronetwork.fr".publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM7fjo2ysLqlfSo6BKnc6I6m1ayoPrbwEEyTKZmUzsOD";
"ocean.prunetwork.fr".publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINCaRuTl8iCTUE4XInOpkSlwQj5Re4w4Iq+gNIlJe8pA";
"radx.prunetwork.fr".publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGyoXdTEnxSgZTMfRfVH+bpOGZJtJpydAijcRGsZik7U";
"rollo.dubronetwork.fr".publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID4lWgS/sVdcZvnAAN+lBSOcCL9ISdAUsjp1kh9lalNu";
};
# une fois installé :
# 1. créer chef SSH : ssh-keygen -C "hydra@pedro.dubronetwork.fr" -N "" -f /etc/nixos/id_buildfarm
# ssh-keygen -t ed25519 -C "hydra MACHINE" -f /etc/nixos/hydra-ssh-key
# accessible à hydra.pedro.dubnronetwork.fr
nix = {
distributedBuilds = true;
buildMachines = [
# { hostName = "pedro.dubronetwork.fr"; maxJobs = 2; speedFactor = 10; sshKey = "/etc/nixos/id_buildfarm"; sshUser = "root"; system = "x86_64-linux"; }
];
extraOptions = "auto-optimise-store = true";
};
}