From 33e44d23f9237c412abf80430d6504595ddb6036 Mon Sep 17 00:00:00 2001 From: Jean-Pierre PRUNARET Date: Mon, 8 Aug 2016 22:58:30 +0200 Subject: [PATCH] harmonisation des headers pour public/ --- public/app-awesome.nix | 4 +++- public/app-docker.nix | 3 ++- public/app-jeux.nix | 3 ++- public/app-virtualbox.nix | 3 ++- public/auto-upgrade.nix | 15 +++++++++------ public/laptop.nix | 14 +++++++++----- public/locate.nix | 15 ++++++++------- public/print.nix | 13 ++++++++----- public/swap.nix | 13 ++++++++----- 9 files changed, 51 insertions(+), 32 deletions(-) diff --git a/public/app-awesome.nix b/public/app-awesome.nix index abc751a..4f364ae 100644 --- a/public/app-awesome.nix +++ b/public/app-awesome.nix @@ -5,7 +5,9 @@ let cfg = config.r6d.config-generator; computers = config.r6d.computers; profiles = config.r6d.profiles; -in mkIf cfg.awesome { +in + +mkIf cfg.awesome { environment.variables = { # Export the current path for the awesome derivation, useful for users rc.lua diff --git a/public/app-docker.nix b/public/app-docker.nix index 69bc060..8fd79f7 100644 --- a/public/app-docker.nix +++ b/public/app-docker.nix @@ -5,8 +5,9 @@ let cfg = config.r6d.config-generator; computers = config.r6d.computers; profiles = config.r6d.profiles; +in -in mkIf cfg.docker { +mkIf cfg.docker { environment.systemPackages = with pkgs; [ # Ecosystème Docker diff --git a/public/app-jeux.nix b/public/app-jeux.nix index 7371907..642eb33 100644 --- a/public/app-jeux.nix +++ b/public/app-jeux.nix @@ -5,8 +5,9 @@ let cfg = config.r6d.config-generator; computers = config.r6d.computers; profiles = config.r6d.profiles; +in -in mkIf cfg.jeux { +mkIf cfg.jeux { environment.systemPackages = with pkgs; [ # Jeux diff --git a/public/app-virtualbox.nix b/public/app-virtualbox.nix index 9c3a700..85076c6 100644 --- a/public/app-virtualbox.nix +++ b/public/app-virtualbox.nix @@ -5,8 +5,9 @@ let cfg = config.r6d.config-generator; computers = config.r6d.computers; profiles = config.r6d.profiles; +in -in mkIf cfg.virtualbox { +mkIf cfg.virtualbox { environment.systemPackages = with pkgs; [ linuxPackages.virtualbox diff --git a/public/auto-upgrade.nix b/public/auto-upgrade.nix index 4c2637a..0d7eff4 100644 --- a/public/auto-upgrade.nix +++ b/public/auto-upgrade.nix @@ -1,12 +1,15 @@ -{ config, pkgs, ... }: - -with pkgs.lib; +{ config, lib, pkgs, ... }: let + inherit (lib) mkIf; cfg = config.r6d.config-generator; -in { + computers = config.r6d.computers; + profiles = config.r6d.profiles; +in + +mkIf cfg.auto-upgrade { # Automatic update & automatic clean - system.autoUpgrade.enable = cfg.auto-upgrade; - nix.gc.automatic = cfg.auto-upgrade; + system.autoUpgrade.enable = true; + nix.gc.automatic = true; } diff --git a/public/laptop.nix b/public/laptop.nix index fdbd5db..5a3149e 100644 --- a/public/laptop.nix +++ b/public/laptop.nix @@ -1,10 +1,14 @@ -{ config, pkgs, ... }: - -with pkgs.lib; +{ config, lib, pkgs, ... }: let + inherit (lib) mkIf; cfg = config.r6d.config-generator; -in { + computers = config.r6d.computers; + profiles = config.r6d.profiles; +in + +mkIf cfg.laptop { + # Gestion spécifique pour PC portable - powerManagement.cpuFreqGovernor = mkIf cfg.laptop "powersave"; + powerManagement.cpuFreqGovernor = "powersave"; } diff --git a/public/locate.nix b/public/locate.nix index a27e977..64267a5 100644 --- a/public/locate.nix +++ b/public/locate.nix @@ -1,15 +1,16 @@ -{ config, pkgs, ... }: - -with pkgs.lib; +{ config, lib, pkgs, ... }: let + inherit (lib) mkIf; cfg = config.r6d.config-generator; -in { - imports = [ - ]; + computers = config.r6d.computers; + profiles = config.r6d.profiles; +in + +mkIf cfg.locate { services.locate = { - enable = cfg.locate; + enable = true; interval = "hourly"; }; } diff --git a/public/print.nix b/public/print.nix index 6a8d3c2..6e5f98b 100644 --- a/public/print.nix +++ b/public/print.nix @@ -1,12 +1,15 @@ -{ config, pkgs, ... }: - -with pkgs.lib; +{ config, lib, pkgs, ... }: let + inherit (lib) mkIf; cfg = config.r6d.config-generator; -in { + computers = config.r6d.computers; + profiles = config.r6d.profiles; +in + +mkIf cfg.print { # Enable CUPS to print documents. - services.printing = mkIf cfg.print { + services.printing = { enable = true; drivers = [ pkgs.samsung-unified-linux-driver diff --git a/public/swap.nix b/public/swap.nix index 1318e2d..dc1b84e 100644 --- a/public/swap.nix +++ b/public/swap.nix @@ -1,14 +1,17 @@ -{ config, pkgs, ... }: - -with pkgs.lib; +{ config, lib, pkgs, ... }: let + inherit (lib) mkIf; cfg = config.r6d.config-generator; -in { + computers = config.r6d.computers; + profiles = config.r6d.profiles; +in + +mkIf cfg.swap { # Gestion du swap # https://en.wikipedia.org/wiki/Swappiness - boot.kernel.sysctl = mkIf cfg.swap { + boot.kernel.sysctl = { # le swap est activé (!= 0) # le swap est utilisé lorsque (100 - x) % de la mémoire est déja allouée "vm.swappiness" = 10;