From 0a8c50303241c0d11b54a3e366d7b1aa34cb5af4 Mon Sep 17 00:00:00 2001 From: Jean-Pierre PRUNARET Date: Sat, 9 Jul 2016 21:26:20 +0200 Subject: [PATCH] =?UTF-8?q?les=20services=20"activation=20manuelle"=20sont?= =?UTF-8?q?=20g=C3=A9r=C3=A9s=20par=20config-generator?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- activation-manuelle/auto-upgrade.nix | 5 +++-- activation-manuelle/locate.nix | 4 ++-- activation-manuelle/nix-serve.nix | 5 +++-- activation-manuelle/swap.nix | 5 +++-- base.nix | 10 +++++++--- 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/activation-manuelle/auto-upgrade.nix b/activation-manuelle/auto-upgrade.nix index 0c1c58c..fa61df3 100644 --- a/activation-manuelle/auto-upgrade.nix +++ b/activation-manuelle/auto-upgrade.nix @@ -2,6 +2,7 @@ { # Automatic update & automatic clean - system.autoUpgrade.enable = true; - nix.gc.automatic = true; + + system.autoUpgrade.enable = config.r6d.config-generator.auto-upgrade; + nix.gc.automatic = config.r6d.config-generator.auto-upgrade; } diff --git a/activation-manuelle/locate.nix b/activation-manuelle/locate.nix index bd5c602..072d930 100644 --- a/activation-manuelle/locate.nix +++ b/activation-manuelle/locate.nix @@ -4,8 +4,8 @@ imports = [ ]; - services.locate= { - enable = true; + services.locate = { + enable = config.r6d.config-generator.locate; interval = "hourly"; }; } diff --git a/activation-manuelle/nix-serve.nix b/activation-manuelle/nix-serve.nix index 4dfc384..f5ff4a1 100644 --- a/activation-manuelle/nix-serve.nix +++ b/activation-manuelle/nix-serve.nix @@ -2,6 +2,7 @@ { # Cache http pour le store - services.nix-serve.enable = true; - networking.firewall.allowedTCPPorts = [5000]; + + services.nix-serve.enable = config.r6d.config-generator.nix-serve-server; + networking.firewall.allowedTCPPorts = pkgs.lib.mkIf config.r6d.config-generator.nix-serve-server [5000]; } diff --git a/activation-manuelle/swap.nix b/activation-manuelle/swap.nix index 95d9071..ea92882 100644 --- a/activation-manuelle/swap.nix +++ b/activation-manuelle/swap.nix @@ -1,9 +1,10 @@ { config, pkgs, ... }: { - + # Gestion du swap + # https://en.wikipedia.org/wiki/Swappiness - boot.kernel.sysctl = { + boot.kernel.sysctl = pkgs.lib.mkIf config.r6d.config-generator.swap { # le swap est activé (!= 0) # le swap est utilisé lorsque (100 - x) % de la mémoire est déja allouée "vm.swappiness" = 10; diff --git a/base.nix b/base.nix index 7f73836..b357590 100644 --- a/base.nix +++ b/base.nix @@ -2,12 +2,16 @@ { imports = [ - #./activation-manuelle/auto-upgrade.nix - #./activation-manuelle/locate.nix - #./activation-manuelle/swap.nix ./environment.nix ./localisation.nix ./networking.nix ./services.nix + + # inclusion conditionnelle + ./config-generator.nix + ./activation-manuelle/auto-upgrade.nix + ./activation-manuelle/locate.nix + ./activation-manuelle/nix-serve.nix + ./activation-manuelle/swap.nix ]; }