Compare commits
21 Commits
2016-08-15
...
2016-09-15
| Author | SHA1 | Date | |
|---|---|---|---|
| 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
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ in
|
|||||||
(mkIf pfl.isHome {
|
(mkIf pfl.isHome {
|
||||||
r6d.profiles.isDesktop = true;
|
r6d.profiles.isDesktop = true;
|
||||||
})
|
})
|
||||||
(mkIf pfl.isServer {
|
(mkIf (pfl.isServer && !comp.isMonstre) {
|
||||||
r6d.config-generator = {
|
r6d.config-generator = {
|
||||||
#database_postgres = true;
|
#database_postgres = true;
|
||||||
dns_autorite = true;
|
dns_autorite = true;
|
||||||
@@ -118,7 +118,7 @@ in
|
|||||||
};
|
};
|
||||||
})
|
})
|
||||||
# /!\ PAS un serveur
|
# /!\ PAS un serveur
|
||||||
(mkIf (!pfl.isServer) {
|
(mkIf (!pfl.isServer || comp.isMonstre) {
|
||||||
r6d.config-generator = {
|
r6d.config-generator = {
|
||||||
dns_resolveur = true;
|
dns_resolveur = true;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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,6 +35,7 @@ mkIf profiles.isDesktop {
|
|||||||
gnuplot # générateur de graphes à partir de données numériques
|
gnuplot # générateur de graphes à partir de données numériques
|
||||||
graphviz # dot, neato : traçage de graphes (carré, rond)
|
graphviz # dot, neato : traçage de graphes (carré, rond)
|
||||||
jekyll # générateur statique de site web
|
jekyll # générateur statique de site web
|
||||||
|
odpdown # conversion md -> presentation ODP : https://github.com/thorstenb/odpdown
|
||||||
pandoc
|
pandoc
|
||||||
texLiveFull # distribution LaTeX
|
texLiveFull # distribution LaTeX
|
||||||
#texLive # distribution LaTeX de base
|
#texLive # distribution LaTeX de base
|
||||||
|
|||||||
@@ -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
|
rustPlatform.rustc # pour les appels depuis les scripts
|
||||||
|
|
||||||
## Visualisation & outils de diff
|
## Visualisation & outils de diff
|
||||||
gource
|
gource # visualisation en mouvement de l'historique git
|
||||||
meld
|
meld # outil de comparaison graphique
|
||||||
vbindiff # diff de fichier hexadecimaux avec vim
|
vbindiff # diff de fichier hexadecimaux avec vim
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ in
|
|||||||
];
|
];
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
byobu = "byobu-tmux";
|
byobu = "byobu-tmux";
|
||||||
|
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 +59,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;
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ in
|
|||||||
./environment.nix
|
./environment.nix
|
||||||
./localisation.nix
|
./localisation.nix
|
||||||
#./network-ipv6.nix
|
#./network-ipv6.nix
|
||||||
|
./sudo.nix
|
||||||
./service-haveged.nix
|
./service-haveged.nix
|
||||||
./service-monitoring.nix
|
./service-monitoring.nix
|
||||||
./service-ssh.nix
|
./service-ssh.nix
|
||||||
|
|||||||
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