ajout header + utilisation
This commit is contained in:
@@ -1,8 +1,12 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
with pkgs.lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
in {
|
||||||
# Automatic update & automatic clean
|
# Automatic update & automatic clean
|
||||||
|
|
||||||
system.autoUpgrade.enable = config.r6d.config-generator.auto-upgrade;
|
system.autoUpgrade.enable = cfg.auto-upgrade;
|
||||||
nix.gc.automatic = config.r6d.config-generator.auto-upgrade;
|
nix.gc.automatic = cfg.auto-upgrade;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
with pkgs.lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
in {
|
||||||
# Gestion de fail2ban
|
# Gestion de fail2ban
|
||||||
|
|
||||||
services = pkgs.lib.mkIf config.r6d.config-generator.fail2ban {
|
services = mkIf cfg.fail2ban {
|
||||||
fail2ban = {
|
fail2ban = {
|
||||||
enable = true;
|
enable = true;
|
||||||
jails = {
|
jails = {
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
with pkgs.lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
in {
|
||||||
# Gestion spécifique pour PC portable
|
# Gestion spécifique pour PC portable
|
||||||
powerManagement.cpuFreqGovernor = pkgs.lib.mkIf config.r6d.config-generator.laptop "powersave";
|
powerManagement.cpuFreqGovernor = mkIf cfg.laptop "powersave";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
with pkgs.lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
];
|
];
|
||||||
|
|
||||||
services.locate = {
|
services.locate = {
|
||||||
enable = config.r6d.config-generator.locate;
|
enable = cfg.locate;
|
||||||
interval = "hourly";
|
interval = "hourly";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf mkMerge;
|
inherit (lib) mkIf mkMerge;
|
||||||
profiles = config.r6d.profiles;
|
profiles = config.r6d.profiles;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
computers = config.r6d.computers;
|
computers = config.r6d.computers;
|
||||||
in {
|
in {
|
||||||
nix = mkIf config.r6d.config-generator.nix-serve-client {
|
nix = mkIf config.r6d.config-generator.nix-serve-client {
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
with pkgs.lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
in {
|
||||||
# Cache http pour le store
|
# Cache http pour le store
|
||||||
|
|
||||||
services.nix-serve.enable = config.r6d.config-generator.nix-serve-server;
|
services.nix-serve.enable = cfg.nix-serve-server;
|
||||||
networking.firewall.allowedTCPPorts = pkgs.lib.mkIf config.r6d.config-generator.nix-serve-server [ 5000 ];
|
networking.firewall.allowedTCPPorts = mkIf cfg.nix-serve-server [ 5000 ];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
with pkgs.lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
in {
|
||||||
# Enable CUPS to print documents.
|
# Enable CUPS to print documents.
|
||||||
services.printing = pkgs.lib.mkIf config.r6d.config-generator.print {
|
services.printing = mkIf cfg.print {
|
||||||
enable = true;
|
enable = true;
|
||||||
drivers = [
|
drivers = [
|
||||||
pkgs.samsung-unified-linux-driver
|
pkgs.samsung-unified-linux-driver
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
with pkgs.lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
in {
|
||||||
# Gestion du swap
|
# Gestion du swap
|
||||||
|
|
||||||
# https://en.wikipedia.org/wiki/Swappiness
|
# https://en.wikipedia.org/wiki/Swappiness
|
||||||
boot.kernel.sysctl = pkgs.lib.mkIf config.r6d.config-generator.swap {
|
boot.kernel.sysctl = mkIf cfg.swap {
|
||||||
# le swap est activé (!= 0)
|
# le swap est activé (!= 0)
|
||||||
# le swap est utilisé lorsque (100 - x) % de la mémoire est déja allouée
|
# le swap est utilisé lorsque (100 - x) % de la mémoire est déja allouée
|
||||||
"vm.swappiness" = 10;
|
"vm.swappiness" = 10;
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
with pkgs.lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
profiles = config.r6d.profiles;
|
profiles = config.r6d.profiles;
|
||||||
in {
|
in {
|
||||||
|
|
||||||
security.sudo.wheelNeedsPassword = !(profiles.isPrunetwork && profiles.isServer);
|
security.sudo.wheelNeedsPassword = !(profiles.isPrunetwork && profiles.isServer);
|
||||||
|
|
||||||
users.extraUsers.jpierre03 = pkgs.lib.mkIf profiles.isPrunetwork
|
users.extraUsers.jpierre03 = mkIf profiles.isPrunetwork
|
||||||
{ isNormalUser = true;
|
{ isNormalUser = true;
|
||||||
createHome = true;
|
createHome = true;
|
||||||
home = "/home/jpierre03";
|
home = "/home/jpierre03";
|
||||||
|
|||||||
Reference in New Issue
Block a user