Compare commits
46 Commits
2016-08-10
...
2016-08-26
| Author | SHA1 | Date | |
|---|---|---|---|
| 56d2c04cd6 | |||
| ebe63ea5e0 | |||
| ea69ceba37 | |||
|
|
e8521880e1 | ||
|
|
313457be31 | ||
| df0951ce65 | |||
| 1323e6dee1 | |||
|
|
d16271c61e | ||
| 6c45e0bfa2 | |||
| c2d3bb8cb4 | |||
| d5c79218fa | |||
| e7ef51ecbe | |||
| 6c02c2200c | |||
| c8592c769e | |||
| 7b298ac8a3 | |||
| 9190d21a65 | |||
|
|
b4c960d3d3 | ||
| 516976ccf9 | |||
| 634af07219 | |||
| 91d414d3e1 | |||
| ca0171b70e | |||
| 48361328dd | |||
| ee34e1a138 | |||
| ea307cc5dc | |||
| 1cce1ec034 | |||
| 32a05e2124 | |||
|
|
23cb4c79a9 | ||
|
|
160ec79b0f | ||
|
|
9bc50b35dd | ||
|
|
1c649a9b04 | ||
|
|
7cb371510b | ||
|
|
b38e5a87bb | ||
|
|
50326127d3 | ||
|
|
02a8b96e61 | ||
|
|
5e6586d403 | ||
|
|
b65ffa4d8f | ||
|
|
744ebec05b | ||
| d1113bec00 | |||
| ef2733675d | |||
| 63902d313c | |||
| 0dc2561017 | |||
|
|
953021f306 | ||
|
|
c2da568c30 | ||
| bbfd76a4a1 | |||
|
|
e1e30f4ce0 | ||
| 4c3e1abfcb |
36
Makefile
36
Makefile
@@ -1,5 +1,6 @@
|
|||||||
all: rebuild-switch
|
all: rebuild-switch
|
||||||
date
|
date
|
||||||
|
##--------- Commandes spécifiques pour NixOS
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
nix-collect-garbage -d --delete-older-than 15d
|
nix-collect-garbage -d --delete-older-than 15d
|
||||||
@@ -18,16 +19,21 @@ full-auto: submodules-update upgrade clean optimise
|
|||||||
optimise:
|
optimise:
|
||||||
nix-store --optimise
|
nix-store --optimise
|
||||||
|
|
||||||
push: submodules-push
|
|
||||||
git push --all
|
|
||||||
git push --tags
|
|
||||||
|
|
||||||
rebuild-switch:
|
rebuild-switch:
|
||||||
nixos-rebuild switch --fallback --show-trace
|
nixos-rebuild switch --fallback --show-trace
|
||||||
|
|
||||||
store-repair:
|
store-repair:
|
||||||
nix-store --verify --check-contents --repair
|
nix-store --verify --check-contents --repair
|
||||||
|
|
||||||
|
upgrade:
|
||||||
|
nixos-rebuild switch --upgrade --fallback --show-trace
|
||||||
|
|
||||||
|
##--------- Commandes spécifiques pour GIT
|
||||||
|
|
||||||
|
push: submodules-push
|
||||||
|
git push --all
|
||||||
|
git push --tags
|
||||||
|
|
||||||
submodules-update:
|
submodules-update:
|
||||||
#git submodule update --remote
|
#git submodule update --remote
|
||||||
git submodule foreach git co master
|
git submodule foreach git co master
|
||||||
@@ -40,9 +46,27 @@ submodules-push:
|
|||||||
submodules-tag:
|
submodules-tag:
|
||||||
git submodule foreach git tag -f "$$(date +%F)-$$(hostname -s)"
|
git submodule foreach git tag -f "$$(date +%F)-$$(hostname -s)"
|
||||||
|
|
||||||
|
template:
|
||||||
|
find . -name "*.nix" -exec meld /etc/nixos/base/module-template.nix {} \;
|
||||||
|
|
||||||
tag: submodules-tag
|
tag: submodules-tag
|
||||||
git tag -f "$$(date +%F)-$$(hostname -s)"
|
git tag -f "$$(date +%F)-$$(hostname -s)"
|
||||||
|
|
||||||
upgrade:
|
##--------- Munin
|
||||||
nixos-rebuild switch --upgrade --fallback --show-trace
|
|
||||||
|
munin:
|
||||||
|
pushd /var/www/munin/ ; python -m SimpleHTTPServer 8000
|
||||||
|
##--------- Gestion d'un système de fichier monté en mémoire
|
||||||
|
|
||||||
|
tmpfs-create:
|
||||||
|
mkdir -p /mnt/tmpfs
|
||||||
|
|
||||||
|
tmpfs-mount: tmpfs-create
|
||||||
|
mount -t tmpfs -o size=10G tmpfs /mnt/tmpfs
|
||||||
|
|
||||||
|
tmpfs-umount:
|
||||||
|
umount /mnt/tmpfs
|
||||||
|
|
||||||
|
tmpfs-destroy: tmpfs-umount
|
||||||
|
rmdir /mnt/tmpfs
|
||||||
|
|
||||||
|
|||||||
9
base.nix
9
base.nix
@@ -1,4 +1,11 @@
|
|||||||
{ ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
#inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
with pkgs.lib;
|
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.r6d.config-generator;
|
|
||||||
in {
|
|
||||||
# Gestion de fail2ban
|
|
||||||
|
|
||||||
services = mkIf cfg.fail2ban {
|
|
||||||
fail2ban = {
|
|
||||||
enable = true;
|
|
||||||
jails = {
|
|
||||||
DEFAULT = ''
|
|
||||||
# "ignoreip" can be an IP address, a CIDR mask or a DNS host
|
|
||||||
ignoreip = 127.0.0.1/8 pedro.dubronetwork.fr cube.dubronetwork.fr voyage.prunetwork.fr xray.prunetwork.fr 192.168.0.0/16 172.16.0.0/16
|
|
||||||
|
|
||||||
# 1 jour
|
|
||||||
# bantime = 86400
|
|
||||||
# 5 jours
|
|
||||||
bantime = 432000
|
|
||||||
maxretry = 3
|
|
||||||
|
|
||||||
#
|
|
||||||
# Destination email address used solely for the interpolations in
|
|
||||||
# jail.{conf,local} configuration files.
|
|
||||||
destemail = admins@dubronetwork.fr
|
|
||||||
'';
|
|
||||||
ssh-route = ''
|
|
||||||
filter = sshd
|
|
||||||
action = route[blocktype=blackhole]
|
|
||||||
maxretry = 3
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,24 +1,25 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf mkMerge;
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
profiles = config.r6d.profiles;
|
|
||||||
cfg = config.r6d.config-generator;
|
cfg = config.r6d.config-generator;
|
||||||
computers = config.r6d.computers;
|
computers = config.r6d.computers;
|
||||||
in {
|
profiles = config.r6d.profiles;
|
||||||
nix = mkIf config.r6d.config-generator.nix-serve-client {
|
in
|
||||||
|
|
||||||
|
mkIf cfg.nix-serve-client {
|
||||||
|
|
||||||
|
nix = {
|
||||||
# Cache http pour le store
|
# Cache http pour le store
|
||||||
requireSignedBinaryCaches = false;
|
requireSignedBinaryCaches = false;
|
||||||
binaryCaches = [
|
binaryCaches = [
|
||||||
("https://cache.nixos.org/")
|
(mkIf (profiles.isDubronetwork && (! computers.isPedro) && (! computers.isRollo)) "http://nix-cache.dubronetwork.fr:5001")
|
||||||
(mkIf (profiles.isDubronetwork && (! computers.isMonstre)) "http://192.168.10.169:5000")
|
|
||||||
(mkIf profiles.isDubronetwork "http://192.168.10.252:5000")
|
|
||||||
|
|
||||||
|
(mkIf profiles.isPrunetwork "https://cache.nixos.org/")
|
||||||
(mkIf (profiles.isPrunetwork && !profiles.isServer) "http://192.168.1.20:5000")
|
(mkIf (profiles.isPrunetwork && !profiles.isServer) "http://192.168.1.20:5000")
|
||||||
];
|
];
|
||||||
extraOptions = ''
|
extraOptions = ''
|
||||||
connect-timeout = 5
|
connect-timeout = 5
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,12 +1,27 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
with pkgs.lib;
|
|
||||||
|
|
||||||
let
|
let
|
||||||
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
cfg = config.r6d.config-generator;
|
cfg = config.r6d.config-generator;
|
||||||
in {
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf cfg.nix-serve-server {
|
||||||
|
|
||||||
# Cache http pour le store
|
# Cache http pour le store
|
||||||
|
|
||||||
services.nix-serve.enable = cfg.nix-serve-server;
|
# Services
|
||||||
networking.firewall.allowedTCPPorts = mkIf cfg.nix-serve-server [ 5000 ];
|
services.nix-serve = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Réseau
|
||||||
|
networking.firewall = {
|
||||||
|
allowedTCPPorts = [
|
||||||
|
5000
|
||||||
|
];
|
||||||
|
allowedUDPPorts = [
|
||||||
|
];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
64
base/activation-manuelle/service-fail2ban.nix
Normal file
64
base/activation-manuelle/service-fail2ban.nix
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
|
||||||
|
ignoreip = "pedro.dubronetwork.fr cube.dubronetwork.fr voyage.prunetwork.fr xray.prunetwork.fr 192.168.0.0/16 172.16.0.0/16";
|
||||||
|
destemail = "admins@dubronetwork.fr";
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf cfg.fail2ban {
|
||||||
|
|
||||||
|
# Gestion de fail2ban
|
||||||
|
|
||||||
|
# Paquets
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
mailutils
|
||||||
|
whois
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
# Services
|
||||||
|
services = {
|
||||||
|
fail2ban = {
|
||||||
|
enable = true;
|
||||||
|
jails = {
|
||||||
|
DEFAULT = ''
|
||||||
|
# "ignoreip" can be an IP address, a CIDR mask or a DNS host
|
||||||
|
ignoreip = 127.0.0.1/8 ${ignoreip}
|
||||||
|
|
||||||
|
# 1 jour
|
||||||
|
# bantime = 86400
|
||||||
|
# 5 jours
|
||||||
|
bantime = 432000
|
||||||
|
|
||||||
|
maxretry = 3
|
||||||
|
|
||||||
|
destemail = ${destemail}
|
||||||
|
|
||||||
|
# https://github.com/Baughn/nixpkgs/blob/master/nixos/modules/services/security/fail2ban.nix
|
||||||
|
findtime = 600
|
||||||
|
maxretry = 3
|
||||||
|
backend = systemd
|
||||||
|
enabled = true
|
||||||
|
'';
|
||||||
|
ssh-route = ''
|
||||||
|
filter = sshd
|
||||||
|
action = route[blocktype=blackhole]
|
||||||
|
'';
|
||||||
|
# désactivation car souci de PATH avec les commandes mail ou sendmail. Nécessite un path motifiable
|
||||||
|
# ticket à ouvrir
|
||||||
|
#ssh-mail = ''
|
||||||
|
# filter = sshd
|
||||||
|
# action = sendmail[sendername=Fail2ban @${config.networking.hostName}]
|
||||||
|
#'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# https://github.com/NixOS/nixpkgs/issues/8437
|
||||||
|
services.fail2ban.jails.ssh-iptables = "enabled = true";
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,11 +1,18 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
#inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./network-dns.nix
|
./network-dns.nix
|
||||||
|
|
||||||
# inclusion conditionnelle
|
# inclusion conditionnelle
|
||||||
./activation-manuelle/fail2ban.nix
|
./activation-manuelle/service-fail2ban.nix
|
||||||
./activation-manuelle/nix-serve-client.nix
|
./activation-manuelle/nix-serve-client.nix
|
||||||
./activation-manuelle/nix-serve-server.nix
|
./activation-manuelle/nix-serve-server.nix
|
||||||
./activation-manuelle/users.nix
|
./activation-manuelle/users.nix
|
||||||
|
|||||||
@@ -1,6 +1,14 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf true {
|
||||||
|
|
||||||
{
|
|
||||||
# Définition des domaines utilisés lorsque un identifiant non-FQDN est donné (ping, nslookup)
|
# Définition des domaines utilisés lorsque un identifiant non-FQDN est donné (ping, nslookup)
|
||||||
networking = {
|
networking = {
|
||||||
search = [
|
search = [
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
# exemple utilisé pour commencer bird.nix
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkEnableOption mkIf mkMerge mkOption singleton types;
|
inherit (lib) mkEnableOption mkIf mkMerge mkOption singleton types;
|
||||||
cfg = config.r6d.config-generator;
|
cfg = config.r6d.config-generator;
|
||||||
@@ -36,6 +35,7 @@ in
|
|||||||
database_postgres=mkEnableOption "Profil pour activer le SGBD PostgreSQL.";
|
database_postgres=mkEnableOption "Profil pour activer le SGBD PostgreSQL.";
|
||||||
developpement = mkEnableOption "Profil pour activer les outils de développement";
|
developpement = mkEnableOption "Profil pour activer les outils de développement";
|
||||||
docker = mkEnableOption "Profil pour l'utilisation de Docker.";
|
docker = mkEnableOption "Profil pour l'utilisation de Docker.";
|
||||||
|
dovecot = mkEnableOption "Profil pour activer le serveur Dovecot.";
|
||||||
dns_autorite = mkEnableOption "Profil pour servir les fichiers de zone DNS.";
|
dns_autorite = mkEnableOption "Profil pour servir les fichiers de zone DNS.";
|
||||||
dns_resolveur = mkEnableOption "Profil pour activer un résolveur DNS local.";
|
dns_resolveur = mkEnableOption "Profil pour activer un résolveur DNS local.";
|
||||||
edition-musique = mkEnableOption "Profil pour la création/édition de musique.";
|
edition-musique = mkEnableOption "Profil pour la création/édition de musique.";
|
||||||
@@ -45,9 +45,11 @@ in
|
|||||||
jeux = mkEnableOption "Profil pour les jeux vidéos.";
|
jeux = mkEnableOption "Profil pour les jeux vidéos.";
|
||||||
laptop = mkEnableOption "Profil pour les outils spécifiques aux ordinateurs portables..";
|
laptop = mkEnableOption "Profil pour les outils spécifiques aux ordinateurs portables..";
|
||||||
locate = mkEnableOption "Profil pour activer la fonction locate.";
|
locate = mkEnableOption "Profil pour activer la fonction locate.";
|
||||||
|
mailboxes = mkEnableOption "Profil pour stocker les mails dans des boîtes aux lettres.";
|
||||||
murmur = mkEnableOption "Profil pour activer un serveur Mumble (murmur)";
|
murmur = mkEnableOption "Profil pour activer un serveur Mumble (murmur)";
|
||||||
nix-serve-client= mkEnableOption "Profil pour que la machine soit un client de cache nix.";
|
nix-serve-client= mkEnableOption "Profil pour que la machine soit un client de cache nix.";
|
||||||
nix-serve-server= mkEnableOption "Profil pour que la machine soit un serveur de cache nix.";
|
nix-serve-server= mkEnableOption "Profil pour que la machine soit un serveur de cache nix.";
|
||||||
|
nixStoreProxyCache = mkEnableOption "Profil pour activer le proxy cahce nginx pour le nix store";
|
||||||
online-ipv6 = mkEnableOption "Profil pour activer l'IPv6 de online.net";
|
online-ipv6 = mkEnableOption "Profil pour activer l'IPv6 de online.net";
|
||||||
print = mkEnableOption "Profil pour activer cups & pouvoir imprimer.";
|
print = mkEnableOption "Profil pour activer cups & pouvoir imprimer.";
|
||||||
rabbitmq = mkEnableOption "Profil pour activer le service de messagerie AMQP.";
|
rabbitmq = mkEnableOption "Profil pour activer le service de messagerie AMQP.";
|
||||||
@@ -63,6 +65,7 @@ in
|
|||||||
isNeoNomade = mkEnableOption "Identification du nom de machine.";
|
isNeoNomade = mkEnableOption "Identification du nom de machine.";
|
||||||
isNomade = mkEnableOption "Identification du nom de machine.";
|
isNomade = mkEnableOption "Identification du nom de machine.";
|
||||||
isOcean = mkEnableOption "Identification du nom de machine.";
|
isOcean = mkEnableOption "Identification du nom de machine.";
|
||||||
|
isPedro = mkEnableOption "Identification du nom de machine.";
|
||||||
isPhenom = mkEnableOption "Identification du nom de machine.";
|
isPhenom = mkEnableOption "Identification du nom de machine.";
|
||||||
isRadx = mkEnableOption "Identification du nom de machine.";
|
isRadx = mkEnableOption "Identification du nom de machine.";
|
||||||
isRollo = mkEnableOption "Identification du nom de machine.";
|
isRollo = mkEnableOption "Identification du nom de machine.";
|
||||||
@@ -83,6 +86,7 @@ in
|
|||||||
isNeoNomade = host == "neo-nomade.dubronetwork.fr";
|
isNeoNomade = host == "neo-nomade.dubronetwork.fr";
|
||||||
isNomade = host == "nomade.dubronetwork.fr";
|
isNomade = host == "nomade.dubronetwork.fr";
|
||||||
isOcean = host == "ocean.prunetwork.fr";
|
isOcean = host == "ocean.prunetwork.fr";
|
||||||
|
isPedro = host == "pedro.dubronetwork.fr";
|
||||||
isPhenom = host == "phenom.dubronetwork.fr";
|
isPhenom = host == "phenom.dubronetwork.fr";
|
||||||
isRadx = host == "radx.prunetwork.fr";
|
isRadx = host == "radx.prunetwork.fr";
|
||||||
isRollo = host == "rollo.dubronetwork.fr";
|
isRollo = host == "rollo.dubronetwork.fr";
|
||||||
@@ -102,7 +106,7 @@ in
|
|||||||
(mkIf pfl.isHome {
|
(mkIf pfl.isHome {
|
||||||
r6d.profiles.isDesktop = true;
|
r6d.profiles.isDesktop = true;
|
||||||
})
|
})
|
||||||
(mkIf pfl.isServer {
|
(mkIf (pfl.isServer && !comp.isMonstre) {
|
||||||
r6d.config-generator = {
|
r6d.config-generator = {
|
||||||
#database_postgres = true;
|
#database_postgres = true;
|
||||||
dns_autorite = true;
|
dns_autorite = true;
|
||||||
@@ -114,7 +118,7 @@ in
|
|||||||
};
|
};
|
||||||
})
|
})
|
||||||
# /!\ PAS un serveur
|
# /!\ PAS un serveur
|
||||||
(mkIf (!pfl.isServer) {
|
(mkIf (!pfl.isServer || comp.isMonstre) {
|
||||||
r6d.config-generator = {
|
r6d.config-generator = {
|
||||||
dns_resolveur = true;
|
dns_resolveur = true;
|
||||||
};
|
};
|
||||||
@@ -140,12 +144,6 @@ in
|
|||||||
print = true;
|
print = true;
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
(mkIf (pfl.isDubronetwork && pfl.isHome) {
|
|
||||||
r6d.config-generator.jeux = true;
|
|
||||||
})
|
|
||||||
(mkIf (pfl.isDubronetwork && pfl.isServer) {
|
|
||||||
r6d.config-generator.nix-serve-server = true;
|
|
||||||
})
|
|
||||||
(mkIf (pfl.isDubronetwork && pfl.isWorkstation) {
|
(mkIf (pfl.isDubronetwork && pfl.isWorkstation) {
|
||||||
r6d.config-generator = {
|
r6d.config-generator = {
|
||||||
conception-assistee = true;
|
conception-assistee = true;
|
||||||
@@ -179,12 +177,10 @@ in
|
|||||||
r6d.profiles = {
|
r6d.profiles = {
|
||||||
isHome = true;
|
isHome = true;
|
||||||
isPrunetwork = true;
|
isPrunetwork = true;
|
||||||
isServer = true;
|
|
||||||
isWorkstation = true;
|
isWorkstation = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
r6d.config-generator = {
|
r6d.config-generator = {
|
||||||
nix-serve-server = true;
|
|
||||||
virtualbox = true;
|
virtualbox = true;
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
@@ -212,7 +208,11 @@ in
|
|||||||
isServer = true;
|
isServer = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
r6d.config-generator.fail2ban = true;
|
r6d.config-generator = {
|
||||||
|
fail2ban = true;
|
||||||
|
nix-serve-client = true;
|
||||||
|
nixStoreProxyCache = true;
|
||||||
|
};
|
||||||
})
|
})
|
||||||
(mkIf comp.isNeoNomade{
|
(mkIf comp.isNeoNomade{
|
||||||
r6d.profiles = {
|
r6d.profiles = {
|
||||||
@@ -231,6 +231,17 @@ in
|
|||||||
laptop = true;
|
laptop = true;
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
(mkIf comp.isPedro {
|
||||||
|
r6d.profiles = {
|
||||||
|
isDubronetwork = true;
|
||||||
|
isServer = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
r6d.config-generator = {
|
||||||
|
fail2ban = true;
|
||||||
|
online-ipv6 = true;
|
||||||
|
};
|
||||||
|
})
|
||||||
(mkIf comp.isPhenom {
|
(mkIf comp.isPhenom {
|
||||||
r6d.profiles = {
|
r6d.profiles = {
|
||||||
isDubronetwork = true;
|
isDubronetwork = true;
|
||||||
@@ -249,7 +260,9 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
r6d.config-generator = {
|
r6d.config-generator = {
|
||||||
|
dovecot = true;
|
||||||
fail2ban = true;
|
fail2ban = true;
|
||||||
|
mailboxes = true;
|
||||||
murmur = true;
|
murmur = true;
|
||||||
online-ipv6 = true;
|
online-ipv6 = true;
|
||||||
znc = true;
|
znc = true;
|
||||||
|
|||||||
@@ -1,19 +1,21 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
cfg = config.r6d.config-generator;
|
cfg = config.r6d.config-generator;
|
||||||
computers = config.r6d.computers;
|
computers = config.r6d.computers;
|
||||||
profiles = config.r6d.profiles;
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
in mkIf cfg.xmonad {
|
mkIf cfg.xmonad {
|
||||||
# Paquets spécifiques pour xmonad
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs;[
|
# Paquets
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
dmenu
|
dmenu
|
||||||
haskellPackages.xmobar
|
haskellPackages.xmobar
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Services
|
||||||
services.xserver.windowManager.xmonad = {
|
services.xserver.windowManager.xmonad = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableContribAndExtras = true;
|
enableContribAndExtras = true;
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ in
|
|||||||
./activation-manuelle/xmonad/xmonad.nix # gestionnaire de fenêtres xmonad
|
./activation-manuelle/xmonad/xmonad.nix # gestionnaire de fenêtres xmonad
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Paquets
|
||||||
environment.systemPackages = with pkgs; mkIf profiles.isDesktop [
|
environment.systemPackages = with pkgs; mkIf profiles.isDesktop [
|
||||||
# Environement de bureau
|
# Environement de bureau
|
||||||
arandr # interface graphique pour xrandr
|
arandr # interface graphique pour xrandr
|
||||||
@@ -54,4 +55,6 @@ in
|
|||||||
clawsMail = pkgs.clawsMail.override { enablePluginFancy = true; };
|
clawsMail = pkgs.clawsMail.override { enablePluginFancy = true; };
|
||||||
mumble = pkgs.mumble.override { pulseSupport = true; };
|
mumble = pkgs.mumble.override { pulseSupport = true; };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
security.setuidPrograms = [ "udevil" ];
|
||||||
}
|
}
|
||||||
|
|||||||
25
module-template.nix
Normal file
25
module-template.nix
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf true {
|
||||||
|
|
||||||
|
# Paquets
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
];
|
||||||
|
|
||||||
|
# Services
|
||||||
|
|
||||||
|
# Réseau
|
||||||
|
networking.firewall = {
|
||||||
|
allowedTCPPorts = [
|
||||||
|
];
|
||||||
|
allowedUDPPorts = [
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,14 +1,15 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
cfg = config.r6d.config-generator;
|
cfg = config.r6d.config-generator;
|
||||||
computers = config.r6d.computers;
|
computers = config.r6d.computers;
|
||||||
profiles = config.r6d.profiles;
|
profiles = config.r6d.profiles;
|
||||||
in
|
in
|
||||||
|
|
||||||
mkIf profiles.isDesktop {
|
mkIf true {
|
||||||
|
|
||||||
|
# Paquets
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
# Adminsys
|
# Adminsys
|
||||||
iotop
|
iotop
|
||||||
@@ -22,22 +23,30 @@ mkIf profiles.isDesktop {
|
|||||||
python27Packages.glances
|
python27Packages.glances
|
||||||
usbutils
|
usbutils
|
||||||
|
|
||||||
# DNS
|
|
||||||
unbound
|
|
||||||
|
|
||||||
# Compression
|
# Compression
|
||||||
lz4
|
lz4
|
||||||
lzop
|
lzop
|
||||||
|
|
||||||
# Système de fichier
|
# Système de fichier
|
||||||
curlftpfs
|
## Montage de filesystem
|
||||||
gparted
|
curlftpfs # ftp
|
||||||
inotify-tools
|
ntfs3g # ntfs
|
||||||
nfs-utils
|
sshfsFuse # ssh
|
||||||
ntfs3g
|
|
||||||
sshfsFuse
|
|
||||||
|
|
||||||
#
|
## Gestion de FS
|
||||||
unetbootin # création de clefs USB bootables
|
nfs-utils
|
||||||
|
|
||||||
|
## Exploitation FS
|
||||||
|
inotify-tools # être notifié lorsque le contenu d'un répertoire change
|
||||||
|
duff # outil de recherche de fichiers en doublons
|
||||||
|
rdfind # recherche de fichiers doublons pour remplacement par hard/soft link
|
||||||
|
|
||||||
|
(mkIf profiles.isDesktop
|
||||||
|
## Gestion de FS
|
||||||
|
gparted # Gestion graphique de partitions
|
||||||
|
)
|
||||||
|
(mkIf profiles.isDesktop
|
||||||
|
unetbootin # création de clefs USB bootables
|
||||||
|
)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
cfg = config.r6d.config-generator;
|
cfg = config.r6d.config-generator;
|
||||||
computers = config.r6d.computers;
|
computers = config.r6d.computers;
|
||||||
profiles = config.r6d.profiles;
|
profiles = config.r6d.profiles;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
cfg = config.r6d.config-generator;
|
cfg = config.r6d.config-generator;
|
||||||
computers = config.r6d.computers;
|
computers = config.r6d.computers;
|
||||||
profiles = config.r6d.profiles;
|
profiles = config.r6d.profiles;
|
||||||
@@ -9,6 +9,7 @@ in
|
|||||||
|
|
||||||
mkIf profiles.isDesktop {
|
mkIf profiles.isDesktop {
|
||||||
|
|
||||||
|
# Paquets
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
# Bureautique
|
# Bureautique
|
||||||
aspell aspellDicts.fr
|
aspell aspellDicts.fr
|
||||||
@@ -34,6 +35,7 @@ mkIf profiles.isDesktop {
|
|||||||
gnuplot # générateur de graphes à partir de données numériques
|
gnuplot # générateur de graphes à partir de données numériques
|
||||||
graphviz # dot, neato : traçage de graphes (carré, rond)
|
graphviz # dot, neato : traçage de graphes (carré, rond)
|
||||||
jekyll # générateur statique de site web
|
jekyll # générateur statique de site web
|
||||||
|
odpdown # conversion md -> presentation ODP : https://github.com/thorstenb/odpdown
|
||||||
pandoc
|
pandoc
|
||||||
texLiveFull # distribution LaTeX
|
texLiveFull # distribution LaTeX
|
||||||
#texLive # distribution LaTeX de base
|
#texLive # distribution LaTeX de base
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
cfg = config.r6d.config-generator;
|
cfg = config.r6d.config-generator;
|
||||||
computers = config.r6d.computers;
|
computers = config.r6d.computers;
|
||||||
profiles = config.r6d.profiles;
|
profiles = config.r6d.profiles;
|
||||||
@@ -9,7 +9,8 @@ in
|
|||||||
|
|
||||||
mkIf cfg.conception-assistee {
|
mkIf cfg.conception-assistee {
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
# Paquets
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
# CAO
|
# CAO
|
||||||
## Modélisation 3D
|
## Modélisation 3D
|
||||||
freecad # modélisation de pièces en 3D
|
freecad # modélisation de pièces en 3D
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
cfg = config.r6d.config-generator;
|
cfg = config.r6d.config-generator;
|
||||||
computers = config.r6d.computers;
|
computers = config.r6d.computers;
|
||||||
profiles = config.r6d.profiles;
|
profiles = config.r6d.profiles;
|
||||||
@@ -9,6 +9,7 @@ in
|
|||||||
|
|
||||||
mkIf cfg.cartographie {
|
mkIf cfg.cartographie {
|
||||||
|
|
||||||
|
# Paquets
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
# Gestion de données géographiques
|
# Gestion de données géographiques
|
||||||
expat
|
expat
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
cfg = config.r6d.config-generator;
|
cfg = config.r6d.config-generator;
|
||||||
computers = config.r6d.computers;
|
computers = config.r6d.computers;
|
||||||
profiles = config.r6d.profiles;
|
profiles = config.r6d.profiles;
|
||||||
@@ -9,6 +9,7 @@ in
|
|||||||
|
|
||||||
mkIf profiles.isDesktop {
|
mkIf profiles.isDesktop {
|
||||||
|
|
||||||
|
# Paquets
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
# Clients Internet
|
# Clients Internet
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
cfg = config.r6d.config-generator;
|
cfg = config.r6d.config-generator;
|
||||||
computers = config.r6d.computers;
|
computers = config.r6d.computers;
|
||||||
profiles = config.r6d.profiles;
|
profiles = config.r6d.profiles;
|
||||||
@@ -9,36 +9,40 @@ in
|
|||||||
|
|
||||||
mkIf cfg.developpement {
|
mkIf cfg.developpement {
|
||||||
|
|
||||||
|
# Paquets
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
# Base de données
|
# Base de données
|
||||||
pgadmin
|
pgadmin # interface d'administration de postgres
|
||||||
sqlitebrowser
|
sqlitebrowser # interface d'administration de sqlite
|
||||||
|
|
||||||
# Développement
|
# Développement
|
||||||
cloc
|
cloc
|
||||||
idea.idea-community
|
idea.idea-community # IntelliJ IDEA
|
||||||
gcc # pour les appels depuis les scripts
|
gcc # pour les appels depuis les scripts
|
||||||
|
|
||||||
# Documentation
|
# Documentation
|
||||||
zeal
|
zeal # consulter la documentation hors ligne
|
||||||
|
|
||||||
## Gestion des sources
|
## Gestion des sources
|
||||||
# git # déjà présent dans "base"
|
# git # déjà présent dans "base"
|
||||||
git-cola
|
# gitg # interface pour utiliser git (historique, commit)
|
||||||
|
gitstats # génère un site web statique avec des statistiques
|
||||||
|
gitAndTools.gitFull # pour gitk
|
||||||
|
git-cola # interface pour utiliser git (historique, commit)
|
||||||
mercurial
|
mercurial
|
||||||
subversion
|
subversion
|
||||||
|
|
||||||
## Haskell
|
## Haskell
|
||||||
ghc
|
ghc # pour les appels depuis les scripts
|
||||||
stack
|
stack
|
||||||
|
|
||||||
## Rust
|
## Rust
|
||||||
cargo # récupération des dépendances + compilation projet rust
|
cargo # récupération des dépendances + compilation projet rust
|
||||||
rustPlatform.rustc
|
rustPlatform.rustc # pour les appels depuis les scripts
|
||||||
|
|
||||||
## Visualisation & outils de diff
|
## Visualisation & outils de diff
|
||||||
gource
|
gource # visualisation en mouvement de l'historique git
|
||||||
meld
|
meld # outil de comparaison graphique
|
||||||
vbindiff # diff de fichier hexadecimaux avec vim
|
vbindiff # diff de fichier hexadecimaux avec vim
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
cfg = config.r6d.config-generator;
|
cfg = config.r6d.config-generator;
|
||||||
computers = config.r6d.computers;
|
computers = config.r6d.computers;
|
||||||
profiles = config.r6d.profiles;
|
profiles = config.r6d.profiles;
|
||||||
@@ -9,6 +9,7 @@ in
|
|||||||
|
|
||||||
mkIf cfg.docker {
|
mkIf cfg.docker {
|
||||||
|
|
||||||
|
# Paquets
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
# Ecosystème Docker
|
# Ecosystème Docker
|
||||||
docker
|
docker
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
cfg = config.r6d.config-generator;
|
cfg = config.r6d.config-generator;
|
||||||
computers = config.r6d.computers;
|
computers = config.r6d.computers;
|
||||||
profiles = config.r6d.profiles;
|
profiles = config.r6d.profiles;
|
||||||
@@ -9,7 +9,8 @@ in
|
|||||||
|
|
||||||
mkIf cfg.edition-musique {
|
mkIf cfg.edition-musique {
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
# Paquets
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
#
|
#
|
||||||
audacity # montage audio
|
audacity # montage audio
|
||||||
easytag # gestion des métadonnées des fichiers musicaux
|
easytag # gestion des métadonnées des fichiers musicaux
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
cfg = config.r6d.config-generator;
|
cfg = config.r6d.config-generator;
|
||||||
computers = config.r6d.computers;
|
computers = config.r6d.computers;
|
||||||
profiles = config.r6d.profiles;
|
profiles = config.r6d.profiles;
|
||||||
@@ -9,6 +9,7 @@ in
|
|||||||
|
|
||||||
mkIf cfg.edition-photo {
|
mkIf cfg.edition-photo {
|
||||||
|
|
||||||
|
# Paquets
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
# Méta données
|
# Méta données
|
||||||
exif
|
exif
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
cfg = config.r6d.config-generator;
|
cfg = config.r6d.config-generator;
|
||||||
computers = config.r6d.computers;
|
computers = config.r6d.computers;
|
||||||
profiles = config.r6d.profiles;
|
profiles = config.r6d.profiles;
|
||||||
@@ -9,7 +9,8 @@ in
|
|||||||
|
|
||||||
mkIf cfg.edition-video {
|
mkIf cfg.edition-video {
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
# Paquets
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
# Vidéo
|
# Vidéo
|
||||||
#cinelerra # editeur video
|
#cinelerra # editeur video
|
||||||
pitivi # montage vidéo
|
pitivi # montage vidéo
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
cfg = config.r6d.config-generator;
|
cfg = config.r6d.config-generator;
|
||||||
computers = config.r6d.computers;
|
computers = config.r6d.computers;
|
||||||
profiles = config.r6d.profiles;
|
profiles = config.r6d.profiles;
|
||||||
@@ -9,6 +9,7 @@ in
|
|||||||
|
|
||||||
mkIf cfg.jeux {
|
mkIf cfg.jeux {
|
||||||
|
|
||||||
|
# Paquets
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
# Jeux
|
# Jeux
|
||||||
urbanterror
|
urbanterror
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
cfg = config.r6d.config-generator;
|
cfg = config.r6d.config-generator;
|
||||||
computers = config.r6d.computers;
|
computers = config.r6d.computers;
|
||||||
profiles = config.r6d.profiles;
|
profiles = config.r6d.profiles;
|
||||||
@@ -9,6 +9,7 @@ in
|
|||||||
|
|
||||||
mkIf profiles.isDesktop {
|
mkIf profiles.isDesktop {
|
||||||
|
|
||||||
|
# Paquets
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
# Multimedia
|
# Multimedia
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ in
|
|||||||
|
|
||||||
mkIf profiles.isDesktop {
|
mkIf profiles.isDesktop {
|
||||||
|
|
||||||
|
# Paquets
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
# Outils réseau
|
# Outils réseau
|
||||||
iperf # outil de mesure de la qualité du réseau
|
iperf # outil de mesure de la qualité du réseau
|
||||||
@@ -23,7 +24,11 @@ mkIf profiles.isDesktop {
|
|||||||
];
|
];
|
||||||
|
|
||||||
networking.firewall = {
|
networking.firewall = {
|
||||||
allowedTCPPorts = [5201]; # iperf
|
allowedTCPPorts = [
|
||||||
allowedUDPPorts = [5201]; # iperf
|
5201 # iperf
|
||||||
|
];
|
||||||
|
allowedUDPPorts = [
|
||||||
|
5201 # iperf
|
||||||
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
cfg = config.r6d.config-generator;
|
cfg = config.r6d.config-generator;
|
||||||
computers = config.r6d.computers;
|
computers = config.r6d.computers;
|
||||||
profiles = config.r6d.profiles;
|
profiles = config.r6d.profiles;
|
||||||
@@ -9,6 +9,7 @@ in
|
|||||||
|
|
||||||
mkIf profiles.isDesktop {
|
mkIf profiles.isDesktop {
|
||||||
|
|
||||||
|
# Paquets
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
# Securité
|
# Securité
|
||||||
gnome3.seahorse # gestionnaire graphique de clef GPG
|
gnome3.seahorse # gestionnaire graphique de clef GPG
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
cfg = config.r6d.config-generator;
|
cfg = config.r6d.config-generator;
|
||||||
computers = config.r6d.computers;
|
computers = config.r6d.computers;
|
||||||
profiles = config.r6d.profiles;
|
profiles = config.r6d.profiles;
|
||||||
@@ -9,10 +9,19 @@ in
|
|||||||
|
|
||||||
mkIf cfg.virtualbox {
|
mkIf cfg.virtualbox {
|
||||||
|
|
||||||
|
# Paquets
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
linuxPackages.virtualbox
|
linuxPackages.virtualbox
|
||||||
linuxPackages.virtualboxGuestAdditions
|
linuxPackages.virtualboxGuestAdditions
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# À décommenter pour activer le pack d'extension
|
||||||
|
#boot.kernelPackages = pkgs.linuxPackages // {
|
||||||
|
# virtualbox = pkgs.linuxPackages.virtualbox.override {
|
||||||
|
# enableExtensionPack = true;
|
||||||
|
# pulseSupport = true;
|
||||||
|
# };
|
||||||
|
#};
|
||||||
|
|
||||||
virtualisation.virtualbox.host.enable = true;
|
virtualisation.virtualbox.host.enable = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
cfg = config.r6d.config-generator;
|
cfg = config.r6d.config-generator;
|
||||||
computers = config.r6d.computers;
|
computers = config.r6d.computers;
|
||||||
profiles = config.r6d.profiles;
|
profiles = config.r6d.profiles;
|
||||||
in
|
in
|
||||||
|
|
||||||
mkIf cfg.auto-upgrade {
|
mkIf cfg.auto-upgrade {
|
||||||
|
|
||||||
# Automatic update & automatic clean
|
# Automatic update & automatic clean
|
||||||
|
|
||||||
system.autoUpgrade.enable = true;
|
system.autoUpgrade.enable = true;
|
||||||
|
|||||||
@@ -1,4 +1,11 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
# Nombre de process d'installation en parrallèle effectués par Nix
|
# Nombre de process d'installation en parrallèle effectués par Nix
|
||||||
@@ -10,8 +17,7 @@
|
|||||||
# On autorise les paquets non-libres
|
# On autorise les paquets non-libres
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
# List packages installed in system profile. To search by name, run:
|
# Paquets
|
||||||
# $ nix-env -qaP | grep wget
|
|
||||||
environment = {
|
environment = {
|
||||||
systemPackages = with pkgs; [
|
systemPackages = with pkgs; [
|
||||||
bind # utilisé pour les utilitaires comme dig
|
bind # utilisé pour les utilitaires comme dig
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
cfg = config.r6d.config-generator;
|
cfg = config.r6d.config-generator;
|
||||||
computers = config.r6d.computers;
|
computers = config.r6d.computers;
|
||||||
profiles = config.r6d.profiles;
|
profiles = config.r6d.profiles;
|
||||||
@@ -19,6 +19,7 @@ mkIf cfg.laptop {
|
|||||||
|
|
||||||
hardware.bluetooth.enable = true;
|
hardware.bluetooth.enable = true;
|
||||||
|
|
||||||
|
# Paquets
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
networkmanagerapplet
|
networkmanagerapplet
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,6 +1,14 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf true {
|
||||||
|
|
||||||
{
|
|
||||||
# Select internationalisation properties.
|
# Select internationalisation properties.
|
||||||
i18n = {
|
i18n = {
|
||||||
consoleFont = "Lat2-Terminus16";
|
consoleFont = "Lat2-Terminus16";
|
||||||
|
|||||||
@@ -1,6 +1,14 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf true {
|
||||||
|
|
||||||
{
|
|
||||||
# Utilisation d'adresse IPv6 temporaire
|
# Utilisation d'adresse IPv6 temporaire
|
||||||
|
|
||||||
## https://blog.linitx.com/control-privacy-addressing-ipv6-linux/
|
## https://blog.linitx.com/control-privacy-addressing-ipv6-linux/
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
cfg = config.r6d.config-generator;
|
cfg = config.r6d.config-generator;
|
||||||
computers = config.r6d.computers;
|
computers = config.r6d.computers;
|
||||||
profiles = config.r6d.profiles;
|
profiles = config.r6d.profiles;
|
||||||
in
|
in
|
||||||
|
|
||||||
mkIf cfg.print {
|
mkIf cfg.print {
|
||||||
# Enable CUPS to print documents.
|
|
||||||
|
# Services
|
||||||
|
## Enable CUPS to print documents.
|
||||||
services.printing = {
|
services.printing = {
|
||||||
enable = true;
|
enable = true;
|
||||||
drivers = [
|
drivers = [
|
||||||
|
|||||||
@@ -1,11 +1,19 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
#inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
# installées systématiquement
|
# installées systématiquement
|
||||||
./environment.nix
|
./environment.nix
|
||||||
./localisation.nix
|
./localisation.nix
|
||||||
./network-ipv6.nix
|
#./network-ipv6.nix
|
||||||
|
./sudo.nix
|
||||||
./service-haveged.nix
|
./service-haveged.nix
|
||||||
./service-monitoring.nix
|
./service-monitoring.nix
|
||||||
./service-ssh.nix
|
./service-ssh.nix
|
||||||
|
|||||||
@@ -1,7 +1,16 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
{
|
let
|
||||||
# Sécurité & Acces distant
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf true {
|
||||||
|
|
||||||
|
# Sécurité & Accès distant
|
||||||
|
# Services
|
||||||
|
|
||||||
## Augmentation de l'entropie du système par un générateur de nombres aléatoires
|
## Augmentation de l'entropie du système par un générateur de nombres aléatoires
|
||||||
## cat /proc/sys/kernel/random/entropy_avail
|
## cat /proc/sys/kernel/random/entropy_avail
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
cfg = config.r6d.config-generator;
|
cfg = config.r6d.config-generator;
|
||||||
computers = config.r6d.computers;
|
computers = config.r6d.computers;
|
||||||
profiles = config.r6d.profiles;
|
profiles = config.r6d.profiles;
|
||||||
@@ -11,6 +11,7 @@ mkIf cfg.laptop {
|
|||||||
|
|
||||||
# Gestion spécifique pour PC portable
|
# Gestion spécifique pour PC portable
|
||||||
|
|
||||||
|
# Services
|
||||||
services.xserver.synaptics = {
|
services.xserver.synaptics = {
|
||||||
enable = true;
|
enable = true;
|
||||||
twoFingerScroll = true;
|
twoFingerScroll = true;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
cfg = config.r6d.config-generator;
|
cfg = config.r6d.config-generator;
|
||||||
computers = config.r6d.computers;
|
computers = config.r6d.computers;
|
||||||
profiles = config.r6d.profiles;
|
profiles = config.r6d.profiles;
|
||||||
@@ -9,6 +9,7 @@ in
|
|||||||
|
|
||||||
mkIf cfg.locate {
|
mkIf cfg.locate {
|
||||||
|
|
||||||
|
# Services
|
||||||
services.locate = {
|
services.locate = {
|
||||||
enable = true;
|
enable = true;
|
||||||
interval = "hourly";
|
interval = "hourly";
|
||||||
|
|||||||
@@ -1,14 +1,27 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
{
|
let
|
||||||
# Monitoring
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
# Noeud de supervision munin = pas de stockage des données locales
|
mkIf true {
|
||||||
|
|
||||||
|
# Paquets
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
mailutils
|
||||||
|
];
|
||||||
|
|
||||||
|
# Services
|
||||||
|
|
||||||
|
## Noeud de supervision munin = pas de stockage des données locales
|
||||||
services.munin-node = {
|
services.munin-node = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Munin server -- generate /var/www/munin
|
## Munin server -- generate /var/www/munin
|
||||||
services.munin-cron = {
|
services.munin-cron = {
|
||||||
enable = true;
|
enable = true;
|
||||||
hosts = ''
|
hosts = ''
|
||||||
@@ -20,12 +33,12 @@
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [
|
# Réseau
|
||||||
# TODO configurer les bon ports lors de l'ouverture du service
|
networking.firewall = {
|
||||||
8000
|
allowedTCPPorts = [
|
||||||
];
|
8000
|
||||||
|
];
|
||||||
## Documentation
|
allowedUDPPorts = [
|
||||||
# * https://nixos.org/wiki/Create_and_debug_nix_packages
|
];
|
||||||
# * http://chriswarbo.net/essays/nixos/developing_on_nixos.html
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
cfg = config.r6d.config-generator;
|
cfg = config.r6d.config-generator;
|
||||||
computers = config.r6d.computers;
|
computers = config.r6d.computers;
|
||||||
profiles = config.r6d.profiles;
|
profiles = config.r6d.profiles;
|
||||||
mkIf = pkgs.lib.mkIf;
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
mkIf profiles.isDesktop {
|
||||||
|
|
||||||
# Pulse Audio
|
# Pulse Audio
|
||||||
hardware.pulseaudio = mkIf profiles.isDesktop {
|
hardware.pulseaudio = {
|
||||||
enable = true;
|
enable = true;
|
||||||
support32Bit = true;
|
support32Bit = true;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,7 +1,16 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
{
|
let
|
||||||
# OpenSSH daemon
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf true {
|
||||||
|
|
||||||
|
# Services
|
||||||
|
## OpenSSH daemon
|
||||||
services.openssh = {
|
services.openssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
# https://wiki.mozilla.org/Security/Guidelines/OpenSSH#Modern_.28OpenSSH_6.7.2B.29
|
# https://wiki.mozilla.org/Security/Guidelines/OpenSSH#Modern_.28OpenSSH_6.7.2B.29
|
||||||
|
|||||||
@@ -1,15 +1,17 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
cfg = config.r6d.config-generator;
|
cfg = config.r6d.config-generator;
|
||||||
computers = config.r6d.computers;
|
computers = config.r6d.computers;
|
||||||
profiles = config.r6d.profiles;
|
profiles = config.r6d.profiles;
|
||||||
mkIf = pkgs.lib.mkIf;
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
mkIf profiles.isDesktop {
|
||||||
|
|
||||||
|
# Services
|
||||||
# Enable the X11 windowing system.
|
# Enable the X11 windowing system.
|
||||||
services.xserver = mkIf profiles.isDesktop {
|
services.xserver = {
|
||||||
enable = true;
|
enable = true;
|
||||||
layout = "fr";
|
layout = "fr";
|
||||||
xkbOptions = "eurosign:e";
|
xkbOptions = "eurosign:e";
|
||||||
|
|||||||
17
public/sudo.nix
Normal file
17
public/sudo.nix
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf true {
|
||||||
|
|
||||||
|
# Authorisation de certaines applications par sudo sans mot de passe
|
||||||
|
|
||||||
|
security.sudo.extraConfig = ''
|
||||||
|
%users ALL = NOPASSWD: ${pkgs.mtr}/bin/mtr
|
||||||
|
'';
|
||||||
|
}
|
||||||
@@ -1,13 +1,14 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf mkMerge mkThenElse;
|
||||||
cfg = config.r6d.config-generator;
|
cfg = config.r6d.config-generator;
|
||||||
computers = config.r6d.computers;
|
computers = config.r6d.computers;
|
||||||
profiles = config.r6d.profiles;
|
profiles = config.r6d.profiles;
|
||||||
in
|
in
|
||||||
|
|
||||||
mkIf cfg.swap {
|
mkIf cfg.swap {
|
||||||
|
|
||||||
# Gestion du swap
|
# Gestion du swap
|
||||||
|
|
||||||
# https://en.wikipedia.org/wiki/Swappiness
|
# https://en.wikipedia.org/wiki/Swappiness
|
||||||
|
|||||||
Reference in New Issue
Block a user