Compare commits
70 Commits
2016-08-15
...
upgrade-16
| Author | SHA1 | Date | |
|---|---|---|---|
| 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 |
37
Makefile
37
Makefile
@@ -1,5 +1,6 @@
|
|||||||
all: rebuild-switch
|
all: rebuild-switch
|
||||||
date
|
date
|
||||||
|
##--------- Commandes spécifiques pour NixOS
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
nix-collect-garbage -d --delete-older-than 15d
|
nix-collect-garbage -d --delete-older-than 15d
|
||||||
@@ -14,23 +15,26 @@ clean-log:
|
|||||||
journalctl --vacuum-size=1G
|
journalctl --vacuum-size=1G
|
||||||
|
|
||||||
full-auto: submodules-update upgrade clean optimise
|
full-auto: submodules-update upgrade clean optimise
|
||||||
|
@date
|
||||||
munin:
|
|
||||||
pushd /var/www/munin/ ; python -m SimpleHTTPServer 8000
|
|
||||||
|
|
||||||
optimise:
|
optimise:
|
||||||
nix-store --optimise
|
nix-store --optimise
|
||||||
|
|
||||||
push: submodules-push
|
|
||||||
git push --all
|
|
||||||
git push --tags
|
|
||||||
|
|
||||||
rebuild-switch:
|
rebuild-switch:
|
||||||
nixos-rebuild switch --fallback --show-trace
|
nixos-rebuild switch --fallback --show-trace
|
||||||
|
|
||||||
store-repair:
|
store-repair:
|
||||||
nix-store --verify --check-contents --repair
|
nix-store --verify --check-contents --repair
|
||||||
|
|
||||||
|
upgrade:
|
||||||
|
nixos-rebuild switch --upgrade --fallback --show-trace
|
||||||
|
|
||||||
|
##--------- Commandes spécifiques pour GIT
|
||||||
|
|
||||||
|
push: submodules-push
|
||||||
|
git push --all
|
||||||
|
git push --tags
|
||||||
|
|
||||||
submodules-update:
|
submodules-update:
|
||||||
#git submodule update --remote
|
#git submodule update --remote
|
||||||
git submodule foreach git co master
|
git submodule foreach git co master
|
||||||
@@ -49,6 +53,21 @@ template:
|
|||||||
tag: submodules-tag
|
tag: submodules-tag
|
||||||
git tag -f "$$(date +%F)-$$(hostname -s)"
|
git tag -f "$$(date +%F)-$$(hostname -s)"
|
||||||
|
|
||||||
upgrade:
|
##--------- Munin
|
||||||
nixos-rebuild switch --upgrade --fallback --show-trace
|
|
||||||
|
munin:
|
||||||
|
pushd /var/www/munin/ ; python -m SimpleHTTPServer 8000
|
||||||
|
##--------- Gestion d'un système de fichier monté en mémoire
|
||||||
|
|
||||||
|
tmpfs-create:
|
||||||
|
mkdir -p /mnt/tmpfs
|
||||||
|
|
||||||
|
tmpfs-mount: tmpfs-create
|
||||||
|
mount -t tmpfs -o size=10G tmpfs /mnt/tmpfs
|
||||||
|
|
||||||
|
tmpfs-umount:
|
||||||
|
umount /mnt/tmpfs
|
||||||
|
|
||||||
|
tmpfs-destroy: tmpfs-umount
|
||||||
|
rmdir /mnt/tmpfs
|
||||||
|
|
||||||
|
|||||||
11
README
11
README
@@ -1,11 +0,0 @@
|
|||||||
# 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
|
|
||||||
|
|
||||||
* https://nixos.org/wiki/How_to_install_NixOS_from_Linux#Installing_through_a_chroot
|
|
||||||
* https://github.com/NixOS/nixpkgs/issues/13305
|
|
||||||
41
README.md
Normal file
41
README.md
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
# 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
|
||||||
|
|
||||||
|
* 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
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ mkIf cfg.nix-serve-client {
|
|||||||
(mkIf (profiles.isDubronetwork && (! computers.isPedro) && (! computers.isRollo)) "http://nix-cache.dubronetwork.fr:5001")
|
(mkIf (profiles.isDubronetwork && (! computers.isPedro) && (! computers.isRollo)) "http://nix-cache.dubronetwork.fr:5001")
|
||||||
|
|
||||||
(mkIf profiles.isPrunetwork "https://cache.nixos.org/")
|
(mkIf profiles.isPrunetwork "https://cache.nixos.org/")
|
||||||
(mkIf (profiles.isPrunetwork && !profiles.isServer) "http://192.168.1.20:5000")
|
(mkIf (profiles.isPrunetwork && !profiles.isServer) "http://nix-cache.dubronetwork.fr:5001")
|
||||||
];
|
];
|
||||||
extraOptions = ''
|
extraOptions = ''
|
||||||
connect-timeout = 5
|
connect-timeout = 5
|
||||||
|
|||||||
@@ -13,6 +13,14 @@ in
|
|||||||
mkIf cfg.fail2ban {
|
mkIf cfg.fail2ban {
|
||||||
|
|
||||||
# Gestion de fail2ban
|
# Gestion de fail2ban
|
||||||
|
|
||||||
|
# Paquets
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
mailutils
|
||||||
|
whois
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
# Services
|
# Services
|
||||||
services = {
|
services = {
|
||||||
fail2ban = {
|
fail2ban = {
|
||||||
@@ -30,13 +38,27 @@ mkIf cfg.fail2ban {
|
|||||||
maxretry = 3
|
maxretry = 3
|
||||||
|
|
||||||
destemail = ${destemail}
|
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 = ''
|
ssh-route = ''
|
||||||
filter = sshd
|
filter = sshd
|
||||||
action = route[blocktype=blackhole]
|
action = route[blocktype=blackhole]
|
||||||
maxretry = 3
|
|
||||||
'';
|
'';
|
||||||
|
# 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";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ in {
|
|||||||
|
|
||||||
users.extraUsers.root = {
|
users.extraUsers.root = {
|
||||||
openssh.authorizedKeys.keys = [
|
openssh.authorizedKeys.keys = [
|
||||||
|
mbpJPierre03
|
||||||
radxJPierre03
|
radxJPierre03
|
||||||
radxRoot
|
radxRoot
|
||||||
phenomTaeradan
|
phenomTaeradan
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ in
|
|||||||
edition-photo = mkEnableOption "Profil pour la création/édition de photos.";
|
edition-photo = mkEnableOption "Profil pour la création/édition de photos.";
|
||||||
edition-video = mkEnableOption "Profil pour la création/édition de video.";
|
edition-video = mkEnableOption "Profil pour la création/édition de video.";
|
||||||
fail2ban = mkEnableOption "Profil pour activer Fail2ban.";
|
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.";
|
||||||
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.";
|
||||||
@@ -53,10 +55,27 @@ in
|
|||||||
online-ipv6 = mkEnableOption "Profil pour activer l'IPv6 de online.net";
|
online-ipv6 = mkEnableOption "Profil pour activer l'IPv6 de online.net";
|
||||||
print = mkEnableOption "Profil pour activer cups & pouvoir imprimer.";
|
print = mkEnableOption "Profil pour activer cups & pouvoir imprimer.";
|
||||||
rabbitmq = mkEnableOption "Profil pour activer le service de messagerie AMQP.";
|
rabbitmq = mkEnableOption "Profil pour activer le service de messagerie AMQP.";
|
||||||
|
radicale = mkEnableOption "Profil pour activer le service d'hébergement de calendrier + tâches & contacts.";
|
||||||
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.";
|
||||||
znc = mkEnableOption "Profil pour activer le relais IRC ZNC.";
|
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
|
#* Utilisé pour avoir des raccourcis de machine
|
||||||
r6d.computers = {
|
r6d.computers = {
|
||||||
@@ -106,7 +125,7 @@ in
|
|||||||
(mkIf pfl.isHome {
|
(mkIf pfl.isHome {
|
||||||
r6d.profiles.isDesktop = true;
|
r6d.profiles.isDesktop = true;
|
||||||
})
|
})
|
||||||
(mkIf pfl.isServer {
|
(mkIf (pfl.isServer && !comp.isMonstre) {
|
||||||
r6d.config-generator = {
|
r6d.config-generator = {
|
||||||
#database_postgres = true;
|
#database_postgres = true;
|
||||||
dns_autorite = true;
|
dns_autorite = true;
|
||||||
@@ -118,7 +137,7 @@ in
|
|||||||
};
|
};
|
||||||
})
|
})
|
||||||
# /!\ PAS un serveur
|
# /!\ PAS un serveur
|
||||||
(mkIf (!pfl.isServer) {
|
(mkIf (!pfl.isServer || comp.isMonstre) {
|
||||||
r6d.config-generator = {
|
r6d.config-generator = {
|
||||||
dns_resolveur = true;
|
dns_resolveur = true;
|
||||||
};
|
};
|
||||||
@@ -171,6 +190,7 @@ in
|
|||||||
|
|
||||||
r6d.config-generator = {
|
r6d.config-generator = {
|
||||||
docker = true;
|
docker = true;
|
||||||
|
radicale = true;
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
(mkIf comp.isRadx {
|
(mkIf comp.isRadx {
|
||||||
@@ -181,6 +201,9 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
r6d.config-generator = {
|
r6d.config-generator = {
|
||||||
|
hydra-builder = true;
|
||||||
|
hydra-core = true;
|
||||||
|
print = true;
|
||||||
virtualbox = true;
|
virtualbox = true;
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
@@ -200,6 +223,8 @@ in
|
|||||||
|
|
||||||
r6d.config-generator = {
|
r6d.config-generator = {
|
||||||
laptop = true;
|
laptop = true;
|
||||||
|
tincAddress = "192.168.12.2/24";
|
||||||
|
tincExtraConfig = "ConnectTo = phenom_dubronetwork_fr";
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
(mkIf comp.isMonstre {
|
(mkIf comp.isMonstre {
|
||||||
@@ -251,6 +276,9 @@ in
|
|||||||
|
|
||||||
r6d.config-generator = {
|
r6d.config-generator = {
|
||||||
nix-serve-server = true;
|
nix-serve-server = true;
|
||||||
|
laptop = true;
|
||||||
|
edition-photo = true;
|
||||||
|
tincAddress = "192.168.12.1/24";
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
(mkIf comp.isRollo {
|
(mkIf comp.isRollo {
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.r6d.config-generator;
|
cfg = config.r6d.config-generator;
|
||||||
computers = config.r6d.computers;
|
computers = config.r6d.computers;
|
||||||
profiles = config.r6d.profiles;
|
profiles = config.r6d.profiles;
|
||||||
mkIf = pkgs.lib.mkIf;
|
mkIf = lib.mkIf;
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -55,4 +55,6 @@ in
|
|||||||
clawsMail = pkgs.clawsMail.override { enablePluginFancy = true; };
|
clawsMail = pkgs.clawsMail.override { enablePluginFancy = true; };
|
||||||
mumble = pkgs.mumble.override { pulseSupport = true; };
|
mumble = pkgs.mumble.override { pulseSupport = true; };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
security.setuidPrograms = [ "udevil" ];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,9 @@ mkIf true {
|
|||||||
|
|
||||||
## Exploitation FS
|
## Exploitation FS
|
||||||
inotify-tools # être notifié lorsque le contenu d'un répertoire change
|
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
|
rdfind # recherche de fichiers doublons pour remplacement par hard/soft link
|
||||||
|
|
||||||
(mkIf profiles.isDesktop
|
(mkIf profiles.isDesktop
|
||||||
## Gestion de FS
|
## Gestion de FS
|
||||||
gparted # Gestion graphique de partitions
|
gparted # Gestion graphique de partitions
|
||||||
@@ -46,6 +48,5 @@ mkIf true {
|
|||||||
(mkIf profiles.isDesktop
|
(mkIf profiles.isDesktop
|
||||||
unetbootin # création de clefs USB bootables
|
unetbootin # création de clefs USB bootables
|
||||||
)
|
)
|
||||||
#
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,8 +35,9 @@ mkIf profiles.isDesktop {
|
|||||||
gnuplot # générateur de graphes à partir de données numériques
|
gnuplot # générateur de graphes à partir de données numériques
|
||||||
graphviz # dot, neato : traçage de graphes (carré, rond)
|
graphviz # dot, neato : traçage de graphes (carré, rond)
|
||||||
jekyll # générateur statique de site web
|
jekyll # générateur statique de site web
|
||||||
|
odpdown # conversion md -> presentation ODP : https://github.com/thorstenb/odpdown
|
||||||
pandoc
|
pandoc
|
||||||
texLiveFull # distribution LaTeX
|
texlive.combined.scheme-full # distribution LaTeX
|
||||||
#texLive # distribution LaTeX de base
|
#texLive # distribution LaTeX de base
|
||||||
#texLiveBeamer # paquets et extensions pour Beamer
|
#texLiveBeamer # paquets et extensions pour Beamer
|
||||||
#texLiveModerncv # paquets pour la classe Modern CV
|
#texLiveModerncv # paquets pour la classe Modern CV
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ environment.systemPackages = with pkgs; [
|
|||||||
## Mail & Discussion (texte, audio)
|
## Mail & Discussion (texte, audio)
|
||||||
clawsMail
|
clawsMail
|
||||||
hexchat
|
hexchat
|
||||||
kde5.quasselClient
|
quasselClient
|
||||||
mumble
|
mumble
|
||||||
mutt
|
mutt
|
||||||
pidgin
|
pidgin
|
||||||
|
|||||||
@@ -12,34 +12,37 @@ mkIf cfg.developpement {
|
|||||||
# Paquets
|
# Paquets
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
# Base de données
|
# Base de données
|
||||||
pgadmin
|
pgadmin # interface d'administration de postgres
|
||||||
sqlitebrowser
|
sqlitebrowser # interface d'administration de sqlite
|
||||||
|
|
||||||
# Développement
|
# Développement
|
||||||
cloc
|
cloc
|
||||||
idea.idea-community
|
idea.idea-community # IntelliJ IDEA
|
||||||
gcc # pour les appels depuis les scripts
|
gcc # pour les appels depuis les scripts
|
||||||
|
|
||||||
# Documentation
|
# Documentation
|
||||||
zeal
|
zeal # consulter la documentation hors ligne
|
||||||
|
|
||||||
## Gestion des sources
|
## Gestion des sources
|
||||||
# git # déjà présent dans "base"
|
# git # déjà présent dans "base"
|
||||||
git-cola
|
# gitg # interface pour utiliser git (historique, commit)
|
||||||
|
gitstats # génère un site web statique avec des statistiques
|
||||||
|
gitAndTools.gitFull # pour gitk
|
||||||
|
git-cola # interface pour utiliser git (historique, commit)
|
||||||
mercurial
|
mercurial
|
||||||
subversion
|
subversion
|
||||||
|
|
||||||
## Haskell
|
## Haskell
|
||||||
ghc
|
ghc # pour les appels depuis les scripts
|
||||||
stack
|
stack
|
||||||
|
|
||||||
## Rust
|
## Rust
|
||||||
cargo # récupération des dépendances + compilation projet rust
|
cargo # récupération des dépendances + compilation projet rust
|
||||||
rustPlatform.rustc
|
rustc # pour les appels depuis les scripts
|
||||||
|
|
||||||
## Visualisation & outils de diff
|
## Visualisation & outils de diff
|
||||||
gource
|
gource # visualisation en mouvement de l'historique git
|
||||||
meld
|
meld # outil de comparaison graphique
|
||||||
vbindiff # diff de fichier hexadecimaux avec vim
|
vbindiff # diff de fichier hexadecimaux avec vim
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ let
|
|||||||
profiles = config.r6d.profiles;
|
profiles = config.r6d.profiles;
|
||||||
in
|
in
|
||||||
|
|
||||||
mkIf profiles.isDesktop {
|
mkIf true {
|
||||||
|
#mkIf profiles.isDesktop {
|
||||||
|
|
||||||
# Paquets
|
# Paquets
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
@@ -19,7 +20,7 @@ mkIf profiles.isDesktop {
|
|||||||
|
|
||||||
## Diagnostic
|
## Diagnostic
|
||||||
arp-scan
|
arp-scan
|
||||||
wireshark
|
#wireshark
|
||||||
whois
|
whois
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -18,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
|
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
|
yubikey-personalization-gui # utilisation de la clef Yubikey
|
||||||
];
|
];
|
||||||
|
security.setuidPrograms = [ "slock" ];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,5 +15,13 @@ mkIf cfg.virtualbox {
|
|||||||
linuxPackages.virtualboxGuestAdditions
|
linuxPackages.virtualboxGuestAdditions
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# À décommenter pour activer le pack d'extension
|
||||||
|
#boot.kernelPackages = pkgs.linuxPackages // {
|
||||||
|
# virtualbox = pkgs.linuxPackages.virtualbox.override {
|
||||||
|
# enableExtensionPack = true;
|
||||||
|
# pulseSupport = true;
|
||||||
|
# };
|
||||||
|
#};
|
||||||
|
|
||||||
virtualisation.virtualbox.host.enable = true;
|
virtualisation.virtualbox.host.enable = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,11 +12,20 @@ in
|
|||||||
nix.buildCores = 0;
|
nix.buildCores = 0;
|
||||||
|
|
||||||
# The NixOS release to be compatible with for stateful data such as databases.
|
# 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
|
# On autorise les paquets non-libres
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
|
# Lancement de dbus pour les utilisateurs
|
||||||
|
services.dbus.socketActivated = true;
|
||||||
|
|
||||||
|
# NixOS Hardening
|
||||||
|
#security.grsecurity.enable = true;
|
||||||
|
|
||||||
# Paquets
|
# Paquets
|
||||||
environment = {
|
environment = {
|
||||||
systemPackages = with pkgs; [
|
systemPackages = with pkgs; [
|
||||||
@@ -36,6 +45,8 @@ in
|
|||||||
p7zip # compression de fichier
|
p7zip # compression de fichier
|
||||||
parted # partitionnement de disque
|
parted # partitionnement de disque
|
||||||
pciutils
|
pciutils
|
||||||
|
pinentry # pour taper les mots de passe gpg
|
||||||
|
psmisc # fournis les utilitaires comme killall, fuser, pstree
|
||||||
python # python -- python -m SimpleHTTPServer 8000
|
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
|
||||||
@@ -49,6 +60,8 @@ in
|
|||||||
];
|
];
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
byobu = "byobu-tmux";
|
byobu = "byobu-tmux";
|
||||||
|
gpg = "gpg2";
|
||||||
|
jacques-a-dit = "sudo";
|
||||||
tree = "tree -C";
|
tree = "tree -C";
|
||||||
tree1 = "tree -d -L 1";
|
tree1 = "tree -d -L 1";
|
||||||
tree2 = "tree -d -L 2";
|
tree2 = "tree -d -L 2";
|
||||||
@@ -58,6 +71,10 @@ in
|
|||||||
};
|
};
|
||||||
etc.gitconfig.text = builtins.readFile ./gitconfig;
|
etc.gitconfig.text = builtins.readFile ./gitconfig;
|
||||||
};
|
};
|
||||||
|
# programmes qui n'ont pas besoin de sudo pour fonctionner
|
||||||
|
security.setuidPrograms = [
|
||||||
|
"mtr"
|
||||||
|
];
|
||||||
programs.bash = {
|
programs.bash = {
|
||||||
enableCompletion = true;
|
enableCompletion = true;
|
||||||
promptInit = builtins.readFile ./bash-prompt.sh;
|
promptInit = builtins.readFile ./bash-prompt.sh;
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ mkIf cfg.laptop {
|
|||||||
|
|
||||||
# Paquets
|
# Paquets
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
networkmanagerapplet
|
networkmanagerapplet # gestionnaire réseau graphique + console (nm-applet + nmtui)
|
||||||
|
wirelesstools # fournis iwconfig
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
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}
|
||||||
|
'';
|
||||||
|
}
|
||||||
@@ -12,7 +12,9 @@ in
|
|||||||
# installées systématiquement
|
# installées systématiquement
|
||||||
./environment.nix
|
./environment.nix
|
||||||
./localisation.nix
|
./localisation.nix
|
||||||
|
./network.nix
|
||||||
#./network-ipv6.nix
|
#./network-ipv6.nix
|
||||||
|
./sudo.nix
|
||||||
./service-haveged.nix
|
./service-haveged.nix
|
||||||
./service-monitoring.nix
|
./service-monitoring.nix
|
||||||
./service-ssh.nix
|
./service-ssh.nix
|
||||||
@@ -32,6 +34,8 @@ in
|
|||||||
./auto-upgrade.nix # mise à jour automatique du système
|
./auto-upgrade.nix # mise à jour automatique du système
|
||||||
./laptop.nix # appli & configuration adaptée pour un PC portable
|
./laptop.nix # appli & configuration adaptée pour un PC portable
|
||||||
./print.nix # configuration de base de cups
|
./print.nix # configuration de base de cups
|
||||||
|
./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-laptop.nix # services spécifiques aux pc portables
|
./service-laptop.nix # services spécifiques aux pc portables
|
||||||
./service-locate.nix # service locate
|
./service-locate.nix # service locate
|
||||||
./swap.nix # définition de l'utilisation du swap
|
./swap.nix # définition de l'utilisation du swap
|
||||||
|
|||||||
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"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
60
public/service-hydra-core.nix
Normal file
60
public/service-hydra-core.nix
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
{ 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; [
|
||||||
|
];
|
||||||
|
|
||||||
|
# Services
|
||||||
|
|
||||||
|
## Hydra
|
||||||
|
# 2. créer un utilisateur pour gérer hydra
|
||||||
|
# su - hydra
|
||||||
|
# hydra-create-user jpierre03 --password xxx --role 'admin'
|
||||||
|
|
||||||
|
services.hydra = {
|
||||||
|
enable = true;
|
||||||
|
hydraURL = "http://hydra.${config.networking.hostName}";
|
||||||
|
notificationSender = "hydra@${config.networking.hostName}";
|
||||||
|
listenHost = "localhost";
|
||||||
|
minimumDiskFree = 50; # Go
|
||||||
|
};
|
||||||
|
|
||||||
|
## Ménage
|
||||||
|
#nix.gc.automatic = true;
|
||||||
|
|
||||||
|
## Délégation des actions de compilation à la compilefarm
|
||||||
|
|
||||||
|
### Machines connues
|
||||||
|
# 2. récupérer la clef publique du serveur ssh : ssh-keyscan localhost + l'ajouter dans les knownHosts
|
||||||
|
|
||||||
|
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";
|
||||||
|
};
|
||||||
|
|
||||||
|
# une fois installé :
|
||||||
|
# 1. créer chef SSH : ssh-keygen -C "hydra@pedro.dubronetwork.fr" -N "" -f /etc/nixos/id_buildfarm
|
||||||
|
# ssh-keygen -t ed25519 -C "hydra MACHINE" -f /etc/nixos/hydra-ssh-key
|
||||||
|
# accessible à hydra.pedro.dubnronetwork.fr
|
||||||
|
|
||||||
|
nix = {
|
||||||
|
distributedBuilds = true;
|
||||||
|
buildMachines = [
|
||||||
|
# { hostName = "pedro.dubronetwork.fr"; maxJobs = 2; speedFactor = 10; sshKey = "/etc/nixos/id_buildfarm"; sshUser = "root"; system = "x86_64-linux"; }
|
||||||
|
];
|
||||||
|
extraOptions = "auto-optimise-store = true";
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
@@ -14,6 +14,7 @@ mkIf true {
|
|||||||
services.openssh = {
|
services.openssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
# https://wiki.mozilla.org/Security/Guidelines/OpenSSH#Modern_.28OpenSSH_6.7.2B.29
|
# https://wiki.mozilla.org/Security/Guidelines/OpenSSH#Modern_.28OpenSSH_6.7.2B.29
|
||||||
|
# http://www.cyberciti.biz/tips/linux-unix-bsd-openssh-server-best-practices.html
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256
|
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
|
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
|
||||||
|
|||||||
@@ -12,13 +12,11 @@ mkIf profiles.isDesktop {
|
|||||||
# Services
|
# Services
|
||||||
# Enable the X11 windowing system.
|
# Enable the X11 windowing system.
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
enable = true;
|
#enable = true;
|
||||||
layout = "fr";
|
layout = "fr";
|
||||||
xkbOptions = "eurosign:e";
|
xkbOptions = "eurosign:e";
|
||||||
displayManager.lightdm.enable = true;
|
displayManager.lightdm.enable = true;
|
||||||
windowManager.awesome.enable = true;
|
windowManager.awesome.enable = true;
|
||||||
startGnuPGAgent = true;
|
|
||||||
startOpenSSHAgent = false; # pas compatible avec l'agent GnuPG
|
|
||||||
inputClassSections = [''
|
inputClassSections = [''
|
||||||
Identifier "Marble Mouse"
|
Identifier "Marble Mouse"
|
||||||
MatchProduct "Logitech USB Trackball"
|
MatchProduct "Logitech USB Trackball"
|
||||||
|
|||||||
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
|
||||||
|
'';
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user