Compare commits

...

6 Commits

Author SHA1 Message Date
Yves Dubromelle
ac91ce4492 regroupement des options éparses en configurationOptions et renommage 2017-05-31 00:23:10 +02:00
Yves Dubromelle
c43adc80cb utilisation des profils pour modifier les flags :) 2017-05-30 23:21:33 +02:00
Yves Dubromelle
745d2cd171 on peut se passer de passer lib en paramètre 2017-05-25 23:30:50 +02:00
Yves Dubromelle
259a1a0aa6 cible make pour juste builder NixOS sans appliquer 2017-05-25 02:18:07 +02:00
Yves Dubromelle
854eed9227 ébauche de fonction pour générer un profil 2017-05-25 02:17:42 +02:00
8ee09217cb une machine hydra-builder doit faire du garbage-collection régulièrement 2017-05-22 10:42:16 +02:00
75 changed files with 155 additions and 94 deletions

View File

@@ -23,6 +23,9 @@ full-auto: submodules-update upgrade clean optimise
optimise: optimise:
$(TIME) nix-store --optimise $(TIME) nix-store --optimise
rebuild-build:
$(TIME) time nixos-rebuild build --fallback --show-trace
rebuild-switch: rebuild-switch:
$(TIME) time nixos-rebuild switch --fallback --show-trace $(TIME) time nixos-rebuild switch --fallback --show-trace

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf flags.graphical { mkIf flags.graphical {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf currentMachine.profiles.isDesktopEnvironment { mkIf currentMachine.profiles.isDesktopEnvironment {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf (flags.officeSuite && flags.graphical) { mkIf (flags.officeSuite && flags.graphical) {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf (flags.conception-assistee && flags.graphical) { mkIf (flags.conception-assistee && flags.graphical) {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf (flags.cartographie && flags.graphical) { mkIf (flags.cartographie && flags.graphical) {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
# TODO: ménage # TODO: ménage
mkIf (flags.internetSuite && flags.graphical) { mkIf (flags.internetSuite && flags.graphical) {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf (true && flags.graphical) { mkIf (true && flags.graphical) {

View File

@@ -4,7 +4,7 @@ let
#inherit (lib) mkIf mkMerge mkThenElse; #inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
{ {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf (flags.developpement-elm && flags.graphical) { mkIf (flags.developpement-elm && flags.graphical) {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf (flags.developpement-haskell && flags.graphical) { mkIf (flags.developpement-haskell && flags.graphical) {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf (flags.developpement-java && flags.graphical) { mkIf (flags.developpement-java && flags.graphical) {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf (flags.jetbrains-licensed && flags.graphical) { mkIf (flags.jetbrains-licensed && flags.graphical) {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf (flags.developpement-rust && flags.graphical) { mkIf (flags.developpement-rust && flags.graphical) {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf (flags.developpement && flags.graphical) { mkIf (flags.developpement && flags.graphical) {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf (flags.edition-musique && flags.graphical) { mkIf (flags.edition-musique && flags.graphical) {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf (flags.edition-photo && flags.graphical) { mkIf (flags.edition-photo && flags.graphical) {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf (flags.edition-video && flags.graphical) { mkIf (flags.edition-video && flags.graphical) {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf (flags.jeux && flags.graphical) { mkIf (flags.jeux && flags.graphical) {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
# TODO ranger le spécifique pulseaudio # TODO ranger le spécifique pulseaudio

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf; inherit (lib) mkIf;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf (true && flags.graphical) { mkIf (true && flags.graphical) {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf (flags.securitySuite && flags.graphical) { mkIf (flags.securitySuite && flags.graphical) {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf true { mkIf true {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf true { mkIf true {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf flags.officeSuite { mkIf flags.officeSuite {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf flags.conception-assistee { mkIf flags.conception-assistee {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf flags.cartographie { mkIf flags.cartographie {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
# TODO: ménage # TODO: ménage
mkIf flags.internetSuite { mkIf flags.internetSuite {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf true { mkIf true {

View File

@@ -4,7 +4,7 @@ let
#inherit (lib) mkIf mkMerge mkThenElse; #inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
{ {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf flags.developpement-elm { mkIf flags.developpement-elm {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf flags.developpement-haskell { mkIf flags.developpement-haskell {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf flags.developpement-java { mkIf flags.developpement-java {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf flags.jetbrains-licensed { mkIf flags.jetbrains-licensed {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf flags.developpement-rust { mkIf flags.developpement-rust {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf flags.developpement { mkIf flags.developpement {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf flags.edition-musique { mkIf flags.edition-musique {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf flags.edition-photo { mkIf flags.edition-photo {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf flags.edition-video { mkIf flags.edition-video {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf flags.jeux { mkIf flags.jeux {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf flags.multimediaSuite { mkIf flags.multimediaSuite {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf; inherit (lib) mkIf;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf true { mkIf true {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf flags.securitySuite { mkIf flags.securitySuite {

View File

@@ -8,7 +8,7 @@ let
host = config.networking.hostName; host = config.networking.hostName;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
{ {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf flags.auto-upgrade { mkIf flags.auto-upgrade {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
# TODO: rc.lua par défaut (système) # TODO: rc.lua par défaut (système)

View File

@@ -4,7 +4,7 @@ let
#inherit (lib) mkIf mkMerge mkThenElse; #inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
{ {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
# TODO: ménage # TODO: ménage

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf flags.laptop { mkIf flags.laptop {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf true { mkIf true {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf true { mkIf true {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf true { mkIf true {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf flags.swap { mkIf flags.swap {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf false { mkIf false {

45
lib.nix Normal file
View File

@@ -0,0 +1,45 @@
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;
};
#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);
}

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf true { mkIf true {

View File

@@ -6,7 +6,7 @@ let
machineOptions = types.submodule { machineOptions = types.submodule {
options = { options = {
configuration-flags = { configurationFlags = {
#enable = mkEnableOption "Génération de la configuration d'une machine."; #enable = mkEnableOption "Génération de la configuration d'une machine.";
awesome = mkEnableOption "Profil pour activer le gestionnaire de fenêtre awesome."; awesome = mkEnableOption "Profil pour activer le gestionnaire de fenêtre awesome.";
auto-upgrade = mkEnableOption "Profil pour activer les mises à jour automatiques."; auto-upgrade = mkEnableOption "Profil pour activer les mises à jour automatiques.";
@@ -57,15 +57,7 @@ let
znc = mkEnableOption "Profil pour activer le relais IRC ZNC."; znc = mkEnableOption "Profil pour activer le relais IRC ZNC.";
}; };
profiles = { configurationOptions = {
# 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.";
};
ipAddress = mkOption { ipAddress = mkOption {
description = "Adresse IP"; description = "Adresse IP";
@@ -128,11 +120,22 @@ let
}; };
}; };
}; };
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.";
};
};
}; };
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
{ {
@@ -151,8 +154,8 @@ in
*/ */
assertions = [ assertions = [
{ {
assertion = (currentMachine.profiles.isWorkstation && (currentMachine.profiles.isDesktopEnvironment == true)) assertion = (currentMachine.profiles.isDesktopEnvironment && (currentMachine.configurationFlags.graphical == true))
|| (!currentMachine.profiles.isWorkstation); || (!currentMachine.profiles.isDesktopEnvironment);
message = "A workstation requires a graphical environement."; message = "A workstation requires a graphical environement.";
} }
{ {

View File

@@ -4,7 +4,7 @@ let
#inherit (lib) mkIf mkMerge mkThenElse; #inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
{ {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf flags.docker { mkIf flags.docker {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf flags.elasticsearch { mkIf flags.elasticsearch {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf true { mkIf true {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf flags.developpement-haskell { mkIf flags.developpement-haskell {

View File

@@ -4,29 +4,39 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
# TODO: ménage # TODO: ménage
mkIf flags.hydra-builder { mkIf flags.hydra-builder {
# Paquets # Paquets
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
qemu
kvm kvm
qemu
virtualbox
]; ];
# Services # Services
## Services de virtualisation utilisé pour les tests hydra ## Services de virtualisation utilisé pour les tests hydra
virtualisation.docker.enable = true; virtualisation = {
virtualisation.libvirtd.enable = true; docker.enable = true;
virtualisation.libvirtd.enableKVM = true; libvirtd = {
#virtualisation.virtualbox.guest.enable = true; enable = true;
virtualisation.virtualbox.host.enable = true; enableKVM = true;
virtualisation.virtualbox.host.headless = true; };
virtualbox = {
#guest.enable = true;
host.enable = true;
host.headless = true;
};
};
## Ménage automatique tous les jours ## Ménage automatique tous les jours - Frequent garbage collection is a good idea for build machines.
nix.gc.automatic = true; nix.gc = {
automatic = true;
dates = "*:0/30";
};
# users.users."hydrabld" = { # users.users."hydrabld" = {
# description = "Execution des jobs hydra"; # description = "Execution des jobs hydra";

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
#### https://github.com/NixOS/hydra/issues/413 #### https://github.com/NixOS/hydra/issues/413

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf flags.kibana { mkIf flags.kibana {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf flags.locate { mkIf flags.locate {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
# TODO: changer adresse mail # TODO: changer adresse mail

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf flags.print { mkIf flags.print {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf flags.pulseaudio { mkIf flags.pulseaudio {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf flags.scanner { mkIf flags.scanner {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf true { mkIf true {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf flags.virtualbox { mkIf flags.virtualbox {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
/** /**

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf flags.xmonad { mkIf flags.xmonad {

View File

@@ -4,7 +4,7 @@ let
inherit (lib) mkIf mkMerge mkThenElse; inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines; annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}"; currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configuration-flags; flags = currentMachine.configurationFlags;
in in
mkIf true { mkIf true {