Compare commits
35 Commits
2017-05-19
...
2017-08-28
| Author | SHA1 | Date | |
|---|---|---|---|
| b1a19b811d | |||
| dfe2bde371 | |||
| b8106deb18 | |||
| cc2f1c33af | |||
| 19bd8fbfbc | |||
|
|
630217ce02 | ||
|
|
dcdaf91f8b | ||
|
|
5803fdbbff | ||
|
|
dcae05d4c0 | ||
|
|
196cc008c8 | ||
|
|
fcc1cba9fb | ||
| f8a687be52 | |||
| 28fc448e0c | |||
|
|
195f5e35a1 | ||
| ad0799f08d | |||
|
|
4dbcc8ddc0 | ||
|
|
3a5ae68f3a | ||
| 772cab2253 | |||
| 92bf72c7bf | |||
| 60f466a887 | |||
| eca3d77610 | |||
| 78ece5641d | |||
| cc851a7946 | |||
| aa22c6337d | |||
| acacc94903 | |||
| 1f480bbbff | |||
|
|
ac91ce4492 | ||
|
|
c43adc80cb | ||
|
|
745d2cd171 | ||
|
|
259a1a0aa6 | ||
|
|
854eed9227 | ||
| 8ee09217cb | |||
| b15672c3ad | |||
| ab1d364327 | |||
| 67eadfab97 |
7
Makefile
7
Makefile
@@ -15,6 +15,7 @@ clean-total:
|
||||
$(TIME) nix-collect-garbage -d
|
||||
|
||||
clean-log:
|
||||
journalctl --flush --rotate
|
||||
journalctl --vacuum-size=1G
|
||||
|
||||
full-auto: submodules-update upgrade clean optimise
|
||||
@@ -23,9 +24,15 @@ full-auto: submodules-update upgrade clean optimise
|
||||
optimise:
|
||||
$(TIME) nix-store --optimise
|
||||
|
||||
rebuild-build:
|
||||
$(TIME) time nixos-rebuild build --fallback --show-trace
|
||||
|
||||
rebuild-switch:
|
||||
$(TIME) time nixos-rebuild switch --fallback --show-trace
|
||||
|
||||
show-diff-with-current:
|
||||
-diff /run/current-system/configuration.nix /etc/nixos/configuration.nix
|
||||
|
||||
show-roots:
|
||||
nix-store --gc --print-roots
|
||||
|
||||
|
||||
15
README.md
15
README.md
@@ -1,24 +1,29 @@
|
||||
# nixos-template-base
|
||||
|
||||
Versions de NixOS supportées :
|
||||
* NixOS 16.09
|
||||
* NixOS unstable
|
||||
|
||||
Ce dépôt stocke une configuration générique des machines.
|
||||
Une recette dite "config-generator" adapte la configuration selon le nom de la machine (FQDN).
|
||||
|
||||
Actuellement, les scripts contiennent un peu de configuration spécifique pour les machines des mainteneurs.
|
||||
~~Une recette dite "config-generator" adapte la configuration selon le nom de la machine (FQDN).~~
|
||||
|
||||
~~Actuellement, les scripts contiennent un peu de configuration spécifique pour les machines des mainteneurs.~~
|
||||
|
||||
# Liens
|
||||
* http://howoldis.herokuapp.com/ pour savoir de quand datent les différentes releases de NixOS
|
||||
* https://repology.org/repository/nix_unstable/problems pour lister les paquets avec problèmes
|
||||
|
||||
# Notes de mise-à-jour
|
||||
|
||||
## pour l'utilisation de l'annuaire (2017-04-28)
|
||||
## pour l'utilisation de l'annuaire (à partir de 2017-04-28)
|
||||
|
||||
* faire les mises à jour de l'OS
|
||||
* commiter & pusher l'état des dépôts (au cas où). Pour les différents dépôts `git a`, `git commit` puis `make tag push`
|
||||
* mettre à jour les dépôts avec les dernières versions, `make submodules-update`
|
||||
* vérifier que `configuration.nix` contient `services.xserver.enable = true;` pour les machines avec interface graphique
|
||||
* vérifier que `configuration.nix` contient le nom de la machine `networking.hostName = "<X>";`
|
||||
* tester la configuration : `nixos-rebuild build`
|
||||
* corriger et ajouter les éléments manquant (notamment dans `private/annuaire.nix` )
|
||||
* vérifier que `configuration.nix` contient `services.xserver.enable = true;` pour les machines avec interface graphique
|
||||
* lorsque tout semble bon, vérifier :
|
||||
* qu'il y a toujours des utilisateurs dans la configuration
|
||||
* que le moyen d'accéder à la machine n'a pas été supprimé (surtout les machines distantes)
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf flags.graphical {
|
||||
@@ -14,5 +14,8 @@ mkIf flags.graphical {
|
||||
# Gestion de FS
|
||||
gparted # Gestion graphique de partitions
|
||||
unetbootin # création de clefs USB bootables
|
||||
|
||||
# visualisation de log
|
||||
#logstalgia
|
||||
];
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf currentMachine.profiles.isDesktopEnvironment {
|
||||
@@ -24,12 +24,14 @@ mkIf currentMachine.profiles.isDesktopEnvironment {
|
||||
gnome3.adwaita-icon-theme # thème d'icone - semble fonctionner avec spaceFM
|
||||
|
||||
## Manipulation de fichier
|
||||
pcmanfm # gestionnaire de fichiers graphique
|
||||
spaceFM # gestionnaire de fichiers graphique
|
||||
#vifm # gestionnaire de fichiers basé sur VIM (console)
|
||||
#kde5.dolphin # gestionnaire de fichiers graphique
|
||||
#kde5.dolphin-plugins # gestionnaire de fichiers graphique
|
||||
pcmanfm # gestionnaire de fichiers graphique
|
||||
spaceFM # gestionnaire de fichiers graphique
|
||||
#vifm # gestionnaire de fichiers basé sur VIM (console)
|
||||
|
||||
## Terminal
|
||||
sakura # terminal
|
||||
sakura # terminal
|
||||
];
|
||||
|
||||
# Polices supplémentaires
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf (flags.officeSuite && flags.graphical) {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf (flags.conception-assistee && flags.graphical) {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf (flags.cartographie && flags.graphical) {
|
||||
|
||||
@@ -4,9 +4,9 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
# TODO: ménage
|
||||
|
||||
mkIf (flags.internetSuite && flags.graphical) {
|
||||
|
||||
# Paquets
|
||||
@@ -20,7 +20,6 @@ environment.systemPackages = with pkgs; [
|
||||
## Mail & Discussion (texte, audio)
|
||||
clawsMail
|
||||
hexchat
|
||||
quassel
|
||||
quasselClient
|
||||
mumble
|
||||
pidgin
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf (true && flags.graphical) {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
#inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf (flags.developpement-elm && flags.graphical) {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf (flags.developpement-haskell && flags.graphical) {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf (flags.developpement-java && flags.graphical) {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf (flags.jetbrains-licensed && flags.graphical) {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf (flags.developpement-rust && flags.graphical) {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf (flags.developpement && flags.graphical) {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf (flags.edition-musique && flags.graphical) {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf (flags.edition-photo && flags.graphical) {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf (flags.edition-video && flags.graphical) {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf (flags.jeux && flags.graphical) {
|
||||
|
||||
@@ -4,18 +4,13 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
# TODO ranger le spécifique pulseaudio
|
||||
mkIf (flags.multimediaSuite && flags.graphical) {
|
||||
|
||||
# Paquets
|
||||
environment.systemPackages = with pkgs; [
|
||||
## Audio
|
||||
paprefs # préferences pulseaudio
|
||||
pavucontrol # mixer pulseaudio
|
||||
|
||||
## Video
|
||||
smplayer # lecteur vidéo
|
||||
vlc # lecteur vidéo
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf (true && flags.graphical) {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf (flags.securitySuite && flags.graphical) {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf true {
|
||||
@@ -12,7 +12,9 @@ mkIf true {
|
||||
# Paquets
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Adminsys
|
||||
bind # utilisé pour les utilitaires comme dig
|
||||
cowsay # pour ansible & 4lulz
|
||||
dhcp # client dhcp
|
||||
iotop
|
||||
lm_sensors
|
||||
lshw
|
||||
@@ -27,6 +29,7 @@ mkIf true {
|
||||
|
||||
# Backup
|
||||
duplicity # création de sauvegarde chiffrées (GPG)
|
||||
par2cmdline # outil de récupération de fichiers corrompus - .par2
|
||||
|
||||
# Compression
|
||||
lz4
|
||||
@@ -47,7 +50,7 @@ mkIf true {
|
||||
|
||||
## Exploitation FS
|
||||
inotify-tools # être notifié lorsque le contenu d'un répertoire change
|
||||
detox # The detox utility renames files to make them easier to work with.
|
||||
detox # The detox utility renames files to make them easier to work with.
|
||||
duff # outil de recherche de fichiers en doublons
|
||||
rdfind # recherche de fichiers doublons pour remplacement par hard/soft link
|
||||
];
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf true {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf flags.officeSuite {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf flags.conception-assistee {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf flags.cartographie {
|
||||
|
||||
@@ -4,9 +4,9 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
# TODO: ménage
|
||||
|
||||
mkIf flags.internetSuite {
|
||||
|
||||
# Paquets
|
||||
@@ -15,13 +15,16 @@ environment.systemPackages = with pkgs; [
|
||||
|
||||
## Réseaux sociaux
|
||||
#python27Packages.turses # client twitter en ncurse
|
||||
python27Packages.rainbowstream # client twitter en console
|
||||
rtv # client reddit en console
|
||||
#python27Packages.rainbowstream # client twitter en console
|
||||
#rtv # client reddit en console
|
||||
|
||||
## Mail & Discussion (texte, audio)
|
||||
mutt
|
||||
|
||||
## Sauvegarde nuagique (cloud storage)
|
||||
rclone
|
||||
#rclone
|
||||
|
||||
## P2P
|
||||
rtorrent # outil de téléchargement de torrent & magnet
|
||||
];
|
||||
}
|
||||
|
||||
@@ -4,34 +4,27 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf true {
|
||||
|
||||
# Paquets
|
||||
environment.systemPackages = with pkgs; [
|
||||
bind # utilisé pour les utilitaires comme dig
|
||||
byobu # permet de se déconnecter d'un terminal sans l'aréter
|
||||
dhcp # client dhcp
|
||||
git gitAndTools.gitSVN gitAndTools.tig gti # outil de gestion de version
|
||||
byobu # permet de se déconnecter d'un terminal sans l'arréter
|
||||
git gitAndTools.tig gti # outil de gestion de version
|
||||
gnumake # pour décrire les recettes de compilation
|
||||
gnupg # GPG
|
||||
gpm # prise en charge de la souris en console
|
||||
htop # monitoring
|
||||
lsb-release # pour les scripts qui utilisent cet outil
|
||||
lsb-release # pour les scripts qui utilisent cet outil (dont byobu)
|
||||
#libressl # librairie pour faire du TLS et les algorithmes de crypto par OpenBSD
|
||||
ncdu # outil pour voir l'espace utilisé
|
||||
par2cmdline # outil de récupération de fichiers corrompus - .par2
|
||||
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
|
||||
pwgen # générateur de mot de passe
|
||||
rtorrent # TODO outil de téléchargement de torrent & magnet
|
||||
#python # python -- python -m SimpleHTTPServer 8000
|
||||
shared_mime_info # MIME info
|
||||
tmux # nécessaire pour byobu
|
||||
tree # affiche une arborescence de fichiers et dossiers
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
#inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf flags.developpement-elm {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf flags.developpement-haskell {
|
||||
@@ -18,17 +18,17 @@ mkIf flags.developpement-haskell {
|
||||
stack # pour les paquets en LTS de stackage
|
||||
] ++ (with pkgs.haskellPackages; [
|
||||
# Haskell lib
|
||||
autoproc # ? procmail
|
||||
darcs # Gestionnaire de version éponyme
|
||||
ghc-mod
|
||||
hindent # indentation code
|
||||
hlint # qualite de code, analyse statique de code + astuces & bonnes pratiques
|
||||
pandoc-filter-graphviz # filtre pour utiliser graphviz à partir de pandoc
|
||||
#postgrest # mapper HTTP <-> PostgreSQL
|
||||
stylish-haskell # qualité de code
|
||||
turtle # genre shell-scripting
|
||||
autoproc # ? procmail
|
||||
darcs # gestionnaire de version éponyme
|
||||
ghc-mod # outil d'analyse de code haskell utilisé par IDE
|
||||
hindent # indentation code
|
||||
hlint # qualite de code, analyse statique de code + astuces & bonnes pratiques
|
||||
postgrest # mapper HTTP <-> PostgreSQL
|
||||
stylish-haskell # qualité de code
|
||||
turtle # genre shell-scripting
|
||||
|
||||
# Application perso
|
||||
hahp
|
||||
pandoc-filter-graphviz # filtre pour utiliser graphviz à partir de pandoc
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf flags.developpement-java {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf flags.jetbrains-licensed {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf flags.developpement-rust {
|
||||
|
||||
@@ -4,26 +4,33 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf flags.developpement {
|
||||
|
||||
# Paquets
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Base de données
|
||||
pg_top # monitoring de PostgreSQL
|
||||
sqlite # le moteur de base de données
|
||||
|
||||
# C / C++
|
||||
gcc # pour les appels depuis les scripts
|
||||
gcc # pour les appels depuis les scripts
|
||||
|
||||
# Gestion des sources
|
||||
cloc # outil pour compter les lignes de code source
|
||||
git # déjà présent dans "base"
|
||||
cloc # outil pour compter les lignes de code source
|
||||
git gitAndTools.gitSVN # git et git-svn
|
||||
mercurial
|
||||
subversion
|
||||
|
||||
# spécification
|
||||
plantuml # diagrammes UML et plus si affinité
|
||||
|
||||
# Mono
|
||||
#mono46 # interpréteur .NET
|
||||
#mono46 # interpréteur .NET
|
||||
|
||||
## Visualisation & outils de diff
|
||||
#vbindiff # diff de fichier hexadecimaux avec vim
|
||||
#vbindiff # diff de fichier hexadecimaux avec vim
|
||||
];
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf flags.edition-musique {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf flags.edition-photo {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf flags.edition-video {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf flags.jeux {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf flags.multimediaSuite {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf true {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf flags.securitySuite {
|
||||
|
||||
@@ -8,29 +8,19 @@ let
|
||||
host = config.networking.hostName;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
{
|
||||
# TODO camel case partout
|
||||
# TODO everything in english
|
||||
# TODO sortir ce qui est privé
|
||||
# TODO portage du système d'annuaire de machines de capgemini
|
||||
###### interface
|
||||
|
||||
options = {
|
||||
#* Utilisé pour avoir des raccourcis de machine
|
||||
r6d.computers = {
|
||||
isHydra = mkEnableOption "Identification du nom de machine.";
|
||||
isLatitude = mkEnableOption "Identification du nom de machine.";
|
||||
isMonstre = mkEnableOption "Identification du nom de machine.";
|
||||
isNeoNomade = mkEnableOption "Identification du nom de machine.";
|
||||
isNomade = mkEnableOption "Identification du nom de machine.";
|
||||
isOcean = mkEnableOption "Identification du nom de machine.";
|
||||
isPedro = mkEnableOption "Identification du nom de machine.";
|
||||
isPhenom = mkEnableOption "Identification du nom de machine.";
|
||||
isRadx = mkEnableOption "Identification du nom de machine.";
|
||||
isRollo = mkEnableOption "Identification du nom de machine.";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -40,169 +30,18 @@ in
|
||||
config = mkMerge
|
||||
[
|
||||
## Définition des profils génériques
|
||||
(mkIf pfl.isDesktopEnvironment {
|
||||
r6d.config-generator = {
|
||||
awesome = true;
|
||||
internetSuite = true;
|
||||
multimediaSuite = true;
|
||||
officeSuite = true;
|
||||
pulseaudio = true;
|
||||
securitySuite = true;
|
||||
};
|
||||
})
|
||||
(mkIf (pfl.isServer && !comp.isMonstre) {
|
||||
r6d.config-generator = {
|
||||
#database_postgres = true;
|
||||
dns_autorite = true;
|
||||
#dns_resolveur = true;
|
||||
# inutile d'exposer la conf complète du serveur par le store tant qu'il n'y a pas de protection complémentaire - utilisation SSH ?
|
||||
#nix-serve-server = true;
|
||||
smokeping = true;
|
||||
|
||||
#rabbitmq = true;
|
||||
};
|
||||
})
|
||||
# /!\ PAS un serveur
|
||||
(mkIf (!pfl.isServer || comp.isMonstre) {
|
||||
r6d.config-generator = {
|
||||
dns_resolveur = true;
|
||||
};
|
||||
})
|
||||
(mkIf pfl.isWorkstation {
|
||||
r6d.profiles.isDesktopEnvironment = true;
|
||||
|
||||
r6d.config-generator = {
|
||||
docker = true;
|
||||
graphical = true;
|
||||
};
|
||||
})
|
||||
|
||||
## Profils liés à Dubronetwork
|
||||
(mkIf pfl.isDubronetwork {
|
||||
r6d.config-generator = {
|
||||
auto-upgrade = true;
|
||||
locate = true;
|
||||
print = true;
|
||||
};
|
||||
})
|
||||
(mkIf (pfl.isDubronetwork && pfl.isWorkstation) {
|
||||
r6d.config-generator = {
|
||||
cartographie = true;
|
||||
conception-assistee = true;
|
||||
docker = true;
|
||||
developpement = true;
|
||||
developpement-elm = true;
|
||||
developpement-haskell = true;
|
||||
developpement-java = true;
|
||||
developpement-rust = true;
|
||||
edition-musique = true;
|
||||
edition-photo = true;
|
||||
edition-video = true;
|
||||
scanner = true;
|
||||
virtualbox = true;
|
||||
xmonad = true;
|
||||
};
|
||||
})
|
||||
|
||||
## Profils liés à Prunetwork
|
||||
(mkIf pfl.isPrunetwork {
|
||||
r6d.config-generator = {
|
||||
auto-upgrade = true;
|
||||
docker = true;
|
||||
locate = true;
|
||||
fail2ban = true;
|
||||
smokeping = true;
|
||||
swap = true;
|
||||
};
|
||||
})
|
||||
(mkIf (pfl.isPrunetwork && pfl.isWorkstation) {
|
||||
r6d.config-generator = {
|
||||
cartographie = true;
|
||||
conception-assistee = true;
|
||||
docker = true;
|
||||
developpement = true;
|
||||
#developpement-elm = true;
|
||||
developpement-haskell = true;
|
||||
developpement-java = true;
|
||||
developpement-rust = true;
|
||||
edition-musique = true;
|
||||
edition-photo = true;
|
||||
edition-video = true;
|
||||
hydra-core = false; # DO NOT ENABLE ON WORKSTATION, YOU CAN CRASH YOUR SYSTEM
|
||||
print = true;
|
||||
scanner = true;
|
||||
#virtualbox = true;
|
||||
#xmonad = true;
|
||||
};
|
||||
})
|
||||
|
||||
|
||||
## Affectation des profils aux machines
|
||||
(mkIf comp.isOcean {
|
||||
networking.hostName = "ocean.prunetwork.fr"; # Define your hostname.
|
||||
r6d.profiles = {
|
||||
isPrunetwork = true;
|
||||
isServer = true;
|
||||
};
|
||||
|
||||
r6d.config-generator = {
|
||||
docker = true;
|
||||
hydra-builder = true;
|
||||
radicale = true;
|
||||
nix-serve-client = true;
|
||||
nix-serve-server = true;
|
||||
tincAddress = "192.168.12.6/24";
|
||||
tincExtraConfig = ''
|
||||
ConnectTo = hydra_prunetwork_fr
|
||||
ConnectTo = rollo_dubronetwork_fr
|
||||
'';
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf comp.isLatitude {
|
||||
networking.hostName = "latitude.dubronetwork.fr"; # Define your hostname.
|
||||
r6d.profiles = {
|
||||
isDubronetwork = true;
|
||||
isWorkstation = true;
|
||||
};
|
||||
|
||||
r6d.config-generator = {
|
||||
jetbrains-licensed = true;
|
||||
laptop = true;
|
||||
nix-serve-client = true;
|
||||
nix-serve-server = true;
|
||||
tincAddress = "192.168.12.2/24";
|
||||
tincExtraConfig = ''
|
||||
ConnectTo = monstre_dubronetwork_fr
|
||||
ConnectTo = rollo_dubronetwork_fr
|
||||
ConnectTo = hydra_prunetwork_fr
|
||||
ConnectTo = ocean_prunetwork_fr
|
||||
'';
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf comp.isNeoNomade{
|
||||
networking.hostName = "neo-nomade.dubronetwork.fr"; # Define your hostname.
|
||||
r6d.profiles = {
|
||||
isDubronetwork = true;
|
||||
isDesktopEnvironment = true;
|
||||
};
|
||||
|
||||
r6d.config-generator = {
|
||||
laptop = true;
|
||||
graphical = true;
|
||||
scanner = true;
|
||||
tincAddress = "192.168.12.7/24";
|
||||
tincExtraConfig = ''
|
||||
ConnectTo = monstre_dubronetwork_fr
|
||||
ConnectTo = rollo_dubronetwork_fr
|
||||
ConnectTo = hydra_prunetwork_fr
|
||||
ConnectTo = ocean_prunetwork_fr
|
||||
'';
|
||||
};
|
||||
})
|
||||
# Dubro Vivo - St Malo
|
||||
#tincAddress = "192.168.12.8/24";
|
||||
|
||||
(mkIf comp.isNomade{
|
||||
networking.hostName = "nomade.dubronetwork.fr"; # Define your hostname.
|
||||
r6d.profiles.isDubronetwork = true;
|
||||
@@ -211,60 +50,5 @@ in
|
||||
laptop = true;
|
||||
};
|
||||
})
|
||||
(mkIf comp.isPedro {
|
||||
r6d.profiles = {
|
||||
isDubronetwork = true;
|
||||
isServer = true;
|
||||
};
|
||||
|
||||
r6d.config-generator = {
|
||||
fail2ban = true;
|
||||
};
|
||||
})
|
||||
(mkIf comp.isPhenom {
|
||||
networking.hostName = "phenom.dubronetwork.fr"; # Define your hostname.
|
||||
r6d.profiles = {
|
||||
isDubronetwork = true;
|
||||
isWorkstation = true;
|
||||
};
|
||||
|
||||
r6d.config-generator = {
|
||||
jetbrains-licensed = true;
|
||||
#hydra-core = true;
|
||||
nix-serve-client = true;
|
||||
nix-serve-server = true;
|
||||
edition-photo = true;
|
||||
tincAddress = "192.168.12.1/24";
|
||||
tincExtraConfig = ''
|
||||
ConnectTo = monstre_dubronetwork_fr
|
||||
ConnectTo = rollo_dubronetwork_fr
|
||||
ConnectTo = hydra_prunetwork_fr
|
||||
ConnectTo = ocean_prunetwork_fr
|
||||
'';
|
||||
};
|
||||
})
|
||||
(mkIf comp.isRollo {
|
||||
networking.hostName = "rollo.dubronetwork.fr"; # Define your hostname.
|
||||
r6d.profiles = {
|
||||
isDubronetwork = true;
|
||||
isServer = true;
|
||||
};
|
||||
|
||||
r6d.config-generator = {
|
||||
dovecot = true;
|
||||
fail2ban = true;
|
||||
mailboxes = true;
|
||||
murmur = true;
|
||||
nix-serve-client = true;
|
||||
nix-serve-server = true;
|
||||
tincAddress = "192.168.12.5/24";
|
||||
tincExtraConfig = ''
|
||||
ConnectTo = hydra_prunetwork_fr
|
||||
ConnectTo = ocean_prunetwork_fr
|
||||
'';
|
||||
virtualbox = true;
|
||||
znc = true;
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf flags.auto-upgrade {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
# TODO: rc.lua par défaut (système)
|
||||
@@ -19,5 +19,7 @@ mkIf flags.awesome {
|
||||
# beautiful.init(config.dir .. "/share/awesome//themes/zenburn/theme.lua")
|
||||
#
|
||||
AWESOME_CONFIG_DIR = "${pkgs.awesome}";
|
||||
};
|
||||
};
|
||||
|
||||
environment.etc."xdg/awesome/rc.lua".text = builtins.readFile ./../public/config-awesome-4-rc.lua;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
#inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
{
|
||||
|
||||
@@ -4,10 +4,9 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
# TODO: ménage
|
||||
{
|
||||
# Nombre de process d'installation en parrallèle effectués par Nix
|
||||
nix.buildCores = 0;
|
||||
@@ -21,9 +20,6 @@ in
|
||||
# On autorise les paquets non-libres
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# Lancement de dbus pour les utilisateurs
|
||||
services.dbus.socketActivated = true;
|
||||
|
||||
# NixOS Hardening
|
||||
#security.grsecurity.enable = true;
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
# Logs
|
||||
lol = log --graph --decorate --pretty=oneline --abbrev-commit
|
||||
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
|
||||
not-pushed = log --branches --not --remotes
|
||||
[push]
|
||||
default = simple
|
||||
[core]
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf flags.laptop {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf true {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf true {
|
||||
@@ -23,6 +23,7 @@ mkIf true {
|
||||
"net.ipv6.conf.default.temp_valid_lft" = 3600; # 1 heure
|
||||
"net.ipv6.conf.default.use_tempaddr" = 2; # activé
|
||||
|
||||
# Activation du routage
|
||||
"net.ipv6.conf.all.forwarding" = true;
|
||||
"net.ipv6.conf.default.forwarding" = true;
|
||||
};
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf true {
|
||||
@@ -16,6 +16,7 @@ mkIf true {
|
||||
127.0.0.1 ${config.networking.hostName}
|
||||
'';
|
||||
|
||||
# Activation du routage
|
||||
boot.kernel.sysctl = {
|
||||
"net.ipv4.conf.all.forwarding" = true;
|
||||
"net.ipv4.conf.default.forwarding" = true;
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf flags.swap {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf false {
|
||||
|
||||
50
lib.nix
Normal file
50
lib.nix
Normal file
@@ -0,0 +1,50 @@
|
||||
let
|
||||
lib = with import <nixpkgs> {}; pkgs.lib;
|
||||
|
||||
profiles = {
|
||||
isDesktopEnvironment = {
|
||||
awesome = true;
|
||||
internetSuite = true;
|
||||
graphical = true;
|
||||
multimediaSuite = true;
|
||||
officeSuite = true;
|
||||
pulseaudio = true;
|
||||
securitySuite = true;
|
||||
};
|
||||
isWorkstation = {
|
||||
docker = true;
|
||||
developpement = true;
|
||||
developpement-elm = true;
|
||||
developpement-haskell = true;
|
||||
developpement-java = true;
|
||||
developpement-rust = true;
|
||||
};
|
||||
#isServer = {
|
||||
#};
|
||||
};
|
||||
|
||||
in
|
||||
|
||||
with lib; rec{
|
||||
# Apply the profiles (pre-defined + custom) to the whole directory
|
||||
applyProfilesToDirectory = customProfiles: directory:
|
||||
lib.mapAttrs (applyProfilesToMachine customProfiles) directory;
|
||||
|
||||
# Apply the profiles (pre-defined + custom) to a machine
|
||||
applyProfilesToMachine = customProfiles: machineName: machineOptions:
|
||||
{ configurationFlags = lib.recursiveUpdate (generateFlagsSet customProfiles machineOptions.profiles) machineOptions.configurationFlags;
|
||||
configurationOptions = machineOptions.configurationOptions;
|
||||
profiles = machineOptions.profiles;
|
||||
};
|
||||
|
||||
# Generate a set of configuration flags based on profiles
|
||||
generateFlagsSet = customProfiles: machineProfiles:
|
||||
let
|
||||
allProfiles = recursiveUpdate profiles customProfiles;
|
||||
conditionalFlags = name: value:
|
||||
if machineProfiles.${name}
|
||||
then value
|
||||
else {};
|
||||
in
|
||||
foldr (a: b: a // b) {} (mapAttrsToList conditionalFlags allProfiles);
|
||||
}
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf true {
|
||||
|
||||
40
options.nix
40
options.nix
@@ -6,7 +6,7 @@ let
|
||||
machineOptions = types.submodule {
|
||||
options = {
|
||||
|
||||
configuration-flags = {
|
||||
configurationFlags = {
|
||||
#enable = mkEnableOption "Génération de la configuration d'une machine.";
|
||||
awesome = mkEnableOption "Profil pour activer le gestionnaire de fenêtre awesome.";
|
||||
auto-upgrade = mkEnableOption "Profil pour activer les mises à jour automatiques.";
|
||||
@@ -38,7 +38,9 @@ let
|
||||
locate = mkEnableOption "Profil pour activer la fonction locate.";
|
||||
mailboxes = mkEnableOption "Profil pour stocker les mails dans des boîtes aux lettres.";
|
||||
multimediaSuite = mkEnableOption "Profil pour la suite multimédia.";
|
||||
munin = mkEnableOption "Profil pour activer la supervision par Munin";
|
||||
murmur = mkEnableOption "Profil pour activer un serveur Mumble (murmur)";
|
||||
nixos-manual = mkEnableOption "Profil pour activer la documentation nixos en local sur un TTY";
|
||||
nix-serve-server = mkEnableOption "Profil pour que la machine soit un serveur de cache nix.";
|
||||
nixStoreProxyCache = mkEnableOption "Profil pour activer le proxy cahce nginx pour le nix store";
|
||||
officeSuite = mkEnableOption "Profil pour la suite bureautique";
|
||||
@@ -56,15 +58,7 @@ let
|
||||
znc = mkEnableOption "Profil pour activer le relais IRC ZNC.";
|
||||
};
|
||||
|
||||
profiles = {
|
||||
# Domaine
|
||||
isDubronetwork = mkEnableOption "Pour distinguer les machines dubronetwork.";
|
||||
isPrunetwork = mkEnableOption "Pour distinguer les machines prunetwork.";
|
||||
# Utilisation machine
|
||||
isDesktopEnvironment = mkEnableOption "Pour indiquer une machine avec interface graphique.";
|
||||
isServer = mkEnableOption "Pour indiquer qu'il s'agit d'un serveur.";
|
||||
isWorkstation = mkEnableOption "Pour indiquer que la machine sert à travailler.";
|
||||
};
|
||||
configurationOptions = {
|
||||
|
||||
ipAddress = mkOption {
|
||||
description = "Adresse IP";
|
||||
@@ -127,11 +121,26 @@ let
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
profiles = {
|
||||
# Domaine
|
||||
isDubronetwork = mkEnableOption "Pour distinguer les machines dubronetwork.";
|
||||
isDubronetworkServer = mkEnableOption "Pour distinguer les machines dubronetwork avec Server.";
|
||||
isDubronetworkWorkstation = mkEnableOption "Pour distinguer les machines dubronetwork avec Workstation.";
|
||||
isPrunetwork = mkEnableOption "Pour distinguer les machines prunetwork.";
|
||||
isPrunetworkServer = mkEnableOption "Pour distinguer les machines prunetwork avec Server.";
|
||||
isPrunetworkWorkstation = mkEnableOption "Pour distinguer les machines prunetwork avec Workstation.";
|
||||
# Utilisation machine
|
||||
isDesktopEnvironment = mkEnableOption "Pour indiquer une machine avec interface graphique.";
|
||||
isServer = mkEnableOption "Pour indiquer qu'il s'agit d'un serveur.";
|
||||
isWorkstation = mkEnableOption "Pour indiquer que la machine sert à travailler.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
{
|
||||
@@ -150,10 +159,15 @@ in
|
||||
*/
|
||||
assertions = [
|
||||
{
|
||||
assertion = (currentMachine.profiles.isWorkstation && (currentMachine.profiles.isDesktopEnvironment == true))
|
||||
|| (!currentMachine.profiles.isWorkstation);
|
||||
assertion = (currentMachine.profiles.isWorkstation && (currentMachine.configurationFlags.graphical == true))
|
||||
|| (!currentMachine.profiles.isWorkstation);
|
||||
message = "A workstation requires a graphical environement.";
|
||||
}
|
||||
{
|
||||
assertion = (currentMachine.profiles.isDesktopEnvironment && (currentMachine.configurationFlags.graphical == true))
|
||||
|| (!currentMachine.profiles.isDesktopEnvironment);
|
||||
message = "A desktop station requires a graphical environement.";
|
||||
}
|
||||
{
|
||||
assertion = (currentMachine.profiles.isDesktopEnvironment && (config.services.xserver.enable == true))
|
||||
|| (!currentMachine.profiles.isDesktopEnvironment);
|
||||
|
||||
13
services/dbus.nix
Normal file
13
services/dbus.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf true {
|
||||
# Lancement de dbus pour les utilisateurs
|
||||
services.dbus.socketActivated = true;
|
||||
}
|
||||
@@ -4,12 +4,14 @@ let
|
||||
#inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
{
|
||||
imports = [
|
||||
# installées systématiquement
|
||||
./dbus.nix
|
||||
./gpm.nix
|
||||
./haveged.nix
|
||||
./monitoring-munin.nix
|
||||
./ssh.nix
|
||||
@@ -26,6 +28,7 @@ in
|
||||
./kibana.nix # service de visualisation de données stockées dans elasticsearch
|
||||
# TODO: réactiver locate
|
||||
#./locate.nix # service locate
|
||||
./nixos-manual.nix # documentation nixos sur TTY
|
||||
./virtualbox.nix # activer virtualbox
|
||||
./xmonad/xmonad.nix # pour le gestionaire de fenêtre xmonad
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf flags.docker {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf flags.elasticsearch {
|
||||
|
||||
14
services/gpm.nix
Normal file
14
services/gpm.nix
Normal file
@@ -0,0 +1,14 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf true {
|
||||
|
||||
# prise en charge de la souris en console
|
||||
services.gpm.enable = true;
|
||||
}
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf true {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf flags.developpement-haskell {
|
||||
|
||||
@@ -4,29 +4,39 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
# TODO: ménage
|
||||
mkIf flags.hydra-builder {
|
||||
|
||||
# Paquets
|
||||
environment.systemPackages = with pkgs; [
|
||||
qemu
|
||||
kvm
|
||||
qemu
|
||||
virtualbox
|
||||
];
|
||||
|
||||
# Services
|
||||
|
||||
## Services de virtualisation utilisé pour les tests hydra
|
||||
virtualisation.docker.enable = true;
|
||||
virtualisation.libvirtd.enable = true;
|
||||
virtualisation.libvirtd.enableKVM = true;
|
||||
#virtualisation.virtualbox.guest.enable = true;
|
||||
virtualisation.virtualbox.host.enable = true;
|
||||
virtualisation.virtualbox.host.headless = true;
|
||||
virtualisation = {
|
||||
docker.enable = true;
|
||||
libvirtd = {
|
||||
enable = true;
|
||||
enableKVM = true;
|
||||
};
|
||||
virtualbox = {
|
||||
#guest.enable = true;
|
||||
host.enable = true;
|
||||
host.headless = true;
|
||||
};
|
||||
};
|
||||
|
||||
## Ménage automatique tous les jours
|
||||
nix.gc.automatic = true;
|
||||
## Ménage automatique tous les jours - Frequent garbage collection is a good idea for build machines.
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
dates = "*:0/30";
|
||||
};
|
||||
|
||||
# users.users."hydrabld" = {
|
||||
# description = "Execution des jobs hydra";
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
|
||||
|
||||
#### https://github.com/NixOS/hydra/issues/413
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf flags.kibana {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf flags.locate {
|
||||
|
||||
@@ -4,12 +4,11 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
# TODO: ajouter option
|
||||
# TODO: changer adresse mail
|
||||
mkIf true {
|
||||
mkIf flags.munin {
|
||||
|
||||
# Paquets
|
||||
environment.systemPackages = with pkgs; [
|
||||
|
||||
33
services/nixos-manual.nix
Normal file
33
services/nixos-manual.nix
Normal file
@@ -0,0 +1,33 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf flags.nixos-manual {
|
||||
|
||||
# Paquets
|
||||
environment.systemPackages = with pkgs; [
|
||||
bc
|
||||
mailutils
|
||||
];
|
||||
|
||||
# Services
|
||||
|
||||
## documentation sur ctrl + alt + F8
|
||||
services.nixosManual = {
|
||||
enable = true;
|
||||
showManual = true;
|
||||
};
|
||||
|
||||
# Réseau
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [
|
||||
];
|
||||
allowedUDPPorts = [
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf flags.print {
|
||||
|
||||
@@ -4,11 +4,17 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf flags.pulseaudio {
|
||||
|
||||
# Paquets
|
||||
environment.systemPackages = with pkgs; [
|
||||
paprefs # préferences pulseaudio
|
||||
pavucontrol # mixer pulseaudio
|
||||
];
|
||||
|
||||
# Pulse Audio
|
||||
hardware.pulseaudio = {
|
||||
enable = true;
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf flags.scanner {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf true {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf flags.virtualbox {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf flags.xmonad {
|
||||
|
||||
@@ -4,7 +4,7 @@ let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
annuaire = config.r6d.machines;
|
||||
currentMachine = annuaire."${config.networking.hostName}";
|
||||
flags = currentMachine.configuration-flags;
|
||||
flags = currentMachine.configurationFlags;
|
||||
in
|
||||
|
||||
mkIf true {
|
||||
|
||||
Reference in New Issue
Block a user