Compare commits
141 Commits
2016-07-21
...
2016-08-09
| Author | SHA1 | Date | |
|---|---|---|---|
| 7536316133 | |||
| c346262619 | |||
| 312cc9ddc2 | |||
| ff3e764bc2 | |||
| 4100ff2f2f | |||
| b64a846407 | |||
| 2df8cf6695 | |||
| 40ea98af6b | |||
|
|
944f8103e6 | ||
| 453ad77953 | |||
| 3c7274848d | |||
| 1d5692fbc5 | |||
| 7367bd462e | |||
| 3de2cceef4 | |||
| 8ebfe6c9a6 | |||
| 33e44d23f9 | |||
|
|
461adfc7fe | ||
| 47de85f6bd | |||
| abec02d668 | |||
| 78cccc3934 | |||
| 42c1327500 | |||
| e685d8e518 | |||
| 366272d1f6 | |||
| 25e9a9c1ab | |||
| e685771d12 | |||
| 67907ba8c8 | |||
| 36c0eba3b5 | |||
| 3d7b3f1106 | |||
|
|
71c89d7272 | ||
|
|
e974e8949d | ||
| a8b5ee97c6 | |||
| 45a4bc9a28 | |||
|
|
b998bea22e | ||
|
|
a356a2f5fa | ||
|
|
0e5137a236 | ||
|
|
65064f7f8b | ||
|
|
12e3f20a8e | ||
| a05ef8fbdc | |||
| e6fc844aaf | |||
|
|
eaa35ac70e | ||
| 2bcc6944b2 | |||
| 013b83c9a0 | |||
|
|
a5842e7763 | ||
| 06ec0979dc | |||
| 221bcd2dee | |||
| aec2f9bfe9 | |||
| a84ca742de | |||
| 256ae50aea | |||
| 35e09f59d5 | |||
| 40f547852e | |||
| 2a4c036ee4 | |||
| ee93d2f29d | |||
| 55880e13f3 | |||
| 9db6440dab | |||
| 5d86171461 | |||
| 909844a961 | |||
| 3b39357e2a | |||
| 3a3e43dd26 | |||
|
|
11c624da59 | ||
|
|
e88711df13 | ||
|
|
8881df0d4a | ||
|
|
206430165a | ||
| 6ff5e008a7 | |||
| 35c49c2fcd | |||
| 95c7fc7a14 | |||
|
|
908be0c5e8 | ||
|
|
12fe6f2b94 | ||
| dbd58cabc0 | |||
| 5fa77bda2e | |||
| 363b2f56e4 | |||
| 5380bb76b0 | |||
| ef3778dd54 | |||
| b50aa1ad0e | |||
| 326da0f7e8 | |||
| c5b7c16946 | |||
| af15068c29 | |||
| d503b8f0f4 | |||
| 7bd6eb37e3 | |||
| 592e5664be | |||
| 20e8e8beaa | |||
| 66252cb498 | |||
| 906ae9b7d1 | |||
| 2195033ee5 | |||
| becd37ba28 | |||
| f55ae85a66 | |||
|
|
e0cd512f87 | ||
|
|
51787ab25b | ||
| 7e9a8131a3 | |||
|
|
ba9cdb7518 | ||
|
|
bd70296e68 | ||
| 50083e7d93 | |||
| a5f3e7f87d | |||
| 3180832a1f | |||
| 49dfc7eeb0 | |||
| 0bfca5b71d | |||
| 62b1537353 | |||
| c8444defd3 | |||
| df8df234c1 | |||
| 11a50ead02 | |||
| 28f91e5327 | |||
|
|
b816211833 | ||
| 5e470017d6 | |||
| d5ef35906b | |||
| a27a1c5aed | |||
|
|
0ad1b1038c | ||
|
|
dee3648f70 | ||
|
|
4a68e71a1d | ||
|
|
10f7efd252 | ||
| e8d0ccd483 | |||
|
|
ae328bb742 | ||
|
|
b5316cc818 | ||
|
|
024227a2f1 | ||
| 00a4fb4e16 | |||
| fff3b94beb | |||
| 3e5540a9e6 | |||
| 47b69d9e85 | |||
| 2479e9f72b | |||
| e60fd00c47 | |||
| e40206c116 | |||
| 63108b2077 | |||
| 1991c00fe8 | |||
| af3faefeee | |||
| bec1c4b84d | |||
| 59a545f3ab | |||
| 171ccd1559 | |||
|
|
d1114b0548 | ||
|
|
745bcf876a | ||
|
|
c85389b633 | ||
|
|
fb068f2efa | ||
|
|
ba13255577 | ||
|
|
d9a03c1445 | ||
|
|
669be98608 | ||
|
|
1a4277af74 | ||
|
|
fbf0ddfbae | ||
|
|
dac301ae6c | ||
|
|
cfcaaf1509 | ||
| fc2c49b15d | |||
| fb1ac16d95 | |||
| 6e73a026ca | |||
| 4e3ec6c71f | |||
| aa7d44af03 |
4
Makefile
4
Makefile
@@ -23,7 +23,7 @@ push: submodules-push
|
|||||||
git push --tags
|
git push --tags
|
||||||
|
|
||||||
rebuild-switch:
|
rebuild-switch:
|
||||||
nixos-rebuild switch
|
nixos-rebuild switch --fallback --show-trace
|
||||||
|
|
||||||
store-repair:
|
store-repair:
|
||||||
nix-store --verify --check-contents --repair
|
nix-store --verify --check-contents --repair
|
||||||
@@ -44,5 +44,5 @@ tag: submodules-tag
|
|||||||
git tag -f "$$(date +%F)-$$(hostname -s)"
|
git tag -f "$$(date +%F)-$$(hostname -s)"
|
||||||
|
|
||||||
upgrade:
|
upgrade:
|
||||||
nixos-rebuild switch --upgrade
|
nixos-rebuild switch --upgrade --fallback --show-trace
|
||||||
|
|
||||||
|
|||||||
6
README
6
README
@@ -1,3 +1,9 @@
|
|||||||
|
# nixos-template-base
|
||||||
|
|
||||||
|
Ce dépôt stocke une configuration générique des machines.
|
||||||
|
Une recette dite "config-generator" adapte la configuration selon le nom de la machine (FQDN).
|
||||||
|
|
||||||
|
Actuellement, les scripts contiennent un peu de configuration spécifique pour les machines des mainteneurs.
|
||||||
|
|
||||||
# Lien pour install sur machine distante
|
# Lien pour install sur machine distante
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
# Automatic update & automatic clean
|
|
||||||
|
|
||||||
system.autoUpgrade.enable = config.r6d.config-generator.auto-upgrade;
|
|
||||||
nix.gc.automatic = config.r6d.config-generator.auto-upgrade;
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
# Gestion spécifique pour PC portable
|
|
||||||
powerManagement.cpuFreqGovernor = pkgs.lib.mkIf config.r6d.config-generator.laptop "powersave";
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
];
|
|
||||||
|
|
||||||
services.locate = {
|
|
||||||
enable = config.r6d.config-generator.locate;
|
|
||||||
interval = "hourly";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
# Cache http pour le store
|
|
||||||
|
|
||||||
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 ];
|
|
||||||
}
|
|
||||||
File diff suppressed because one or more lines are too long
12
base.nix
12
base.nix
@@ -1,13 +1,13 @@
|
|||||||
{ config, pkgs, ... }:
|
{ ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./environment.nix
|
# recettes
|
||||||
./localisation.nix
|
./base/base.nix
|
||||||
./networking.nix
|
./desktop/desktop.nix
|
||||||
./services.nix
|
./public/public.nix
|
||||||
|
|
||||||
# inclusion conditionnelle
|
# moulinette de configuration
|
||||||
./config-generator.nix
|
./config-generator.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
1
base/Makefile
Symbolic link
1
base/Makefile
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/etc/nixos/base/Makefile
|
||||||
@@ -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,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 {
|
||||||
12
base/activation-manuelle/nix-serve-server.nix
Normal file
12
base/activation-manuelle/nix-serve-server.nix
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
with pkgs.lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
in {
|
||||||
|
# Cache http pour le store
|
||||||
|
|
||||||
|
services.nix-serve.enable = cfg.nix-serve-server;
|
||||||
|
networking.firewall.allowedTCPPorts = mkIf cfg.nix-serve-server [ 5000 ];
|
||||||
|
}
|
||||||
74
base/activation-manuelle/users.nix
Normal file
74
base/activation-manuelle/users.nix
Normal file
File diff suppressed because one or more lines are too long
13
base/base.nix
Normal file
13
base/base.nix
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./network-dns.nix
|
||||||
|
|
||||||
|
# inclusion conditionnelle
|
||||||
|
./activation-manuelle/fail2ban.nix
|
||||||
|
./activation-manuelle/nix-serve-client.nix
|
||||||
|
./activation-manuelle/nix-serve-server.nix
|
||||||
|
./activation-manuelle/users.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
14
base/network-dns.nix
Normal file
14
base/network-dns.nix
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Définition des domaines utilisés lorsque un identifiant non-FQDN est donné (ping, nslookup)
|
||||||
|
networking = {
|
||||||
|
search = [
|
||||||
|
"dubronetwork.fr"
|
||||||
|
"prunetwork.fr"
|
||||||
|
"teleragno.fr"
|
||||||
|
"teleragno.net"
|
||||||
|
];
|
||||||
|
dnsExtensionMechanism = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -9,18 +9,7 @@ let
|
|||||||
host = config.networking.hostName;
|
host = config.networking.hostName;
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
|
||||||
./activation-manuelle/auto-upgrade.nix
|
|
||||||
./activation-manuelle/laptop.nix
|
|
||||||
./activation-manuelle/locate.nix
|
|
||||||
./activation-manuelle/fail2ban.nix
|
|
||||||
./activation-manuelle/nix-serve-client.nix
|
|
||||||
./activation-manuelle/nix-serve-server.nix
|
|
||||||
./activation-manuelle/swap.nix
|
|
||||||
./activation-manuelle/users.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
###### interface
|
###### interface
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
@@ -42,13 +31,26 @@ in
|
|||||||
enable = mkEnableOption "Génération de la configuration d'une machine.";
|
enable = mkEnableOption "Génération de la configuration d'une machine.";
|
||||||
awesome = mkEnableOption "Profil pour activer le gestionnaire de fenêtre awesome.";
|
awesome = mkEnableOption "Profil pour activer le gestionnaire de fenêtre awesome.";
|
||||||
auto-upgrade = mkEnableOption "Profil pour activer les mises à jour automatiques.";
|
auto-upgrade = mkEnableOption "Profil pour activer les mises à jour automatiques.";
|
||||||
|
cartographie = mkEnableOption "Profil pour activer les outils de gestion de données géographiques.";
|
||||||
|
conception-assistee = mkEnableOption "Profil pour activer les outils de conception électronique & modélisation 3D";
|
||||||
|
database_postgres=mkEnableOption "Profil pour activer le SGBD PostgreSQL.";
|
||||||
|
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.";
|
||||||
|
dns_autorite = mkEnableOption "Profil pour servir les fichiers de zone DNS.";
|
||||||
|
dns_resolveur = mkEnableOption "Profil pour activer un résolveur DNS local.";
|
||||||
|
edition-musique = mkEnableOption "Profil pour la création/édition de musique.";
|
||||||
|
edition-photo = mkEnableOption "Profil pour la création/édition de photos.";
|
||||||
|
edition-video = mkEnableOption "Profil pour la création/édition de video.";
|
||||||
fail2ban = mkEnableOption "Profil pour activer Fail2ban.";
|
fail2ban = mkEnableOption "Profil pour activer Fail2ban.";
|
||||||
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.";
|
||||||
nix-serve-client= mkEnableOption "Profil pour que la machine soit un serveur de cache nix.";
|
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-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.";
|
||||||
|
online-ipv6 = mkEnableOption "Profil pour activer l'IPv6 de online.net";
|
||||||
|
print = mkEnableOption "Profil pour activer cups & pouvoir imprimer.";
|
||||||
|
rabbitmq = mkEnableOption "Profil pour activer le service de messagerie AMQP.";
|
||||||
swap = mkEnableOption "Profil pour que le swap soit activé.";
|
swap = mkEnableOption "Profil pour que le swap soit activé.";
|
||||||
virtualbox = mkEnableOption "Profil pour l'utilisation de VirtualBox.";
|
virtualbox = mkEnableOption "Profil pour l'utilisation de VirtualBox.";
|
||||||
xmonad = mkEnableOption "Profil pour activer le gestionnaire de fenêtres xmonad.";
|
xmonad = mkEnableOption "Profil pour activer le gestionnaire de fenêtres xmonad.";
|
||||||
@@ -62,6 +64,7 @@ in
|
|||||||
isOcean = mkEnableOption "Identification du nom de machine.";
|
isOcean = 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.";
|
||||||
isXray = mkEnableOption "Identification du nom de machine.";
|
isXray = mkEnableOption "Identification du nom de machine.";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -81,6 +84,7 @@ in
|
|||||||
isOcean = host == "ocean.prunetwork.fr";
|
isOcean = host == "ocean.prunetwork.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";
|
||||||
isXray = host == "xray.prunetwork.fr";
|
isXray = host == "xray.prunetwork.fr";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -89,22 +93,51 @@ in
|
|||||||
|
|
||||||
## Définition des profils génériques
|
## Définition des profils génériques
|
||||||
(mkIf pfl.isDesktop {
|
(mkIf pfl.isDesktop {
|
||||||
r6d.config-generator.awesome = true;
|
r6d.config-generator = {
|
||||||
|
awesome = true;
|
||||||
|
nix-serve-client = true;
|
||||||
|
};
|
||||||
})
|
})
|
||||||
(mkIf pfl.isHome {
|
(mkIf pfl.isHome {
|
||||||
r6d.profiles.isDesktop = true;
|
r6d.profiles.isDesktop = true;
|
||||||
})
|
})
|
||||||
(mkIf pfl.isServer {
|
(mkIf pfl.isServer {
|
||||||
r6d.config-generator.nix-serve-server = true;
|
r6d.config-generator = {
|
||||||
|
#database_postgres = true;
|
||||||
|
dns_autorite = true;
|
||||||
|
#dns_resolveur = true;
|
||||||
|
# inutile d'exposer la conf complète du serveur par le store tant qu'il n'y a pas de protection complémentaire - utilisation SSH ?
|
||||||
|
#nix-serve-server = true;
|
||||||
|
|
||||||
|
#rabbitmq = true;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
# /!\ PAS un serveur
|
||||||
|
(mkIf (!pfl.isServer) {
|
||||||
|
r6d.config-generator = {
|
||||||
|
dns_resolveur = true;
|
||||||
|
};
|
||||||
})
|
})
|
||||||
(mkIf pfl.isWorkstation {
|
(mkIf pfl.isWorkstation {
|
||||||
r6d.profiles.isDesktop = true;
|
r6d.profiles.isDesktop = true;
|
||||||
|
|
||||||
r6d.config-generator.docker = true;
|
r6d.config-generator = {
|
||||||
|
cartographie = true;
|
||||||
|
developpement = true;
|
||||||
|
docker = true;
|
||||||
|
|
||||||
|
edition-musique = true;
|
||||||
|
edition-photo = true;
|
||||||
|
edition-video = true;
|
||||||
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
|
## Profils liés à Dubronetwork
|
||||||
(mkIf pfl.isDubronetwork {
|
(mkIf pfl.isDubronetwork {
|
||||||
r6d.config-generator.auto-upgrade = true;
|
r6d.config-generator = {
|
||||||
r6d.config-generator.nix-serve-client = true;
|
auto-upgrade = true;
|
||||||
|
print = true;
|
||||||
|
};
|
||||||
})
|
})
|
||||||
(mkIf (pfl.isDubronetwork && pfl.isHome) {
|
(mkIf (pfl.isDubronetwork && pfl.isHome) {
|
||||||
r6d.config-generator.jeux = true;
|
r6d.config-generator.jeux = true;
|
||||||
@@ -113,55 +146,78 @@ in
|
|||||||
r6d.config-generator.nix-serve-server = true;
|
r6d.config-generator.nix-serve-server = true;
|
||||||
})
|
})
|
||||||
(mkIf (pfl.isDubronetwork && pfl.isWorkstation) {
|
(mkIf (pfl.isDubronetwork && pfl.isWorkstation) {
|
||||||
r6d.config-generator.virtualbox = true;
|
r6d.config-generator = {
|
||||||
|
conception-assistee = true;
|
||||||
|
virtualbox = true;
|
||||||
|
xmonad = true;
|
||||||
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
|
## Profils liés à Prunetwork
|
||||||
(mkIf pfl.isPrunetwork {
|
(mkIf pfl.isPrunetwork {
|
||||||
r6d.config-generator.auto-upgrade = true;
|
r6d.config-generator = {
|
||||||
r6d.config-generator.fail2ban = true;
|
auto-upgrade = true;
|
||||||
r6d.config-generator.nix-serve-client = true;
|
fail2ban = true;
|
||||||
r6d.config-generator.swap = true;
|
swap = true;
|
||||||
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
## Affectation des profils aux machines
|
## Affectation des profils aux machines
|
||||||
(mkIf comp.isOcean {
|
(mkIf comp.isOcean {
|
||||||
r6d.profiles.isPrunetwork = true;
|
r6d.profiles = {
|
||||||
r6d.profiles.isServer = true;
|
isPrunetwork = true;
|
||||||
})
|
isServer = true;
|
||||||
(mkIf comp.isRadx {
|
};
|
||||||
r6d.profiles.isHome = true;
|
|
||||||
r6d.profiles.isPrunetwork = true;
|
|
||||||
r6d.profiles.isServer = true;
|
|
||||||
r6d.profiles.isWorkstation = true;
|
|
||||||
|
|
||||||
r6d.config-generator = {
|
r6d.config-generator = {
|
||||||
|
docker = true;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
(mkIf comp.isRadx {
|
||||||
|
r6d.profiles = {
|
||||||
|
isHome = true;
|
||||||
|
isPrunetwork = true;
|
||||||
|
isServer = true;
|
||||||
|
isWorkstation = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
r6d.config-generator = {
|
||||||
|
nix-serve-server = true;
|
||||||
virtualbox = true;
|
virtualbox = true;
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
(mkIf comp.isXray {
|
(mkIf comp.isXray {
|
||||||
r6d.profiles.isPrunetwork = true;
|
r6d.profiles = {
|
||||||
r6d.profiles.isServer = true;
|
isPrunetwork = true;
|
||||||
|
isServer = true;
|
||||||
|
};
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf comp.isLatitude {
|
(mkIf comp.isLatitude {
|
||||||
r6d.profiles.isDubronetwork = true;
|
r6d.profiles = {
|
||||||
r6d.profiles.isHome = true;
|
isDubronetwork = true;
|
||||||
r6d.profiles.isWorkstation = true;
|
isHome = true;
|
||||||
|
isWorkstation = true;
|
||||||
|
};
|
||||||
|
|
||||||
r6d.config-generator = {
|
r6d.config-generator = {
|
||||||
laptop = true;
|
laptop = true;
|
||||||
xmonad = true;
|
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
(mkIf comp.isMonstre {
|
(mkIf comp.isMonstre {
|
||||||
r6d.profiles.isDubronetwork = true;
|
r6d.profiles = {
|
||||||
r6d.profiles.isServer = true;
|
isDubronetwork = true;
|
||||||
|
isServer = true;
|
||||||
|
};
|
||||||
|
|
||||||
r6d.config-generator.fail2ban = true;
|
r6d.config-generator.fail2ban = true;
|
||||||
})
|
})
|
||||||
(mkIf comp.isNeoNomade{
|
(mkIf comp.isNeoNomade{
|
||||||
r6d.profiles.isDubronetwork = true;
|
r6d.profiles = {
|
||||||
r6d.profiles.isHome = true;
|
isDubronetwork = true;
|
||||||
|
isHome = true;
|
||||||
|
};
|
||||||
|
|
||||||
r6d.config-generator = {
|
r6d.config-generator = {
|
||||||
laptop = true;
|
laptop = true;
|
||||||
@@ -175,12 +231,27 @@ in
|
|||||||
};
|
};
|
||||||
})
|
})
|
||||||
(mkIf comp.isPhenom {
|
(mkIf comp.isPhenom {
|
||||||
r6d.profiles.isDubronetwork = true;
|
r6d.profiles = {
|
||||||
r6d.profiles.isHome = true;
|
isDubronetwork = true;
|
||||||
r6d.profiles.isWorkstation = true;
|
isHome = true;
|
||||||
|
isWorkstation = true;
|
||||||
|
};
|
||||||
|
|
||||||
r6d.config-generator.nix-serve-server = true;
|
r6d.config-generator = {
|
||||||
r6d.config-generator.xmonad = true;
|
nix-serve-server = true;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
(mkIf comp.isRollo {
|
||||||
|
r6d.profiles = {
|
||||||
|
isDubronetwork = true;
|
||||||
|
isServer = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
r6d.config-generator = {
|
||||||
|
fail2ban = true;
|
||||||
|
murmur = true;
|
||||||
|
online-ipv6 = true;
|
||||||
|
};
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
32
desktop/activation-manuelle/xmonad/xmobarrc
Normal file
32
desktop/activation-manuelle/xmonad/xmobarrc
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
Config { font = "xft:Monospace-10:bold"
|
||||||
|
, additionalFonts = []
|
||||||
|
, border = NoBorder
|
||||||
|
, bgColor = "black"
|
||||||
|
, fgColor = "white"
|
||||||
|
, alpha = 255
|
||||||
|
, position = Top
|
||||||
|
--, textOffset = -1
|
||||||
|
--, iconOffset = -1
|
||||||
|
, lowerOnStart = False
|
||||||
|
, pickBroadest = False
|
||||||
|
, persistent = False
|
||||||
|
, hideOnStart = False
|
||||||
|
, iconRoot = "."
|
||||||
|
, allDesktops = True
|
||||||
|
, overrideRedirect = True
|
||||||
|
, commands = [ Run DynNetwork ["-L","0","-H","32","--normal","green","--high","red"] 10
|
||||||
|
, Run Cpu ["-L","3","-H","50","--normal","green","--high","red"] 10
|
||||||
|
, Run Memory ["-t","Mem: <usedratio>%"] 10
|
||||||
|
, Run Battery ["-t", "Batt: <left>%, <watts>W -> <timeleft>"] 10
|
||||||
|
, Run Date "%F %H:%M:%S" "date" 10
|
||||||
|
--, Run Date "%a %b %_d %Y %H:%M:%S" "date" 10
|
||||||
|
, Run StdinReader
|
||||||
|
, Run Brightness [] 10
|
||||||
|
, Run Volume "default" "Master" [] 10
|
||||||
|
]
|
||||||
|
, sepChar = "%"
|
||||||
|
, alignSep = "}{"
|
||||||
|
, template = " %StdinReader% }\
|
||||||
|
\{ %cpu% | %memory% | %dynnetwork% | %battery% | %bright% | %default:Master% | <fc=#ee9a00>%date%</fc>"
|
||||||
|
}
|
||||||
|
|
||||||
47
desktop/activation-manuelle/xmonad/xmonad.hs
Normal file
47
desktop/activation-manuelle/xmonad/xmonad.hs
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
import Graphics.X11.ExtraTypes.XF86
|
||||||
|
import XMonad
|
||||||
|
import XMonad.Config.Desktop
|
||||||
|
import XMonad.Config.Azerty
|
||||||
|
import XMonad.Hooks.DynamicLog
|
||||||
|
import XMonad.Util.EZConfig
|
||||||
|
|
||||||
|
-- # Ligne principale
|
||||||
|
|
||||||
|
main = xmonad =<< xmobar myConfig
|
||||||
|
--main = xmonad =<< statusBar myBar myPP toggleStrutsKey myConfig
|
||||||
|
|
||||||
|
-- # Réglages de xmonad
|
||||||
|
|
||||||
|
myConfig = azertyConfig
|
||||||
|
{ terminal = "sakura"
|
||||||
|
, modMask = mod4Mask
|
||||||
|
, borderWidth = 2
|
||||||
|
, workspaces = myWorkspaces
|
||||||
|
} `additionalKeys` myKeys `removeKeys` unusefulKeys
|
||||||
|
|
||||||
|
myWorkspaces = ["1:mail","2:chat","3:web","4","5","6","7","8", "9:system"]
|
||||||
|
|
||||||
|
myKeys = [ ((0, xF86XK_MonBrightnessUp), spawn "xbacklight +10") -- +brightness
|
||||||
|
, ((0, xF86XK_MonBrightnessDown), spawn "xbacklight -10") -- -brightness
|
||||||
|
, ((0, xF86XK_AudioRaiseVolume), spawn "amixer set Master 3%+") -- +volume
|
||||||
|
, ((0, xF86XK_AudioLowerVolume), spawn "amixer set Master 3%-") -- -volume
|
||||||
|
, ((0, xF86XK_AudioMute), spawn "amixer set Master toggle") -- mute volume
|
||||||
|
, ((0, xF86XK_AudioPlay), spawn "cmus-remote -u") -- cmus play/stop
|
||||||
|
, ((0, xF86XK_AudioPrev), spawn "cmus-remote -r") -- cmus next
|
||||||
|
, ((0, xF86XK_AudioNext), spawn "cmus-remote -n") -- cmus previous
|
||||||
|
]
|
||||||
|
|
||||||
|
unusefulKeys = []
|
||||||
|
|
||||||
|
-- # Réglages de xmobar
|
||||||
|
|
||||||
|
myBar = "xmobar"
|
||||||
|
|
||||||
|
-- Custom PP, configure it as you like. It determines what is being written to the bar.
|
||||||
|
myPP = xmobarPP
|
||||||
|
{ ppCurrent = xmobarColor "black" "yellow" . wrap " " " "
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Key binding to toggle the gap for the bar.
|
||||||
|
toggleStrutsKey XConfig {XMonad.modMask = modMask} = (modMask, xK_b)
|
||||||
|
|
||||||
24
desktop/activation-manuelle/xmonad/xmonad.nix
Normal file
24
desktop/activation-manuelle/xmonad/xmonad.nix
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
|
||||||
|
in mkIf cfg.xmonad {
|
||||||
|
# Paquets spécifiques pour xmonad
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs;[
|
||||||
|
dmenu
|
||||||
|
haskellPackages.xmobar
|
||||||
|
];
|
||||||
|
|
||||||
|
services.xserver.windowManager.xmonad = {
|
||||||
|
enable = true;
|
||||||
|
enableContribAndExtras = true;
|
||||||
|
extraPackages = haskellPackages: [
|
||||||
|
haskellPackages.xmobar
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
57
desktop/desktop.nix
Normal file
57
desktop/desktop.nix
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
mkIf = pkgs.lib.mkIf;
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [ # applications :
|
||||||
|
# commandées par config-generator
|
||||||
|
./activation-manuelle/xmonad/xmonad.nix # gestionnaire de fenêtres xmonad
|
||||||
|
];
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; mkIf profiles.isDesktop [
|
||||||
|
# Environement de bureau
|
||||||
|
arandr # interface graphique pour xrandr
|
||||||
|
wmname # pour définir le nom du gestionnaire de fenêtre (utile pour java)
|
||||||
|
kde4.ksnapshot# capture d'écran
|
||||||
|
xorg.xbacklight # pour gérer la luminosité de l'écran
|
||||||
|
xorg.xev # pour repérer les codes + noms standard des actions clavier/souris
|
||||||
|
xorg.xkill # pour 'tuer une application'
|
||||||
|
|
||||||
|
## Gestionnaire de fenêtre & Thème
|
||||||
|
gnome.gnome_icon_theme # thème d'icone - semble fonctionner avec spaceFM
|
||||||
|
|
||||||
|
## Manipulation de fichier
|
||||||
|
pcmanfm # gestionnaire de fichiers graphique
|
||||||
|
spaceFM # gestionnaire de fichiers graphique
|
||||||
|
vifm # gestionnaire de fichiers basé sur VIM (console)
|
||||||
|
|
||||||
|
## Terminal
|
||||||
|
sakura # terminal
|
||||||
|
|
||||||
|
# A trier
|
||||||
|
cowsay
|
||||||
|
fgallery # générateur de gallerie statique http://www.thregr.org/~wavexx/software/fgallery/
|
||||||
|
samba
|
||||||
|
taskwarrior # gestionnaire de tâches en console
|
||||||
|
udevil # pour le montage des media amovibles
|
||||||
|
xclip # manipulation du clipboard X depuis la console
|
||||||
|
];
|
||||||
|
|
||||||
|
# Polices supplémentaires
|
||||||
|
fonts.fonts = with pkgs; mkIf profiles.isDesktop [
|
||||||
|
fira # police créée pour Firefox
|
||||||
|
fira-code # idem fira-mono + ligatures pour la programmation
|
||||||
|
fira-mono # dérivée de fira en monospace
|
||||||
|
hack-font # police monospace créée explicitement pour coder
|
||||||
|
];
|
||||||
|
|
||||||
|
nixpkgs.config.packageOverrides = pkgs: {
|
||||||
|
clawsMail = pkgs.clawsMail.override { enablePluginFancy = true; };
|
||||||
|
mumble = pkgs.mumble.override { pulseSupport = true; };
|
||||||
|
};
|
||||||
|
}
|
||||||
40
logiciel-custom/osm2pgsql.nix
Normal file
40
logiciel-custom/osm2pgsql.nix
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
{ stdenv, fetchurl
|
||||||
|
, boost
|
||||||
|
, bzip2
|
||||||
|
, cmake
|
||||||
|
, expat
|
||||||
|
, geos
|
||||||
|
, lua
|
||||||
|
, postgresql
|
||||||
|
, proj
|
||||||
|
, zlib
|
||||||
|
}
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
#version = "0.87.1";
|
||||||
|
version = "0.90.1";
|
||||||
|
name = "osm2pgsql-${version}-0";
|
||||||
|
|
||||||
|
src = fetchurl {
|
||||||
|
url = "https://github.com/openstreetmap/osm2pgsql/archive/${version}.tar.gz";
|
||||||
|
sha256 = "0i0zg8di8nbh96qnyyr156ikwcsq1w9b2291bazm5whb351flmqx";
|
||||||
|
};
|
||||||
|
|
||||||
|
#nativeBuildInputs = [ ];
|
||||||
|
buildInputs = [ ];
|
||||||
|
|
||||||
|
#preConfigure = ''
|
||||||
|
'';
|
||||||
|
#buildPhase = ''jam "-j$NIX_BUILD_CORES" '';
|
||||||
|
#installPhase = ''
|
||||||
|
#'';
|
||||||
|
|
||||||
|
meta = with stdenv.lib; {
|
||||||
|
homepage = http://wiki.openstreetmap.org/wiki/Osm2pgsql;
|
||||||
|
description = "osm2pgsql is a tool for loading OpenStreetMap data into a PostgreSQL / PostGIS database suitable for applications like rendering into a map, geocoding with Nominatim, or general analysis.";
|
||||||
|
license = licenses.gpl2;
|
||||||
|
#maintainers = [ maintainers.phunehehe ];
|
||||||
|
maintainers = [ maintainers.jpierre03 ];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
43
public/app-adminsys.nix
Normal file
43
public/app-adminsys.nix
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf profiles.isDesktop {
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
# Adminsys
|
||||||
|
iotop
|
||||||
|
lm_sensors
|
||||||
|
lshw
|
||||||
|
lsof
|
||||||
|
ntp
|
||||||
|
powerline-fonts
|
||||||
|
powertop
|
||||||
|
python27Packages.ansible2
|
||||||
|
python27Packages.glances
|
||||||
|
usbutils
|
||||||
|
|
||||||
|
# DNS
|
||||||
|
unbound
|
||||||
|
|
||||||
|
# Compression
|
||||||
|
lz4
|
||||||
|
lzop
|
||||||
|
|
||||||
|
# Système de fichier
|
||||||
|
curlftpfs
|
||||||
|
gparted
|
||||||
|
inotify-tools
|
||||||
|
nfs-utils
|
||||||
|
ntfs3g
|
||||||
|
sshfsFuse
|
||||||
|
|
||||||
|
#
|
||||||
|
unetbootin # création de clefs USB bootables
|
||||||
|
];
|
||||||
|
}
|
||||||
22
public/app-awesome.nix
Normal file
22
public/app-awesome.nix
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf cfg.awesome {
|
||||||
|
|
||||||
|
environment.variables = {
|
||||||
|
# Export the current path for the awesome derivation, useful for users rc.lua
|
||||||
|
# Example usage in rc.lua :
|
||||||
|
#
|
||||||
|
# config = {}
|
||||||
|
# config.dir = os.getenv("AWESOME_CONFIG_DIR")
|
||||||
|
# beautiful.init(config.dir .. "/share/awesome//themes/zenburn/theme.lua")
|
||||||
|
#
|
||||||
|
AWESOME_CONFIG_DIR = "${pkgs.awesome}";
|
||||||
|
};
|
||||||
|
}
|
||||||
43
public/app-bureautique.nix
Normal file
43
public/app-bureautique.nix
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf profiles.isDesktop {
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
# Bureautique
|
||||||
|
aspell aspellDicts.fr
|
||||||
|
dia
|
||||||
|
gnumeric
|
||||||
|
|
||||||
|
## Cartes mentales
|
||||||
|
freemind
|
||||||
|
|
||||||
|
## Editeur de texte
|
||||||
|
lyx # surcouche WISIWIM à LaTeX
|
||||||
|
textadept # un éditeur de texte facile pour copier-coller graphique
|
||||||
|
zim # outil de prise de notes, wiki de bureau
|
||||||
|
|
||||||
|
## Visionneuse
|
||||||
|
kde5.okular # pdf
|
||||||
|
mcomix # livres (cbr, liste d'images), gestion d'une bibliothèque
|
||||||
|
pdfpc # pdf
|
||||||
|
qpdfview # pdf
|
||||||
|
gqview # visionneuse image & gestion basique de collection
|
||||||
|
|
||||||
|
## Convertisseurs (texte -> <autre format>)
|
||||||
|
gnuplot # générateur de graphes à partir de données numériques
|
||||||
|
graphviz # dot, neato : traçage de graphes (carré, rond)
|
||||||
|
jekyll # générateur statique de site web
|
||||||
|
pandoc
|
||||||
|
texLiveFull # distribution LaTeX
|
||||||
|
#texLive # distribution LaTeX de base
|
||||||
|
#texLiveBeamer # paquets et extensions pour Beamer
|
||||||
|
#texLiveModerncv # paquets pour la classe Modern CV
|
||||||
|
];
|
||||||
|
}
|
||||||
23
public/app-cao.nix
Normal file
23
public/app-cao.nix
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf cfg.conception-assistee {
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
# CAO
|
||||||
|
## Modélisation 3D
|
||||||
|
freecad # modélisation de pièces en 3D
|
||||||
|
povray # Rendu tracé de rayon, utilisé dans freecad
|
||||||
|
|
||||||
|
## Électricité & Électronique
|
||||||
|
fritzing # schéma de câblages "jolis"
|
||||||
|
kicad # ensemble d'outils de conception électronique
|
||||||
|
qucs # simulateur de circuits électroniques
|
||||||
|
];
|
||||||
|
}
|
||||||
20
public/app-cartographie.nix
Normal file
20
public/app-cartographie.nix
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf cfg.cartographie {
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
# Gestion de données géographiques
|
||||||
|
expat
|
||||||
|
gpsbabel # pour convettir les données des GPS
|
||||||
|
josm # outil de contribution à OpenStreetMap
|
||||||
|
qgis # client lourd de manipulation de données géographiques
|
||||||
|
viking # analyse de topo, gestion de données GPS
|
||||||
|
];
|
||||||
|
}
|
||||||
36
public/app-client-internet.nix
Normal file
36
public/app-client-internet.nix
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf profiles.isDesktop {
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
# Clients Internet
|
||||||
|
|
||||||
|
## Navigateur
|
||||||
|
chromium
|
||||||
|
firefox
|
||||||
|
|
||||||
|
## Réseaux sociaux
|
||||||
|
python27Packages.turses # client twitter en ncurse
|
||||||
|
python27Packages.rainbowstream # client twitter en console
|
||||||
|
|
||||||
|
## Mail & Discussion (texte, audio)
|
||||||
|
clawsMail
|
||||||
|
kde5.quasselClient
|
||||||
|
mumble
|
||||||
|
mutt
|
||||||
|
pidgin
|
||||||
|
thunderbird
|
||||||
|
|
||||||
|
# Transfert de fichier
|
||||||
|
filezilla
|
||||||
|
transmission_gtk
|
||||||
|
transmission_remote_gtk
|
||||||
|
];
|
||||||
|
}
|
||||||
44
public/app-developpement.nix
Normal file
44
public/app-developpement.nix
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf cfg.developpement {
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
# Base de données
|
||||||
|
pgadmin
|
||||||
|
sqlitebrowser
|
||||||
|
|
||||||
|
# Développement
|
||||||
|
cloc
|
||||||
|
idea.idea-community
|
||||||
|
gcc # pour les appels depuis les scripts
|
||||||
|
|
||||||
|
# Documentation
|
||||||
|
zeal
|
||||||
|
|
||||||
|
## Gestion des sources
|
||||||
|
# git # déjà présent dans "base"
|
||||||
|
git-cola
|
||||||
|
mercurial
|
||||||
|
subversion
|
||||||
|
|
||||||
|
## Haskell
|
||||||
|
ghc
|
||||||
|
stack
|
||||||
|
|
||||||
|
## Rust
|
||||||
|
cargo # récupération des dépendances + compilation projet rust
|
||||||
|
rustPlatform.rustc
|
||||||
|
|
||||||
|
## Visualisation & outils de diff
|
||||||
|
gource
|
||||||
|
meld
|
||||||
|
vbindiff # diff de fichier hexadecimaux avec vim
|
||||||
|
];
|
||||||
|
}
|
||||||
19
public/app-docker.nix
Normal file
19
public/app-docker.nix
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf cfg.docker {
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
# Ecosystème Docker
|
||||||
|
docker
|
||||||
|
python27Packages.docker_compose
|
||||||
|
];
|
||||||
|
|
||||||
|
virtualisation.docker.enable = true;
|
||||||
|
}
|
||||||
18
public/app-edition-musique.nix
Normal file
18
public/app-edition-musique.nix
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf cfg.edition-musique {
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
#
|
||||||
|
audacity # montage audio
|
||||||
|
easytag # gestion des métadonnées des fichiers musicaux
|
||||||
|
picard # gestion des métadonnées des fichiers musicaux
|
||||||
|
];
|
||||||
|
}
|
||||||
26
public/app-edition-photo.nix
Normal file
26
public/app-edition-photo.nix
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf cfg.edition-photo {
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
# Méta données
|
||||||
|
exif
|
||||||
|
exiftags
|
||||||
|
|
||||||
|
# Retouche, modification & dessin vectoriel
|
||||||
|
gimp # logiciel d'édition/montage/retouche photo
|
||||||
|
inkscape # édition d'image vectorielle (svg & autre)
|
||||||
|
imagemagick # modification image en CLI
|
||||||
|
rawtherapee # développemen de photos en RAW
|
||||||
|
|
||||||
|
# TEST d'outil de gestion de catalogue de photos
|
||||||
|
kde4.digikam # gestionnaire de bibliothèque de photo
|
||||||
|
];
|
||||||
|
}
|
||||||
17
public/app-edition-video.nix
Normal file
17
public/app-edition-video.nix
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf cfg.edition-video {
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
# Vidéo
|
||||||
|
#cinelerra # editeur video
|
||||||
|
pitivi # montage vidéo
|
||||||
|
];
|
||||||
|
}
|
||||||
16
public/app-jeux.nix
Normal file
16
public/app-jeux.nix
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf cfg.jeux {
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
# Jeux
|
||||||
|
urbanterror
|
||||||
|
];
|
||||||
|
}
|
||||||
29
public/app-multimedia.nix
Normal file
29
public/app-multimedia.nix
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf profiles.isDesktop {
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
# Multimedia
|
||||||
|
|
||||||
|
## Audio
|
||||||
|
beep
|
||||||
|
cmus # lecteur audio console
|
||||||
|
espeak # synthèse vocale
|
||||||
|
paprefs # préferences pulseaudio
|
||||||
|
pavucontrol # mixer pulseaudio
|
||||||
|
vorbis-tools # codec
|
||||||
|
|
||||||
|
## Video
|
||||||
|
smplayer # lecteur vidéo
|
||||||
|
vlc # lecteur vidéo
|
||||||
|
|
||||||
|
kde4.ksnapshot# réalisation de capture d'écran
|
||||||
|
];
|
||||||
|
}
|
||||||
29
public/app-network.nix
Normal file
29
public/app-network.nix
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf profiles.isDesktop {
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
# Outils réseau
|
||||||
|
iperf # outil de mesure de la qualité du réseau
|
||||||
|
iptraf-ng # outil de mesure de la qualité du réseau
|
||||||
|
nload # affichage de statisques d'utilisation instantannées du réseau
|
||||||
|
telnet
|
||||||
|
|
||||||
|
## Diagnostic
|
||||||
|
arp-scan
|
||||||
|
wireshark
|
||||||
|
whois
|
||||||
|
];
|
||||||
|
|
||||||
|
networking.firewall = {
|
||||||
|
allowedTCPPorts = [5201]; # iperf
|
||||||
|
allowedUDPPorts = [5201]; # iperf
|
||||||
|
};
|
||||||
|
}
|
||||||
20
public/app-securite.nix
Normal file
20
public/app-securite.nix
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf profiles.isDesktop {
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
# Securité
|
||||||
|
gnome3.seahorse # gestionnaire graphique de clef GPG
|
||||||
|
pass # gestionnaire de mots de passe
|
||||||
|
pwgen # générateur de mots de passe
|
||||||
|
slock # vérouiller l''écran. "cannot disable the out-of-memory killer for this process (make sure to suid or sgid slock)" --> en root
|
||||||
|
yubikey-personalization-gui # utilisation de la clef Yubikey
|
||||||
|
];
|
||||||
|
}
|
||||||
18
public/app-virtualbox.nix
Normal file
18
public/app-virtualbox.nix
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf cfg.virtualbox {
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
linuxPackages.virtualbox
|
||||||
|
linuxPackages.virtualboxGuestAdditions
|
||||||
|
];
|
||||||
|
|
||||||
|
virtualisation.virtualbox.host.enable = true;
|
||||||
|
}
|
||||||
15
public/auto-upgrade.nix
Normal file
15
public/auto-upgrade.nix
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf cfg.auto-upgrade {
|
||||||
|
# Automatic update & automatic clean
|
||||||
|
|
||||||
|
system.autoUpgrade.enable = true;
|
||||||
|
nix.gc.automatic = true;
|
||||||
|
}
|
||||||
@@ -17,19 +17,23 @@
|
|||||||
bind # utilisé pour les utilitaires comme dig
|
bind # utilisé pour les utilitaires comme dig
|
||||||
byobu # permet de se déconnecter d'un terminal sans l'aréter
|
byobu # permet de se déconnecter d'un terminal sans l'aréter
|
||||||
exfat # Pour monter les FAT avec Fuse
|
exfat # Pour monter les FAT avec Fuse
|
||||||
git gitAndTools.gitSVN gitAndTools.tig # outil de gestion de version
|
git gitAndTools.gitSVN gitAndTools.tig gti # outil de gestion de version
|
||||||
gnumake # pour décrire les recettes de compilation
|
gnumake # pour décrire les recettes de compilation
|
||||||
gnupg # GPG
|
gnupg # GPG
|
||||||
gpm # prise en charge de la souris en console
|
gpm # prise en charge de la souris en console
|
||||||
htop # monitoring
|
htop # monitoring
|
||||||
|
#libressl # librairie pour faire du TLS et les algorithmes de crypto par OpenBSD
|
||||||
ncdu # outil pour voir l'espace utilisé
|
ncdu # outil pour voir l'espace utilisé
|
||||||
nmap # outil de scan de port réseau
|
nmap # outil de scan de port réseau
|
||||||
mtr # outil de diagnostic réseau
|
mtr # outil de diagnostic réseau
|
||||||
|
par2cmdline # outil de récupération de fichiers corrompus - .par2
|
||||||
p7zip # compression de fichier
|
p7zip # compression de fichier
|
||||||
parted # partitionnement de disque
|
parted # partitionnement de disque
|
||||||
pciutils
|
pciutils
|
||||||
|
python # python -- python -m SimpleHTTPServer 8000
|
||||||
python34Packages.glances # monitoring
|
python34Packages.glances # monitoring
|
||||||
pwgen # générateur de mot de passe
|
pwgen # générateur de mot de passe
|
||||||
|
rtorrent # outil de téléchargement de torrent & magnet
|
||||||
tmux # nécessaire pour byobu
|
tmux # nécessaire pour byobu
|
||||||
tree # affiche une arborescence de fichiers et dossiers
|
tree # affiche une arborescence de fichiers et dossiers
|
||||||
usbutils
|
usbutils
|
||||||
@@ -53,4 +57,16 @@
|
|||||||
promptInit = builtins.readFile ./bash-prompt.sh;
|
promptInit = builtins.readFile ./bash-prompt.sh;
|
||||||
interactiveShellInit = builtins.readFile ./bash-interactive-init.sh;
|
interactiveShellInit = builtins.readFile ./bash-interactive-init.sh;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# https://wiki.mozilla.org/Security/Guidelines/OpenSSH#Modern
|
||||||
|
programs.ssh.extraConfig = ''
|
||||||
|
# Ensure KnownHosts are unreadable if leaked - it is otherwise easier to know which hosts your keys have access to.
|
||||||
|
HashKnownHosts yes
|
||||||
|
# Host keys the client accepts - order here is honored by OpenSSH
|
||||||
|
HostKeyAlgorithms ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,ssh-rsa,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256
|
||||||
|
|
||||||
|
KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp256,ecdh-sha2-nistp384,diffie-hellman-group-exchange-sha256
|
||||||
|
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com
|
||||||
|
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
25
public/laptop.nix
Normal file
25
public/laptop.nix
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf cfg.laptop {
|
||||||
|
|
||||||
|
# Gestion spécifique pour PC portable
|
||||||
|
|
||||||
|
## Gestion de l'énergie
|
||||||
|
powerManagement.cpuFreqGovernor = "powersave";
|
||||||
|
|
||||||
|
## Activation d'un gestionnaire de réseau
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
|
hardware.bluetooth.enable = true;
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
networkmanagerapplet
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -1,17 +1,6 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
# Définition des domaines utilisés lorsque un identifiant non-FQDN est donné (ping, nslookup)
|
|
||||||
networking = {
|
|
||||||
search = [
|
|
||||||
"dubronetwork.fr"
|
|
||||||
"prunetwork.fr"
|
|
||||||
"teleragno.fr"
|
|
||||||
"teleragno.net"
|
|
||||||
];
|
|
||||||
dnsExtensionMechanism = 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/
|
||||||
25
public/print.nix
Normal file
25
public/print.nix
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf cfg.print {
|
||||||
|
# Enable CUPS to print documents.
|
||||||
|
services.printing = {
|
||||||
|
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
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
42
public/public.nix
Normal file
42
public/public.nix
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
# installées systématiquement
|
||||||
|
./environment.nix
|
||||||
|
./localisation.nix
|
||||||
|
./network-ipv6.nix
|
||||||
|
./service-haveged.nix
|
||||||
|
./service-monitoring.nix
|
||||||
|
./service-ssh.nix
|
||||||
|
|
||||||
|
# commandées par config-generator
|
||||||
|
## option de configuration spécifique
|
||||||
|
./app-awesome.nix # pour les profils awesome
|
||||||
|
./app-cao.nix # de conception assisté par ordinateur & modélisation
|
||||||
|
./app-cartographie.nix # utilisée pour manipuler les données géographiques & cartes
|
||||||
|
./app-developpement.nix # utilisée pour développer des programmes/scripts
|
||||||
|
./app-docker.nix # pour activer docker
|
||||||
|
./app-edition-musique.nix # pour modifier les fichiers musicaux
|
||||||
|
./app-edition-photo.nix # pour modifier les photos & assimilé
|
||||||
|
./app-edition-video.nix # pour modifier les vidéos
|
||||||
|
./app-jeux.nix # permettant de jouer ;)
|
||||||
|
./app-virtualbox.nix # pour exploiter virtualbox
|
||||||
|
./auto-upgrade.nix # mise à jour automatique du système
|
||||||
|
./laptop.nix # appli & configuration adaptée pour un PC portable
|
||||||
|
./print.nix # configuration de base de cups
|
||||||
|
./service-laptop.nix # services spécifiques aux pc portables
|
||||||
|
./service-locate.nix # service locate
|
||||||
|
./swap.nix # définition de l'utilisation du swap
|
||||||
|
|
||||||
|
## if isDesktop
|
||||||
|
./app-adminsys.nix # pour gérer le système dans son ensemble et les services
|
||||||
|
./app-bureautique.nix # dédiée à la bureautique (traitement de texte, dessin, ...)
|
||||||
|
./app-client-internet.nix # pour accéder & utiliser des ressources par le réseau
|
||||||
|
./app-multimedia.nix # pour gérer le son, l'image et la vidéo
|
||||||
|
./app-network.nix # de gestion, de diagnostique & surveillance réseau
|
||||||
|
./app-securite.nix # relatives à la sécurité (chiffrement, gpg, mots de passe, ...)
|
||||||
|
./service-pulseaudio.nix # activation du serveur audio
|
||||||
|
./service-x11.nix # activation du serveur graphique X
|
||||||
|
];
|
||||||
|
}
|
||||||
12
public/service-haveged.nix
Normal file
12
public/service-haveged.nix
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Sécurité & Acces distant
|
||||||
|
|
||||||
|
## Augmentation de l'entropie du système par un générateur de nombres aléatoires
|
||||||
|
## cat /proc/sys/kernel/random/entropy_avail
|
||||||
|
services.haveged = {
|
||||||
|
enable = true;
|
||||||
|
refill_threshold = 2048;
|
||||||
|
};
|
||||||
|
}
|
||||||
18
public/service-laptop.nix
Normal file
18
public/service-laptop.nix
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf cfg.laptop {
|
||||||
|
|
||||||
|
# Gestion spécifique pour PC portable
|
||||||
|
|
||||||
|
services.xserver.synaptics = {
|
||||||
|
enable = true;
|
||||||
|
twoFingerScroll = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
16
public/service-locate.nix
Normal file
16
public/service-locate.nix
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf cfg.locate {
|
||||||
|
|
||||||
|
services.locate = {
|
||||||
|
enable = true;
|
||||||
|
interval = "hourly";
|
||||||
|
};
|
||||||
|
}
|
||||||
31
public/service-monitoring.nix
Normal file
31
public/service-monitoring.nix
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Monitoring
|
||||||
|
|
||||||
|
# Noeud de supervision munin = pas de stockage des données locales
|
||||||
|
services.munin-node = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Munin server -- generate /var/www/munin
|
||||||
|
services.munin-cron = {
|
||||||
|
enable = true;
|
||||||
|
hosts = ''
|
||||||
|
[${config.networking.hostName}]
|
||||||
|
address localhost
|
||||||
|
'';
|
||||||
|
extraGlobalConfig = ''
|
||||||
|
contact.email.command mail -s "Munin notification for ''${var:host}" root@${config.networking.hostName}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.firewall.allowedTCPPorts = [
|
||||||
|
# TODO configurer les bon ports lors de l'ouverture du service
|
||||||
|
8000
|
||||||
|
];
|
||||||
|
|
||||||
|
## Documentation
|
||||||
|
# * https://nixos.org/wiki/Create_and_debug_nix_packages
|
||||||
|
# * http://chriswarbo.net/essays/nixos/developing_on_nixos.html
|
||||||
|
}
|
||||||
17
public/service-pulseaudio.nix
Normal file
17
public/service-pulseaudio.nix
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
mkIf = pkgs.lib.mkIf;
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
# Pulse Audio
|
||||||
|
hardware.pulseaudio = mkIf profiles.isDesktop {
|
||||||
|
enable = true;
|
||||||
|
support32Bit = true;
|
||||||
|
};
|
||||||
|
environment.etc."pulse/daemon.conf".text = "flat-volumes = no";
|
||||||
|
}
|
||||||
21
public/service-ssh.nix
Normal file
21
public/service-ssh.nix
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# OpenSSH daemon
|
||||||
|
services.openssh = {
|
||||||
|
enable = true;
|
||||||
|
# https://wiki.mozilla.org/Security/Guidelines/OpenSSH#Modern_.28OpenSSH_6.7.2B.29
|
||||||
|
extraConfig = ''
|
||||||
|
KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256
|
||||||
|
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
|
||||||
|
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com
|
||||||
|
|
||||||
|
# LogLevel VERBOSE logs user's key fingerprint on login. Needed to have a clear audit track of which key was using to log in.
|
||||||
|
LogLevel VERBOSE
|
||||||
|
|
||||||
|
# Use kernel sandbox mechanisms where possible in unprivilegied processes
|
||||||
|
# Systrace on OpenBSD, Seccomp on Linux, seatbelt on MacOSX/Darwin, rlimit elsewhere.
|
||||||
|
UsePrivilegeSeparation sandbox
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
45
public/service-x11.nix
Normal file
45
public/service-x11.nix
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
mkIf = pkgs.lib.mkIf;
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
# Enable the X11 windowing system.
|
||||||
|
services.xserver = mkIf profiles.isDesktop {
|
||||||
|
enable = true;
|
||||||
|
layout = "fr";
|
||||||
|
xkbOptions = "eurosign:e";
|
||||||
|
displayManager.lightdm.enable = true;
|
||||||
|
windowManager.awesome.enable = true;
|
||||||
|
startGnuPGAgent = true;
|
||||||
|
startOpenSSHAgent = false; # pas compatible avec l'agent GnuPG
|
||||||
|
inputClassSections = [''
|
||||||
|
Identifier "Marble Mouse"
|
||||||
|
MatchProduct "Logitech USB Trackball"
|
||||||
|
MatchIsPointer "on"
|
||||||
|
MatchDevicePath "/dev/input/event*"
|
||||||
|
Driver "evdev"
|
||||||
|
# Physical button #s: A b D - - - - B C b = A & D simultaneously; - = no button
|
||||||
|
#Option "ButtonMapping" "1 8 3 4 5 6 7 2 2" # For right-hand placement
|
||||||
|
#Option "ButtonMapping" "3 8 1 4 5 6 7 2 2" # For left-hand placement
|
||||||
|
|
||||||
|
# EmulateWheel refers to emulating a mouse wheel using Marble Mouse trackball.
|
||||||
|
Option "EmulateWheel" "true"
|
||||||
|
Option "EmulateWheelButton" "8" # Factory default; use "9" for left-side placement.
|
||||||
|
|
||||||
|
# EmulateWheelInertia specifies how far (in pixels) the pointer must move to
|
||||||
|
# generate button press/release events in wheel emulation mode.
|
||||||
|
Option "EmulateWheelInertia" "10" # Factory default: 50
|
||||||
|
|
||||||
|
Option "ZAxisMapping" "4 5"
|
||||||
|
Option "XAxisMapping" "6 7" # Disable this for vertical-only scrolling.
|
||||||
|
# Emulate3Buttons refers to the act of pressing buttons A and D
|
||||||
|
# simultaneously to emulate a middle-click or wheel click.
|
||||||
|
Option "Emulate3Buttons" "true" # Factory default.
|
||||||
|
''];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,10 +1,17 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
{
|
let
|
||||||
|
inherit (lib) mkIf;
|
||||||
|
cfg = config.r6d.config-generator;
|
||||||
|
computers = config.r6d.computers;
|
||||||
|
profiles = config.r6d.profiles;
|
||||||
|
in
|
||||||
|
|
||||||
|
mkIf cfg.swap {
|
||||||
# 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 = {
|
||||||
# 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;
|
||||||
33
services.nix
33
services.nix
@@ -1,33 +0,0 @@
|
|||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
# Sécurité & Acces distant
|
|
||||||
|
|
||||||
## Augmentation de l'entropie du système par un générateur de nombres aléatoires
|
|
||||||
## cat /proc/sys/kernel/random/entropy_avail
|
|
||||||
services.haveged = {
|
|
||||||
enable = true;
|
|
||||||
refill_threshold = 2048;
|
|
||||||
};
|
|
||||||
|
|
||||||
## OpenSSH daemon
|
|
||||||
services.openssh = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Enable CUPS to print documents.
|
|
||||||
services.printing = {
|
|
||||||
enable = true;
|
|
||||||
drivers = [
|
|
||||||
pkgs.samsung-unified-linux-driver
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# Monitoring
|
|
||||||
|
|
||||||
## Noeud de supervision munin = pas de stockage des données locales
|
|
||||||
|
|
||||||
services.munin-node = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user