Compare commits
160 Commits
2016-07-29
...
2016-11-02
| Author | SHA1 | Date | |
|---|---|---|---|
| 374b2732ad | |||
| 6ce50aea40 | |||
| 012cc8626c | |||
| bdbf858a11 | |||
| a4b166f1f8 | |||
| bb5ee98bc3 | |||
| dd9f52b997 | |||
| bb617fbf13 | |||
| 021b1d5c26 | |||
|
|
31f57965f9 | ||
|
|
0a3d820dd6 | ||
|
|
f0f266cb55 | ||
|
|
1916d6eb90 | ||
| fa32aed569 | |||
| 9201266575 | |||
| 756a18b2e8 | |||
| 3b04c2edb0 | |||
| 2982725e0b | |||
| 9e8d3b24b3 | |||
| dba3a46ebd | |||
| 7d28694819 | |||
| ed5420e1b0 | |||
| d6bfe1c706 | |||
| 7dada8a3e6 | |||
| bd0076b9d1 | |||
| 6800de18af | |||
| 5d831cf7be | |||
| 2ffdaf0a53 | |||
| 7dbfccf2f4 | |||
| e2e15cad39 | |||
| 2d770067b7 | |||
| 46e61f0fed | |||
|
|
99d5886aff | ||
|
|
21d7c97c76 | ||
|
|
3a8a728268 | ||
| a5aae179a2 | |||
| 95e8687609 | |||
| 8e35b38d19 | |||
| 51dd0b65f4 | |||
| 04038a7b16 | |||
| 4fbf145c78 | |||
| 821d46befe | |||
| 807b1bc2e6 | |||
| 4b5eacda0f | |||
| 18f960b879 | |||
| a8e28e594a | |||
| 758e8ba84a | |||
| 1d3f46c2ec | |||
| 3ccc8678ce | |||
|
|
215005d927 | ||
|
|
9fb124116d | ||
|
|
d65ee1bd2c | ||
|
|
dce7b12a33 | ||
| 826595cb6c | |||
| b633d3c794 | |||
| 5444be4fd2 | |||
| 9b4a4f1b67 | |||
| b622554b42 | |||
| 332f40265d | |||
|
|
781973228f | ||
|
|
65e1c6ff0e | ||
| b42c8e3080 | |||
| adaa4eeb61 | |||
| 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 | |||
|
|
c5b9c97327 | ||
|
|
6b0689d336 | ||
| 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 |
73
Makefile
Normal file
73
Makefile
Normal file
@@ -0,0 +1,73 @@
|
||||
all: rebuild-switch
|
||||
date
|
||||
##--------- Commandes spécifiques pour NixOS
|
||||
|
||||
clean:
|
||||
nix-collect-garbage -d --delete-older-than 15d
|
||||
|
||||
clean-aggressive:
|
||||
nix-collect-garbage -d --delete-older-than 1d
|
||||
|
||||
clean-total:
|
||||
nix-collect-garbage -d
|
||||
|
||||
clean-log:
|
||||
journalctl --vacuum-size=1G
|
||||
|
||||
full-auto: submodules-update upgrade clean optimise
|
||||
@date
|
||||
|
||||
optimise:
|
||||
nix-store --optimise
|
||||
|
||||
rebuild-switch:
|
||||
nixos-rebuild switch --fallback --show-trace
|
||||
|
||||
store-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:
|
||||
#git submodule update --remote
|
||||
git submodule foreach git co master
|
||||
git submodule foreach git ff
|
||||
|
||||
submodules-push:
|
||||
git submodule foreach git push --all
|
||||
git submodule foreach git push --tags
|
||||
|
||||
submodules-tag:
|
||||
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
|
||||
git tag -f "$$(date +%F)-$$(hostname -s)"
|
||||
|
||||
##--------- Munin
|
||||
|
||||
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
|
||||
|
||||
5
README
5
README
@@ -1,5 +0,0 @@
|
||||
|
||||
# Lien pour install sur machine distante
|
||||
|
||||
* https://nixos.org/wiki/How_to_install_NixOS_from_Linux#Installing_through_a_chroot
|
||||
* https://github.com/NixOS/nixpkgs/issues/13305
|
||||
43
README.md
Normal file
43
README.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# nixos-template-base
|
||||
|
||||
Version de nixos supportée : NixOs 16.09
|
||||
|
||||
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
|
||||
|
||||
* https://nixos.org/wiki/How_to_install_NixOS_from_Linux#Installing_through_a_chroot
|
||||
* https://github.com/NixOS/nixpkgs/issues/13305
|
||||
|
||||
# Notes pour l'upgrade de 16.03 vers 16.09
|
||||
|
||||
* mettre le dépôt base sur la branche upgrade-16.09
|
||||
* changer le channel nixos : ```nix-channel --add https://nixos.org/channels/nixos-16.09 nixos```
|
||||
* activer x11 dans le configuration.nix
|
||||
|
||||
~~~
|
||||
services.xserver.enable = true;
|
||||
~~~
|
||||
|
||||
* remplacer le bootloader si gummiboot était utilisé
|
||||
|
||||
~~~
|
||||
boot.loader.gummiboot.enable = true;
|
||||
~~~
|
||||
|
||||
devient
|
||||
|
||||
~~~
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
~~~
|
||||
|
||||
Pour résoudre les soucis d'upgrade, il est conseillé :
|
||||
* de désactiver tous les imports (sauf `hardware.nix`)
|
||||
* d'ajouter `.../localisation.nix` dans les imports sous peine d'être en clavier US
|
||||
* d'ajouter ```nixpkgs.config.allowUnfree = true;```
|
||||
* d'ajouter `vim` aux paquets
|
||||
* de réactiver petit à petit les lignes désactivées
|
||||
|
||||
14
base.nix
14
base.nix
@@ -1,8 +1,20 @@
|
||||
{ ... }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
#inherit (lib) mkIf mkMerge mkThenElse;
|
||||
cfg = config.r6d.config-generator;
|
||||
computers = config.r6d.computers;
|
||||
profiles = config.r6d.profiles;
|
||||
in
|
||||
|
||||
{
|
||||
imports = [
|
||||
# recettes
|
||||
./base/base.nix
|
||||
./desktop/desktop.nix
|
||||
./public/public.nix
|
||||
|
||||
# moulinette de configuration
|
||||
./config-generator.nix
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
all: rebuild-switch
|
||||
date
|
||||
|
||||
clean:
|
||||
nix-collect-garbage -d --delete-older-than 15d
|
||||
|
||||
clean-aggressive:
|
||||
nix-collect-garbage -d --delete-older-than 1d
|
||||
|
||||
clean-total:
|
||||
nix-collect-garbage -d
|
||||
|
||||
clean-log:
|
||||
journalctl --vacuum-size=1G
|
||||
|
||||
full-auto: submodules-update upgrade clean optimise
|
||||
|
||||
optimise:
|
||||
nix-store --optimise
|
||||
|
||||
push: submodules-push
|
||||
git push --all
|
||||
git push --tags
|
||||
|
||||
rebuild-switch:
|
||||
nixos-rebuild switch --fallback --show-trace
|
||||
|
||||
store-repair:
|
||||
nix-store --verify --check-contents --repair
|
||||
|
||||
submodules-update:
|
||||
#git submodule update --remote
|
||||
git submodule foreach git co master
|
||||
git submodule foreach git ff
|
||||
|
||||
submodules-push:
|
||||
git submodule foreach git push --all
|
||||
git submodule foreach git push --tags
|
||||
|
||||
submodules-tag:
|
||||
git submodule foreach git tag -f "$$(date +%F)-$$(hostname -s)"
|
||||
|
||||
tag: submodules-tag
|
||||
git tag -f "$$(date +%F)-$$(hostname -s)"
|
||||
|
||||
upgrade:
|
||||
nixos-rebuild switch --upgrade --fallback --show-trace
|
||||
|
||||
1
base/Makefile
Symbolic link
1
base/Makefile
Symbolic link
@@ -0,0 +1 @@
|
||||
/etc/nixos/base/Makefile
|
||||
@@ -1,12 +0,0 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
with pkgs.lib;
|
||||
|
||||
let
|
||||
cfg = config.r6d.config-generator;
|
||||
in {
|
||||
# Automatic update & automatic clean
|
||||
|
||||
system.autoUpgrade.enable = cfg.auto-upgrade;
|
||||
nix.gc.automatic = cfg.auto-upgrade;
|
||||
}
|
||||
@@ -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,10 +0,0 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
with pkgs.lib;
|
||||
|
||||
let
|
||||
cfg = config.r6d.config-generator;
|
||||
in {
|
||||
# Gestion spécifique pour PC portable
|
||||
powerManagement.cpuFreqGovernor = mkIf cfg.laptop "powersave";
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
with pkgs.lib;
|
||||
|
||||
let
|
||||
cfg = config.r6d.config-generator;
|
||||
in {
|
||||
imports = [
|
||||
];
|
||||
|
||||
services.locate = {
|
||||
enable = cfg.locate;
|
||||
interval = "hourly";
|
||||
};
|
||||
}
|
||||
@@ -1,24 +1,25 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkMerge;
|
||||
profiles = config.r6d.profiles;
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
cfg = config.r6d.config-generator;
|
||||
computers = config.r6d.computers;
|
||||
in {
|
||||
nix = mkIf config.r6d.config-generator.nix-serve-client {
|
||||
profiles = config.r6d.profiles;
|
||||
in
|
||||
|
||||
mkIf cfg.nix-serve-client {
|
||||
|
||||
nix = {
|
||||
# Cache http pour le store
|
||||
requireSignedBinaryCaches = false;
|
||||
binaryCaches = [
|
||||
("https://cache.nixos.org/")
|
||||
(mkIf (profiles.isDubronetwork && (! computers.isMonstre)) "http://192.168.10.169:5000")
|
||||
(mkIf profiles.isDubronetwork "http://192.168.10.252:5000")
|
||||
(mkIf (profiles.isDubronetwork && (! computers.isPedro) && (! computers.isRollo)) "http://nix-cache.dubronetwork.fr:5001")
|
||||
|
||||
(mkIf (profiles.isPrunetwork && !profiles.isServer) "http://192.168.1.20:5000")
|
||||
(mkIf profiles.isPrunetwork "https://cache.nixos.org/")
|
||||
(mkIf (profiles.isPrunetwork && !profiles.isServer) "http://nix-cache.dubronetwork.fr:5001")
|
||||
];
|
||||
extraOptions = ''
|
||||
connect-timeout = 5
|
||||
connect-timeout = 5
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,12 +1,27 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
with pkgs.lib;
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
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
|
||||
|
||||
services.nix-serve.enable = cfg.nix-serve-server;
|
||||
networking.firewall.allowedTCPPorts = mkIf cfg.nix-serve-server [ 5000 ];
|
||||
# Services
|
||||
services.nix-serve = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
# Réseau
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [
|
||||
5000
|
||||
];
|
||||
allowedUDPPorts = [
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
with pkgs.lib;
|
||||
|
||||
let
|
||||
cfg = config.r6d.config-generator;
|
||||
in {
|
||||
# Enable CUPS to print documents.
|
||||
services.printing = mkIf cfg.print {
|
||||
enable = true;
|
||||
drivers = [
|
||||
pkgs.samsung-unified-linux-driver
|
||||
];
|
||||
};
|
||||
}
|
||||
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,14 +1,20 @@
|
||||
{ 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 = [
|
||||
./environment.nix
|
||||
./localisation.nix
|
||||
./monitoring.nix
|
||||
./networking.nix
|
||||
./services.nix
|
||||
./network-dns.nix
|
||||
|
||||
# inclusion conditionnelle
|
||||
./config-generator.nix
|
||||
./activation-manuelle/service-fail2ban.nix
|
||||
./activation-manuelle/nix-serve-client.nix
|
||||
./activation-manuelle/nix-serve-server.nix
|
||||
./activation-manuelle/users.nix
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
# Edit this configuration file to define what should be installed on
|
||||
# your system. Help is available in the configuration.nix(5) man page
|
||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
## 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}" hostmaster@prunetwork.fr
|
||||
'';
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
# TODO configurer les bon ports lors de l'ouverture du service
|
||||
];
|
||||
|
||||
## Documentation
|
||||
# * https://nixos.org/wiki/Create_and_debug_nix_packages
|
||||
# * http://chriswarbo.net/essays/nixos/developing_on_nixos.html
|
||||
}
|
||||
22
base/network-dns.nix
Normal file
22
base/network-dns.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{ 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)
|
||||
networking = {
|
||||
search = [
|
||||
"dubronetwork.fr"
|
||||
"prunetwork.fr"
|
||||
"teleragno.fr"
|
||||
"teleragno.net"
|
||||
];
|
||||
dnsExtensionMechanism = true;
|
||||
};
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
# exemple utilisé pour commencer bird.nix
|
||||
let
|
||||
inherit (lib) mkEnableOption mkIf mkMerge mkOption singleton types;
|
||||
cfg = config.r6d.config-generator;
|
||||
@@ -9,19 +8,7 @@ let
|
||||
host = config.networking.hostName;
|
||||
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/print.nix
|
||||
./activation-manuelle/swap.nix
|
||||
./activation-manuelle/users.nix
|
||||
];
|
||||
|
||||
{
|
||||
###### interface
|
||||
|
||||
options = {
|
||||
@@ -43,24 +30,54 @@ in
|
||||
enable = mkEnableOption "Génération de la configuration d'une machine.";
|
||||
awesome = mkEnableOption "Profil pour activer le gestionnaire de fenêtre awesome.";
|
||||
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.";
|
||||
dovecot = mkEnableOption "Profil pour activer le serveur Dovecot.";
|
||||
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.";
|
||||
elasticsearch = mkEnableOption "Profil pour activer le service elasticsearch.";
|
||||
fail2ban = mkEnableOption "Profil pour activer Fail2ban.";
|
||||
hydra-builder = mkEnableOption "Profil pour une machine qui compile pour hydra.";
|
||||
hydra-core = mkEnableOption "Profil pour un serveur hydra.";
|
||||
kibana = mkEnableOption "Profil pour activer le service kibana.";
|
||||
jeux = mkEnableOption "Profil pour les jeux vidéos.";
|
||||
laptop = mkEnableOption "Profil pour les outils spécifiques aux ordinateurs portables..";
|
||||
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)";
|
||||
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.";
|
||||
nixStoreProxyCache = mkEnableOption "Profil pour activer le proxy cahce nginx pour le nix store";
|
||||
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.";
|
||||
radicale = mkEnableOption "Profil pour activer le service d'hébergement de calendrier + tâches & contacts.";
|
||||
swap = mkEnableOption "Profil pour que le swap soit activé.";
|
||||
virtualbox = mkEnableOption "Profil pour l'utilisation de VirtualBox.";
|
||||
xmonad = mkEnableOption "Profil pour activer le gestionnaire de fenêtres xmonad.";
|
||||
znc = mkEnableOption "Profil pour activer le relais IRC ZNC.";
|
||||
|
||||
tincAddress = mkOption {
|
||||
default = "";
|
||||
example = "192.168.1.1";
|
||||
description = "Adresse du noeud tinc local";
|
||||
type = lib.types.string;
|
||||
};
|
||||
tincExtraConfig = mkOption {
|
||||
default = "";
|
||||
example = ''
|
||||
Mode = router
|
||||
ConnecTo = bar
|
||||
'';
|
||||
description = "Configuration supplémentaire pour tinc";
|
||||
type = lib.types.string;
|
||||
};
|
||||
};
|
||||
#* Utilisé pour avoir des raccourcis de machine
|
||||
r6d.computers = {
|
||||
@@ -69,6 +86,7 @@ in
|
||||
isNeoNomade = mkEnableOption "Identification du nom de machine.";
|
||||
isNomade = 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.";
|
||||
isRadx = mkEnableOption "Identification du nom de machine.";
|
||||
isRollo = mkEnableOption "Identification du nom de machine.";
|
||||
@@ -89,6 +107,7 @@ in
|
||||
isNeoNomade = host == "neo-nomade.dubronetwork.fr";
|
||||
isNomade = host == "nomade.dubronetwork.fr";
|
||||
isOcean = host == "ocean.prunetwork.fr";
|
||||
isPedro = host == "pedro.dubronetwork.fr";
|
||||
isPhenom = host == "phenom.dubronetwork.fr";
|
||||
isRadx = host == "radx.prunetwork.fr";
|
||||
isRollo = host == "rollo.dubronetwork.fr";
|
||||
@@ -108,7 +127,7 @@ in
|
||||
(mkIf pfl.isHome {
|
||||
r6d.profiles.isDesktop = true;
|
||||
})
|
||||
(mkIf pfl.isServer {
|
||||
(mkIf (pfl.isServer && !comp.isMonstre) {
|
||||
r6d.config-generator = {
|
||||
#database_postgres = true;
|
||||
dns_autorite = true;
|
||||
@@ -120,7 +139,7 @@ in
|
||||
};
|
||||
})
|
||||
# /!\ PAS un serveur
|
||||
(mkIf (!pfl.isServer) {
|
||||
(mkIf (!pfl.isServer || comp.isMonstre) {
|
||||
r6d.config-generator = {
|
||||
dns_resolveur = true;
|
||||
};
|
||||
@@ -129,8 +148,13 @@ in
|
||||
r6d.profiles.isDesktop = true;
|
||||
|
||||
r6d.config-generator = {
|
||||
cartographie = true;
|
||||
developpement = true;
|
||||
docker = true;
|
||||
|
||||
edition-musique = true;
|
||||
edition-photo = true;
|
||||
edition-video = true;
|
||||
};
|
||||
})
|
||||
|
||||
@@ -141,12 +165,6 @@ in
|
||||
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) {
|
||||
r6d.config-generator = {
|
||||
conception-assistee = true;
|
||||
@@ -171,17 +189,25 @@ in
|
||||
isPrunetwork = true;
|
||||
isServer = true;
|
||||
};
|
||||
|
||||
r6d.config-generator = {
|
||||
docker = true;
|
||||
radicale = true;
|
||||
};
|
||||
})
|
||||
(mkIf comp.isRadx {
|
||||
r6d.profiles = {
|
||||
isHome = true;
|
||||
isPrunetwork = true;
|
||||
isServer = true;
|
||||
isWorkstation = true;
|
||||
};
|
||||
|
||||
r6d.config-generator = {
|
||||
nix-serve-server = true;
|
||||
elasticsearch = true;
|
||||
hydra-builder = true;
|
||||
hydra-core = true;
|
||||
kibana = true;
|
||||
print = true;
|
||||
virtualbox = true;
|
||||
};
|
||||
})
|
||||
@@ -201,6 +227,8 @@ in
|
||||
|
||||
r6d.config-generator = {
|
||||
laptop = true;
|
||||
tincAddress = "192.168.12.2/24";
|
||||
tincExtraConfig = "ConnectTo = phenom_dubronetwork_fr";
|
||||
};
|
||||
})
|
||||
(mkIf comp.isMonstre {
|
||||
@@ -209,7 +237,11 @@ in
|
||||
isServer = true;
|
||||
};
|
||||
|
||||
r6d.config-generator.fail2ban = true;
|
||||
r6d.config-generator = {
|
||||
fail2ban = true;
|
||||
nix-serve-client = true;
|
||||
nixStoreProxyCache = true;
|
||||
};
|
||||
})
|
||||
(mkIf comp.isNeoNomade{
|
||||
r6d.profiles = {
|
||||
@@ -228,6 +260,17 @@ in
|
||||
laptop = true;
|
||||
};
|
||||
})
|
||||
(mkIf comp.isPedro {
|
||||
r6d.profiles = {
|
||||
isDubronetwork = true;
|
||||
isServer = true;
|
||||
};
|
||||
|
||||
r6d.config-generator = {
|
||||
fail2ban = true;
|
||||
online-ipv6 = true;
|
||||
};
|
||||
})
|
||||
(mkIf comp.isPhenom {
|
||||
r6d.profiles = {
|
||||
isDubronetwork = true;
|
||||
@@ -237,6 +280,9 @@ in
|
||||
|
||||
r6d.config-generator = {
|
||||
nix-serve-server = true;
|
||||
laptop = true;
|
||||
edition-photo = true;
|
||||
tincAddress = "192.168.12.1/24";
|
||||
};
|
||||
})
|
||||
(mkIf comp.isRollo {
|
||||
@@ -246,8 +292,12 @@ in
|
||||
};
|
||||
|
||||
r6d.config-generator = {
|
||||
dovecot = true;
|
||||
fail2ban = true;
|
||||
mailboxes = true;
|
||||
murmur = true;
|
||||
online-ipv6 = true;
|
||||
znc = true;
|
||||
};
|
||||
})
|
||||
];
|
||||
@@ -1,44 +0,0 @@
|
||||
{ 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
|
||||
];
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf;
|
||||
cfg = config.r6d.config-generator;
|
||||
computers = config.r6d.computers;
|
||||
profiles = config.r6d.profiles;
|
||||
|
||||
in mkIf cfg.laptop {
|
||||
# Paquets spécifiques pour un ordinateur portable
|
||||
|
||||
## Activation d'un gestionnaire de réseau
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
hardware.bluetooth.enable = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
networkmanagerapplet
|
||||
];
|
||||
|
||||
services.xserver.synaptics = {
|
||||
enable = true;
|
||||
twoFingerScroll = 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)
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf;
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
cfg = config.r6d.config-generator;
|
||||
computers = config.r6d.computers;
|
||||
profiles = config.r6d.profiles;
|
||||
in
|
||||
|
||||
in mkIf cfg.xmonad {
|
||||
# Paquets spécifiques pour xmonad
|
||||
mkIf cfg.xmonad {
|
||||
|
||||
environment.systemPackages = with pkgs;[
|
||||
# Paquets
|
||||
environment.systemPackages = with pkgs; [
|
||||
dmenu
|
||||
haskellPackages.xmobar
|
||||
];
|
||||
|
||||
# Services
|
||||
services.xserver.windowManager.xmonad = {
|
||||
enable = true;
|
||||
enableContribAndExtras = true;
|
||||
@@ -1,46 +0,0 @@
|
||||
{ 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
|
||||
|
||||
# Mail
|
||||
postfix
|
||||
|
||||
# Système de fichier
|
||||
curlftpfs
|
||||
gparted
|
||||
inotify-tools
|
||||
nfs-utils
|
||||
ntfs3g
|
||||
sshfsFuse
|
||||
|
||||
#
|
||||
unetbootin # création de clefs USB bootables
|
||||
];
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
{ 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
|
||||
audacity # montage audio
|
||||
beep
|
||||
cmus # lecteur audio console
|
||||
easytag # gestion des métadonnées des fichiers musicaux
|
||||
picard # gestion des métadonnées des fichiers musicaux
|
||||
espeak # synthèse vocale
|
||||
paprefs # préferences pulseaudio
|
||||
pavucontrol # mixer pulseaudio
|
||||
vorbis-tools # codec
|
||||
|
||||
## Video
|
||||
smplayer # lecteur vidéo
|
||||
vlc # lecteur vidéo
|
||||
|
||||
## Photo & Dessin vectoriel
|
||||
exif
|
||||
exiftags
|
||||
gimp # logiciel d'édition/montage/retouche photo
|
||||
inkscape # édition d'image vectorielle (svg & autre)
|
||||
imagemagick # modification image en CLI
|
||||
kde4.ksnapshot
|
||||
rawtherapee # développemen de photos en RAW
|
||||
|
||||
### TEST d'outil de gestion de catalogue de photos
|
||||
kde4.digikam # gestionnaire de bibliothèque de photo
|
||||
];
|
||||
}
|
||||
@@ -1,61 +1,54 @@
|
||||
{ config, pkgs, ... }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.r6d.config-generator;
|
||||
computers = config.r6d.computers;
|
||||
profiles = config.r6d.profiles;
|
||||
mkIf = pkgs.lib.mkIf;
|
||||
mkIf = lib.mkIf;
|
||||
in
|
||||
|
||||
{
|
||||
imports = [ # applications :
|
||||
# commandées par config-generator
|
||||
./activation-manuelle/app-awesome.nix # pour les profils awesome
|
||||
./activation-manuelle/app-cao.nix # de conception assisté par ordinateur & modélisation
|
||||
./activation-manuelle/app-developpement.nix # utilisée pour développer des programmes/scripts
|
||||
./activation-manuelle/app-docker.nix # pour activer docker
|
||||
./activation-manuelle/app-jeux.nix # permettant de jouer ;)
|
||||
./activation-manuelle/app-virtualbox.nix # pour exploiter virtualbox
|
||||
./activation-manuelle/laptop.nix # appli & configuration adaptée pour un PC portable$
|
||||
./activation-manuelle/xmonad.nix # gestionnaire de fenêtres xmonad
|
||||
# installées systématiquement
|
||||
./desktop-minimal.nix
|
||||
./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, ...)
|
||||
# A ajouter dans config-generator & revoir le contenu pour le mettre si nécessaire dans minimal
|
||||
./app-cartographie.nix # utilisée pour manipuler les données géographiques & cartes
|
||||
./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, ...)
|
||||
./activation-manuelle/xmonad/xmonad.nix # gestionnaire de fenêtres xmonad
|
||||
];
|
||||
|
||||
# Paquets
|
||||
environment.systemPackages = with pkgs; mkIf profiles.isDesktop [
|
||||
# Environement de bureau
|
||||
wmname # pour définir le nom du gestionnaire de fenêtre (utile pour java)
|
||||
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'
|
||||
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)
|
||||
pcmanfm # gestionnaire de fichiers graphique
|
||||
spaceFM # gestionnaire de fichiers graphique
|
||||
vifm # gestionnaire de fichiers basé sur VIM (console)
|
||||
|
||||
## Terminal
|
||||
sakura # terminal
|
||||
sakura # terminal
|
||||
|
||||
# A trier
|
||||
cowsay
|
||||
fgallery # générateur de gallerie statique http://www.thregr.org/~wavexx/software/fgallery/
|
||||
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
|
||||
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: {
|
||||
@@ -63,45 +56,5 @@ in
|
||||
mumble = pkgs.mumble.override { pulseSupport = true; };
|
||||
};
|
||||
|
||||
# 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.
|
||||
''];
|
||||
};
|
||||
|
||||
# Pulse Audio
|
||||
hardware.pulseaudio = mkIf profiles.isDesktop {
|
||||
enable = true;
|
||||
support32Bit = true;
|
||||
};
|
||||
environment.etc."pulse/daemon.conf".text = "flat-volumes = no";
|
||||
security.setuidPrograms = [ "udevil" ];
|
||||
}
|
||||
|
||||
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 ];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,18 +1,25 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf;
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
cfg = config.r6d.config-generator;
|
||||
computers = config.r6d.computers;
|
||||
profiles = config.r6d.profiles;
|
||||
in
|
||||
|
||||
in mkIf cfg.virtualbox {
|
||||
mkIf true {
|
||||
|
||||
# Paquets
|
||||
environment.systemPackages = with pkgs; [
|
||||
linuxPackages.virtualbox
|
||||
linuxPackages.virtualboxGuestAdditions
|
||||
];
|
||||
|
||||
virtualisation.virtualbox.host.enable = true;
|
||||
}
|
||||
# Services
|
||||
|
||||
# Réseau
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [
|
||||
];
|
||||
allowedUDPPorts = [
|
||||
];
|
||||
};
|
||||
}
|
||||
52
public/app-adminsys.nix
Normal file
52
public/app-adminsys.nix
Normal file
@@ -0,0 +1,52 @@
|
||||
{ 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; [
|
||||
# Adminsys
|
||||
iotop
|
||||
lm_sensors
|
||||
lshw
|
||||
lsof
|
||||
ntp
|
||||
powerline-fonts
|
||||
powertop
|
||||
python27Packages.ansible2
|
||||
python27Packages.glances
|
||||
usbutils
|
||||
|
||||
# Compression
|
||||
lz4
|
||||
lzop
|
||||
|
||||
# Système de fichier
|
||||
## Montage de filesystem
|
||||
curlftpfs # ftp
|
||||
ntfs3g # ntfs
|
||||
sshfsFuse # ssh
|
||||
|
||||
## Gestion de FS
|
||||
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,11 +1,13 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf;
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
cfg = config.r6d.config-generator;
|
||||
computers = config.r6d.computers;
|
||||
profiles = config.r6d.profiles;
|
||||
in mkIf cfg.awesome {
|
||||
in
|
||||
|
||||
mkIf cfg.awesome {
|
||||
|
||||
environment.variables = {
|
||||
# Export the current path for the awesome derivation, useful for users rc.lua
|
||||
@@ -1,7 +1,7 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf;
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
cfg = config.r6d.config-generator;
|
||||
computers = config.r6d.computers;
|
||||
profiles = config.r6d.profiles;
|
||||
@@ -9,6 +9,7 @@ in
|
||||
|
||||
mkIf profiles.isDesktop {
|
||||
|
||||
# Paquets
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Bureautique
|
||||
aspell aspellDicts.fr
|
||||
@@ -34,10 +35,11 @@ mkIf profiles.isDesktop {
|
||||
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
|
||||
odpdown # conversion md -> presentation ODP : https://github.com/thorstenb/odpdown
|
||||
pandoc
|
||||
#texLiveFull # distribution LaTeX
|
||||
texLive # distribution LaTeX de base
|
||||
texLiveBeamer # paquets et extensions pour Beamer
|
||||
texLiveModerncv # paquets pour la classe Modern CV
|
||||
texlive.combined.scheme-full # distribution LaTeX
|
||||
#texLive # distribution LaTeX de base
|
||||
#texLiveBeamer # paquets et extensions pour Beamer
|
||||
#texLiveModerncv # paquets pour la classe Modern CV
|
||||
];
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf;
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
cfg = config.r6d.config-generator;
|
||||
computers = config.r6d.computers;
|
||||
profiles = config.r6d.profiles;
|
||||
@@ -9,7 +9,8 @@ in
|
||||
|
||||
mkIf cfg.conception-assistee {
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Paquets
|
||||
environment.systemPackages = with pkgs; [
|
||||
# CAO
|
||||
## Modélisation 3D
|
||||
freecad # modélisation de pièces en 3D
|
||||
@@ -1,17 +1,21 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf;
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
cfg = config.r6d.config-generator;
|
||||
computers = config.r6d.computers;
|
||||
profiles = config.r6d.profiles;
|
||||
in
|
||||
|
||||
mkIf profiles.isDesktop {
|
||||
mkIf cfg.cartographie {
|
||||
|
||||
# Paquets
|
||||
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
|
||||
];
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf;
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
cfg = config.r6d.config-generator;
|
||||
computers = config.r6d.computers;
|
||||
profiles = config.r6d.profiles;
|
||||
@@ -9,17 +9,23 @@ in
|
||||
|
||||
mkIf profiles.isDesktop {
|
||||
|
||||
# Paquets
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Clients Internet
|
||||
|
||||
## Navigateur & Réseaux sociaux
|
||||
## Navigateur
|
||||
chromium
|
||||
firefox
|
||||
python27Packages.turses # client twitter en ncurse
|
||||
|
||||
## Réseaux sociaux
|
||||
python27Packages.turses # client twitter en ncurse
|
||||
python27Packages.rainbowstream # client twitter en console
|
||||
rtv # client reddit en console
|
||||
|
||||
## Mail & Discussion (texte, audio)
|
||||
clawsMail
|
||||
kde5.quasselClient
|
||||
hexchat
|
||||
quasselClient
|
||||
mumble
|
||||
mutt
|
||||
pidgin
|
||||
48
public/app-developpement.nix
Normal file
48
public/app-developpement.nix
Normal file
@@ -0,0 +1,48 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
cfg = config.r6d.config-generator;
|
||||
computers = config.r6d.computers;
|
||||
profiles = config.r6d.profiles;
|
||||
in
|
||||
|
||||
mkIf cfg.developpement {
|
||||
|
||||
# Paquets
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Base de données
|
||||
pgadmin # interface d'administration de postgres
|
||||
sqlitebrowser # interface d'administration de sqlite
|
||||
|
||||
# Développement
|
||||
cloc
|
||||
idea.idea-community # IntelliJ IDEA
|
||||
gcc # pour les appels depuis les scripts
|
||||
|
||||
# Documentation
|
||||
zeal # consulter la documentation hors ligne
|
||||
|
||||
## Gestion des sources
|
||||
# git # déjà présent dans "base"
|
||||
# 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
|
||||
subversion
|
||||
|
||||
## Haskell
|
||||
ghc # pour les appels depuis les scripts
|
||||
stack
|
||||
|
||||
## Rust
|
||||
cargo # récupération des dépendances + compilation projet rust
|
||||
rustc # pour les appels depuis les scripts
|
||||
|
||||
## Visualisation & outils de diff
|
||||
gource # visualisation en mouvement de l'historique git
|
||||
meld # outil de comparaison graphique
|
||||
vbindiff # diff de fichier hexadecimaux avec vim
|
||||
];
|
||||
}
|
||||
@@ -1,13 +1,15 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf;
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
cfg = config.r6d.config-generator;
|
||||
computers = config.r6d.computers;
|
||||
profiles = config.r6d.profiles;
|
||||
in
|
||||
|
||||
in mkIf cfg.docker {
|
||||
mkIf cfg.docker {
|
||||
|
||||
# Paquets
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Ecosystème Docker
|
||||
docker
|
||||
19
public/app-edition-musique.nix
Normal file
19
public/app-edition-musique.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
cfg = config.r6d.config-generator;
|
||||
computers = config.r6d.computers;
|
||||
profiles = config.r6d.profiles;
|
||||
in
|
||||
|
||||
mkIf cfg.edition-musique {
|
||||
|
||||
# Paquets
|
||||
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
|
||||
];
|
||||
}
|
||||
27
public/app-edition-photo.nix
Normal file
27
public/app-edition-photo.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
cfg = config.r6d.config-generator;
|
||||
computers = config.r6d.computers;
|
||||
profiles = config.r6d.profiles;
|
||||
in
|
||||
|
||||
mkIf cfg.edition-photo {
|
||||
|
||||
# Paquets
|
||||
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
|
||||
];
|
||||
}
|
||||
@@ -1,15 +1,18 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf;
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
cfg = config.r6d.config-generator;
|
||||
computers = config.r6d.computers;
|
||||
profiles = config.r6d.profiles;
|
||||
in
|
||||
|
||||
mkIf profiles.isDesktop {
|
||||
mkIf cfg.edition-video {
|
||||
|
||||
# Paquets
|
||||
environment.systemPackages = with pkgs; [
|
||||
|
||||
# Vidéo
|
||||
#cinelerra # editeur video
|
||||
pitivi # montage vidéo
|
||||
];
|
||||
}
|
||||
@@ -1,13 +1,15 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf;
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
cfg = config.r6d.config-generator;
|
||||
computers = config.r6d.computers;
|
||||
profiles = config.r6d.profiles;
|
||||
in
|
||||
|
||||
in mkIf cfg.jeux {
|
||||
mkIf cfg.jeux {
|
||||
|
||||
# Paquets
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Jeux
|
||||
urbanterror
|
||||
30
public/app-multimedia.nix
Normal file
30
public/app-multimedia.nix
Normal file
@@ -0,0 +1,30 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
cfg = config.r6d.config-generator;
|
||||
computers = config.r6d.computers;
|
||||
profiles = config.r6d.profiles;
|
||||
in
|
||||
|
||||
mkIf profiles.isDesktop {
|
||||
|
||||
# Paquets
|
||||
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
|
||||
];
|
||||
}
|
||||
@@ -7,31 +7,29 @@ let
|
||||
profiles = config.r6d.profiles;
|
||||
in
|
||||
|
||||
mkIf profiles.isDesktop {
|
||||
mkIf true {
|
||||
#mkIf profiles.isDesktop {
|
||||
|
||||
# Paquets
|
||||
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
|
||||
#vsftpd # serveur FTP
|
||||
|
||||
## Diagnostic
|
||||
arp-scan
|
||||
wireshark
|
||||
#wireshark
|
||||
whois
|
||||
|
||||
## Routage
|
||||
quagga # daemon de routage
|
||||
|
||||
## Tunnel
|
||||
# openvpn
|
||||
tinc
|
||||
];
|
||||
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [5201]; # iperf
|
||||
allowedUDPPorts = [5201]; # iperf
|
||||
allowedTCPPorts = [
|
||||
5201 # iperf
|
||||
];
|
||||
allowedUDPPorts = [
|
||||
5201 # iperf
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf;
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
cfg = config.r6d.config-generator;
|
||||
computers = config.r6d.computers;
|
||||
profiles = config.r6d.profiles;
|
||||
@@ -9,6 +9,7 @@ in
|
||||
|
||||
mkIf profiles.isDesktop {
|
||||
|
||||
# Paquets
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Securité
|
||||
gnome3.seahorse # gestionnaire graphique de clef GPG
|
||||
@@ -17,4 +18,5 @@ mkIf profiles.isDesktop {
|
||||
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
|
||||
];
|
||||
security.setuidPrograms = [ "slock" ];
|
||||
}
|
||||
27
public/app-virtualbox.nix
Normal file
27
public/app-virtualbox.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
cfg = config.r6d.config-generator;
|
||||
computers = config.r6d.computers;
|
||||
profiles = config.r6d.profiles;
|
||||
in
|
||||
|
||||
mkIf cfg.virtualbox {
|
||||
|
||||
# Paquets
|
||||
environment.systemPackages = with pkgs; [
|
||||
linuxPackages.virtualbox
|
||||
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;
|
||||
}
|
||||
16
public/auto-upgrade.nix
Normal file
16
public/auto-upgrade.nix
Normal file
@@ -0,0 +1,16 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
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;
|
||||
}
|
||||
@@ -1,17 +1,32 @@
|
||||
{ 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
|
||||
nix.buildCores = 0;
|
||||
|
||||
# The NixOS release to be compatible with for stateful data such as databases.
|
||||
system.stateVersion = "16.03";
|
||||
system.stateVersion = "16.09";
|
||||
|
||||
# copies the NixOS configuration file (usually /etc/nixos/configuration.nix) and links it from the resulting system (getting to /run/current-system/configuration.nix)
|
||||
system.copySystemConfiguration = true;
|
||||
|
||||
# On autorise les paquets non-libres
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# List packages installed in system profile. To search by name, run:
|
||||
# $ nix-env -qaP | grep wget
|
||||
# Lancement de dbus pour les utilisateurs
|
||||
services.dbus.socketActivated = true;
|
||||
|
||||
# NixOS Hardening
|
||||
#security.grsecurity.enable = true;
|
||||
|
||||
# Paquets
|
||||
environment = {
|
||||
systemPackages = with pkgs; [
|
||||
bind # utilisé pour les utilitaires comme dig
|
||||
@@ -30,6 +45,8 @@
|
||||
p7zip # compression de fichier
|
||||
parted # partitionnement de disque
|
||||
pciutils
|
||||
pinentry # pour taper les mots de passe gpg
|
||||
psmisc # fournis les utilitaires comme killall, fuser, pstree
|
||||
python # python -- python -m SimpleHTTPServer 8000
|
||||
python34Packages.glances # monitoring
|
||||
pwgen # générateur de mot de passe
|
||||
@@ -43,6 +60,8 @@
|
||||
];
|
||||
shellAliases = {
|
||||
byobu = "byobu-tmux";
|
||||
gpg = "gpg2";
|
||||
jacques-a-dit = "sudo";
|
||||
tree = "tree -C";
|
||||
tree1 = "tree -d -L 1";
|
||||
tree2 = "tree -d -L 2";
|
||||
@@ -52,6 +71,10 @@
|
||||
};
|
||||
etc.gitconfig.text = builtins.readFile ./gitconfig;
|
||||
};
|
||||
# programmes qui n'ont pas besoin de sudo pour fonctionner
|
||||
security.setuidPrograms = [
|
||||
"mtr"
|
||||
];
|
||||
programs.bash = {
|
||||
enableCompletion = true;
|
||||
promptInit = builtins.readFile ./bash-prompt.sh;
|
||||
27
public/laptop.nix
Normal file
27
public/laptop.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
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;
|
||||
|
||||
# Paquets
|
||||
environment.systemPackages = with pkgs; [
|
||||
networkmanagerapplet # gestionnaire réseau graphique + console (nm-applet + nmtui)
|
||||
wirelesstools # fournis iwconfig
|
||||
];
|
||||
}
|
||||
@@ -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.
|
||||
i18n = {
|
||||
consoleFont = "Lat2-Terminus16";
|
||||
@@ -1,16 +1,13 @@
|
||||
{ config, pkgs, ... }:
|
||||
{ config, lib, 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;
|
||||
};
|
||||
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
|
||||
|
||||
18
public/network.nix
Normal file
18
public/network.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{ 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 {
|
||||
|
||||
# fix: Hostname -s renvoie "Unknown host" alors que hostname renvoie la bonne valeur
|
||||
# Il s'avère que hostname vérifie la validité du FQDN et du reverse.
|
||||
# Fixer ces paramètres dans les hosts permet de faire tomber en marche
|
||||
networking.extraHosts = ''
|
||||
127.0.0.1 ${config.networking.hostName}
|
||||
'';
|
||||
}
|
||||
27
public/print.nix
Normal file
27
public/print.nix
Normal file
@@ -0,0 +1,27 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
cfg = config.r6d.config-generator;
|
||||
computers = config.r6d.computers;
|
||||
profiles = config.r6d.profiles;
|
||||
in
|
||||
|
||||
mkIf cfg.print {
|
||||
|
||||
# Services
|
||||
## 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
|
||||
'';
|
||||
};
|
||||
}
|
||||
55
public/public.nix
Normal file
55
public/public.nix
Normal file
@@ -0,0 +1,55 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
#inherit (lib) mkIf mkMerge mkThenElse;
|
||||
cfg = config.r6d.config-generator;
|
||||
computers = config.r6d.computers;
|
||||
profiles = config.r6d.profiles;
|
||||
in
|
||||
|
||||
{
|
||||
imports = [
|
||||
# installées systématiquement
|
||||
./environment.nix
|
||||
./localisation.nix
|
||||
./network.nix
|
||||
#./network-ipv6.nix
|
||||
./sudo.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-elasticsearch.nix # service de stockage et recher de données
|
||||
./service-hydra-build.nix # service de construction de paquet. -> la machine compile des paquets
|
||||
./service-hydra-core.nix # service pour l'instance d'hydra
|
||||
./service-kibana.nix # service de visualisation de données stockées dans elasticsearch
|
||||
./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
|
||||
];
|
||||
}
|
||||
34
public/service-elasticsearch.nix
Normal file
34
public/service-elasticsearch.nix
Normal file
@@ -0,0 +1,34 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
cfg = config.r6d.config-generator;
|
||||
computers = config.r6d.computers;
|
||||
profiles = config.r6d.profiles;
|
||||
in
|
||||
|
||||
mkIf cfg.elasticsearch {
|
||||
|
||||
# Paquets
|
||||
environment.systemPackages = with pkgs; [
|
||||
];
|
||||
|
||||
# Services
|
||||
|
||||
## E : http://localhost:9200/_cat/indices?v
|
||||
services.elasticsearch = {
|
||||
enable = true;
|
||||
port = 9200;
|
||||
listenAddress = "127.0.0.1";
|
||||
#listenAddress = "_site_";
|
||||
};
|
||||
|
||||
# Réseau
|
||||
# -> Aucun port n'est ouvert caril est recommandé de mettre un proxy HTTP devant
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [
|
||||
];
|
||||
allowedUDPPorts = [
|
||||
];
|
||||
};
|
||||
}
|
||||
21
public/service-haveged.nix
Normal file
21
public/service-haveged.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{ 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 {
|
||||
|
||||
# Sécurité & Accès distant
|
||||
# Services
|
||||
|
||||
## 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;
|
||||
};
|
||||
}
|
||||
32
public/service-hydra-build.nix
Normal file
32
public/service-hydra-build.nix
Normal file
@@ -0,0 +1,32 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
cfg = config.r6d.config-generator;
|
||||
computers = config.r6d.computers;
|
||||
profiles = config.r6d.profiles;
|
||||
in
|
||||
|
||||
mkIf cfg.hydra-builder {
|
||||
|
||||
# Paquets
|
||||
environment.systemPackages = with pkgs; [
|
||||
];
|
||||
|
||||
# Services
|
||||
|
||||
|
||||
virtualisation.virtualbox.host.enable = true;
|
||||
nix.gc.automatic = true;
|
||||
|
||||
users.users."hydrabld" = {
|
||||
description = "Execution des jobs hydra";
|
||||
group = "nixbld";
|
||||
extraGroups = [ "nixbld" ];
|
||||
isNormalUser = true;
|
||||
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGYpjcWJCf8dXpv2LmoIaNVbwZXEC50QUU6Az+lqeD89 hydra radx"
|
||||
];
|
||||
};
|
||||
}
|
||||
71
public/service-hydra-core.nix
Normal file
71
public/service-hydra-core.nix
Normal file
@@ -0,0 +1,71 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
cfg = config.r6d.config-generator;
|
||||
computers = config.r6d.computers;
|
||||
profiles = config.r6d.profiles;
|
||||
in
|
||||
|
||||
mkIf cfg.hydra-core {
|
||||
|
||||
# Paquets
|
||||
environment.systemPackages = with pkgs; [
|
||||
];
|
||||
|
||||
# Documentation HYDRA
|
||||
|
||||
## Installation
|
||||
|
||||
# 1. créer clef SSH :
|
||||
# ssh-keygen -C "hydra@pedro.dubronetwork.fr" -N "" -f /etc/nixos/id_buildfarm
|
||||
# 2. récupérer la clef publique du serveur ssh + l'ajouter dans les `knownHosts` :
|
||||
# ssh-keyscan localhost
|
||||
# 3. créer un utilisateur pour gérer hydra
|
||||
# su - hydra
|
||||
# hydra-create-user jpierre03 --password xxx --role 'admin'
|
||||
# 4. relancer hydra
|
||||
# 5. ajouter un vhost à nginx
|
||||
# 6. relancer nginx
|
||||
# 7. le service accessible à hydra.<nom de machine>
|
||||
|
||||
## Tutoriel
|
||||
# * https://github.com/peti/hydra-tutorial
|
||||
|
||||
# Services
|
||||
|
||||
## Hydra
|
||||
|
||||
services.hydra = {
|
||||
enable = true;
|
||||
hydraURL = "http://hydra.${config.networking.hostName}";
|
||||
notificationSender = "hydra@${config.networking.hostName}";
|
||||
listenHost = "localhost";
|
||||
minimumDiskFree = 50; # Go
|
||||
smtpHost = "localhost";
|
||||
};
|
||||
|
||||
## Ménage
|
||||
#nix.gc.automatic = true;
|
||||
|
||||
## Délégation des actions de compilation à la ferme de compilation
|
||||
|
||||
### Machines connues
|
||||
|
||||
programs.ssh.knownHosts = {
|
||||
"monstre.dubronetwork.fr".publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBTTrLhq1Cwm0rpnwEIxSLqVrJWZnt+/9dt+SKd8NiIc";
|
||||
"pedro.dubronetwork.fr".publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM7fjo2ysLqlfSo6BKnc6I6m1ayoPrbwEEyTKZmUzsOD";
|
||||
"ocean.prunetwork.fr".publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINCaRuTl8iCTUE4XInOpkSlwQj5Re4w4Iq+gNIlJe8pA";
|
||||
"radx.prunetwork.fr".publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGyoXdTEnxSgZTMfRfVH+bpOGZJtJpydAijcRGsZik7U";
|
||||
"rollo.dubronetwork.fr".publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAID4lWgS/sVdcZvnAAN+lBSOcCL9ISdAUsjp1kh9lalNu";
|
||||
};
|
||||
|
||||
### La liste des machines utilisées
|
||||
nix = {
|
||||
distributedBuilds = false;
|
||||
buildMachines = [
|
||||
# { hostName = "pedro.dubronetwork.fr"; maxJobs = 5; speedFactor = 10; sshKey = "/etc/nixos/id_buildfarm"; sshUser = "root"; system = "x86_64-linux"; }
|
||||
];
|
||||
extraOptions = "auto-optimise-store = true";
|
||||
};
|
||||
}
|
||||
33
public/service-kibana.nix
Normal file
33
public/service-kibana.nix
Normal file
@@ -0,0 +1,33 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
cfg = config.r6d.config-generator;
|
||||
computers = config.r6d.computers;
|
||||
profiles = config.r6d.profiles;
|
||||
in
|
||||
|
||||
mkIf cfg.kibana {
|
||||
|
||||
# Paquets
|
||||
environment.systemPackages = with pkgs; [
|
||||
];
|
||||
|
||||
# Services
|
||||
|
||||
# K : http://localhost:8000
|
||||
services.kibana = {
|
||||
enable = true;
|
||||
elasticsearch.url = "http://127.0.0.1:9200";
|
||||
port = 8000;
|
||||
};
|
||||
|
||||
# Réseau
|
||||
# -> Aucun port n'est ouvert caril est recommandé de mettre un proxy HTTP devant
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [
|
||||
];
|
||||
allowedUDPPorts = [
|
||||
];
|
||||
};
|
||||
}
|
||||
19
public/service-laptop.nix
Normal file
19
public/service-laptop.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
cfg = config.r6d.config-generator;
|
||||
computers = config.r6d.computers;
|
||||
profiles = config.r6d.profiles;
|
||||
in
|
||||
|
||||
mkIf cfg.laptop {
|
||||
|
||||
# Gestion spécifique pour PC portable
|
||||
|
||||
# Services
|
||||
services.xserver.synaptics = {
|
||||
enable = true;
|
||||
twoFingerScroll = true;
|
||||
};
|
||||
}
|
||||
17
public/service-locate.nix
Normal file
17
public/service-locate.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 cfg.locate {
|
||||
|
||||
# Services
|
||||
services.locate = {
|
||||
enable = true;
|
||||
interval = "hourly";
|
||||
};
|
||||
}
|
||||
44
public/service-monitoring.nix
Normal file
44
public/service-monitoring.nix
Normal file
@@ -0,0 +1,44 @@
|
||||
{ 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; [
|
||||
mailutils
|
||||
];
|
||||
|
||||
# Services
|
||||
|
||||
## 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}
|
||||
'';
|
||||
};
|
||||
|
||||
# Réseau
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [
|
||||
8000
|
||||
];
|
||||
allowedUDPPorts = [
|
||||
];
|
||||
};
|
||||
}
|
||||
18
public/service-pulseaudio.nix
Normal file
18
public/service-pulseaudio.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
cfg = config.r6d.config-generator;
|
||||
computers = config.r6d.computers;
|
||||
profiles = config.r6d.profiles;
|
||||
in
|
||||
|
||||
mkIf profiles.isDesktop {
|
||||
|
||||
# Pulse Audio
|
||||
hardware.pulseaudio = {
|
||||
enable = true;
|
||||
support32Bit = true;
|
||||
};
|
||||
environment.etc."pulse/daemon.conf".text = "flat-volumes = no";
|
||||
}
|
||||
@@ -1,19 +1,20 @@
|
||||
{ config, pkgs, ... }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Sécurité & Acces distant
|
||||
let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
cfg = config.r6d.config-generator;
|
||||
computers = config.r6d.computers;
|
||||
profiles = config.r6d.profiles;
|
||||
in
|
||||
|
||||
## 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;
|
||||
};
|
||||
mkIf true {
|
||||
|
||||
# Services
|
||||
## OpenSSH daemon
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
# https://wiki.mozilla.org/Security/Guidelines/OpenSSH#Modern_.28OpenSSH_6.7.2B.29
|
||||
# http://www.cyberciti.biz/tips/linux-unix-bsd-openssh-server-best-practices.html
|
||||
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
|
||||
@@ -27,12 +28,4 @@
|
||||
UsePrivilegeSeparation sandbox
|
||||
'';
|
||||
};
|
||||
|
||||
# Monitoring
|
||||
|
||||
## Noeud de supervision munin = pas de stockage des données locales
|
||||
|
||||
services.munin-node = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
45
public/service-x11.nix
Normal file
45
public/service-x11.nix
Normal file
@@ -0,0 +1,45 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
cfg = config.r6d.config-generator;
|
||||
computers = config.r6d.computers;
|
||||
profiles = config.r6d.profiles;
|
||||
in
|
||||
|
||||
mkIf profiles.isDesktop {
|
||||
|
||||
# Services
|
||||
# Enable the X11 windowing system.
|
||||
services.xserver = {
|
||||
#enable = true;
|
||||
layout = "fr";
|
||||
xkbOptions = "eurosign:e";
|
||||
displayManager.lightdm.enable = true;
|
||||
windowManager.awesome.enable = true;
|
||||
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.
|
||||
''];
|
||||
};
|
||||
}
|
||||
18
public/sudo.nix
Normal file
18
public/sudo.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{ 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
|
||||
%users ALL = NOPASSWD: ${pkgs.slock}/bin/slock
|
||||
'';
|
||||
}
|
||||
@@ -1,14 +1,18 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
with pkgs.lib;
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkIf mkMerge mkThenElse;
|
||||
cfg = config.r6d.config-generator;
|
||||
in {
|
||||
computers = config.r6d.computers;
|
||||
profiles = config.r6d.profiles;
|
||||
in
|
||||
|
||||
mkIf cfg.swap {
|
||||
|
||||
# Gestion du swap
|
||||
|
||||
# https://en.wikipedia.org/wiki/Swappiness
|
||||
boot.kernel.sysctl = mkIf cfg.swap {
|
||||
boot.kernel.sysctl = {
|
||||
# le swap est activé (!= 0)
|
||||
# le swap est utilisé lorsque (100 - x) % de la mémoire est déja allouée
|
||||
"vm.swappiness" = 10;
|
||||
Reference in New Issue
Block a user