déplacement de .nix de base/base vers base/public

This commit is contained in:
2016-08-08 22:00:02 +02:00
parent 3d7b3f1106
commit 36c0eba3b5
8 changed files with 13 additions and 5 deletions

12
public/auto-upgrade.nix Normal file
View File

@@ -0,0 +1,12 @@
{ config, pkgs, ... }:
with pkgs.lib;
let
cfg = config.r6d.config-generator;
in {
# Automatic update & automatic clean
system.autoUpgrade.enable = cfg.auto-upgrade;
nix.gc.automatic = cfg.auto-upgrade;
}

10
public/laptop.nix Normal file
View File

@@ -0,0 +1,10 @@
{ config, pkgs, ... }:
with pkgs.lib;
let
cfg = config.r6d.config-generator;
in {
# Gestion spécifique pour PC portable
powerManagement.cpuFreqGovernor = mkIf cfg.laptop "powersave";
}

15
public/locate.nix Normal file
View File

@@ -0,0 +1,15 @@
{ config, pkgs, ... }:
with pkgs.lib;
let
cfg = config.r6d.config-generator;
in {
imports = [
];
services.locate = {
enable = cfg.locate;
interval = "hourly";
};
}

22
public/print.nix Normal file
View File

@@ -0,0 +1,22 @@
{ config, pkgs, ... }:
with pkgs.lib;
let
cfg = config.r6d.config-generator;
in {
# Enable CUPS to print documents.
services.printing = mkIf cfg.print {
enable = true;
drivers = [
pkgs.samsung-unified-linux-driver
];
# Suppression automatique des fichiers temporaires.
# Par défaut, cups conserve une copie de ce qui a été imprimé
# pas cool pour les mots de passe ou autre donnée sensible
extraConf = ''
PreserveJobHistory No
PreserveJobFiles No
'';
};
}

12
public/public.nix Normal file
View File

@@ -0,0 +1,12 @@
{ config, pkgs, ... }:
{
imports = [
# inclusion conditionnelle
./auto-upgrade.nix
./laptop.nix
./locate.nix
./print.nix
./swap.nix
];
}

16
public/swap.nix Normal file
View File

@@ -0,0 +1,16 @@
{ config, pkgs, ... }:
with pkgs.lib;
let
cfg = config.r6d.config-generator;
in {
# Gestion du swap
# https://en.wikipedia.org/wiki/Swappiness
boot.kernel.sysctl = mkIf cfg.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;
};
}