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 ]; }