Compare commits
15 Commits
2016-07-15
...
2016-07-21
| Author | SHA1 | Date | |
|---|---|---|---|
| 20e8e8beaa | |||
| 66252cb498 | |||
| 906ae9b7d1 | |||
| 2195033ee5 | |||
| becd37ba28 | |||
| f55ae85a66 | |||
| cd458f24a7 | |||
| 86c46a97de | |||
| b2619291a7 | |||
| 5350372774 | |||
|
|
3d1a7d2161 | ||
|
|
111f33ff3d | ||
| 28f65522ae | |||
|
|
b7f05e47ac | ||
|
|
350b62aef2 |
5
README
Normal file
5
README
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
# 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
|
||||
@@ -12,7 +12,11 @@ in {
|
||||
(mkIf (profiles.isDubronetwork && (! computers.isMonstre)) "http://192.168.10.169:5000")
|
||||
(mkIf profiles.isDubronetwork "http://192.168.10.252:5000")
|
||||
|
||||
(mkIf profiles.isPrunetwork "http://192.168.1.20:5000")
|
||||
(mkIf (profiles.isPrunetwork && !profiles.isServer) "http://192.168.1.20:5000")
|
||||
];
|
||||
};
|
||||
}
|
||||
extraOptions = ''
|
||||
connect-timeout = 5
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
11
activation-manuelle/print.nix
Normal file
11
activation-manuelle/print.nix
Normal file
@@ -0,0 +1,11 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Enable CUPS to print documents.
|
||||
services.printing = pkgs.lib.mkIf config.r6d.config-generator.print {
|
||||
enable = true;
|
||||
drivers = [
|
||||
pkgs.samsung-unified-linux-driver
|
||||
];
|
||||
};
|
||||
}
|
||||
26
activation-manuelle/users.nix
Normal file
26
activation-manuelle/users.nix
Normal file
File diff suppressed because one or more lines are too long
@@ -9,69 +9,78 @@ 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/swap.nix
|
||||
];
|
||||
{
|
||||
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
|
||||
###### interface
|
||||
|
||||
options = {
|
||||
options = {
|
||||
|
||||
#* Utilisé pour afecter des capacités aux machines
|
||||
r6d.profiles = {
|
||||
# Domaine
|
||||
isDubronetwork = mkEnableOption "Pour distinguer les machines dubronetwork.";
|
||||
isPrunetwork = mkEnableOption "Pour distinguer les machines prunetwork.";
|
||||
# Utilisation machine
|
||||
isDesktop = mkEnableOption "Pour indiquer une machine avec interface graphique.";
|
||||
isHome = mkEnableOption "Pour indiquer que la machine sert à la maison (divertissement & autre).";
|
||||
isServer = mkEnableOption "Pour indiquer qu'il s'agit d'un serveur.";
|
||||
isWorkstation = mkEnableOption "Pour indiquer que la machine sert à travailler.";
|
||||
#* Utilisé pour afecter des capacités aux machines
|
||||
r6d.profiles = {
|
||||
# Domaine
|
||||
isDubronetwork = mkEnableOption "Pour distinguer les machines dubronetwork.";
|
||||
isPrunetwork = mkEnableOption "Pour distinguer les machines prunetwork.";
|
||||
# Utilisation machine
|
||||
isDesktop = mkEnableOption "Pour indiquer une machine avec interface graphique.";
|
||||
isHome = mkEnableOption "Pour indiquer que la machine sert à la maison (divertissement & autre).";
|
||||
isServer = mkEnableOption "Pour indiquer qu'il s'agit d'un serveur.";
|
||||
isWorkstation = mkEnableOption "Pour indiquer que la machine sert à travailler.";
|
||||
};
|
||||
|
||||
#* Utilisé dans les fichiers .nix
|
||||
r6d.config-generator = {
|
||||
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.";
|
||||
docker = mkEnableOption "Profil pour l'utilisation de Docker.";
|
||||
fail2ban = mkEnableOption "Profil pour activer Fail2ban.";
|
||||
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.";
|
||||
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.";
|
||||
print = mkEnableOption "Profil pour activer cups & pouvoir imprimer.";
|
||||
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.";
|
||||
};
|
||||
#* Utilisé pour avoir des raccourcis de machine
|
||||
r6d.computers = {
|
||||
isLatitude = mkEnableOption "Identification du nom de machine.";
|
||||
isMonstre = mkEnableOption "Identification du nom de machine.";
|
||||
isNeoNomade = mkEnableOption "Identification du nom de machine.";
|
||||
isNomade = mkEnableOption "Identification du nom de machine.";
|
||||
isOcean = mkEnableOption "Identification du nom de machine.";
|
||||
isPhenom = mkEnableOption "Identification du nom de machine.";
|
||||
isRadx = mkEnableOption "Identification du nom de machine.";
|
||||
isXray = mkEnableOption "Identification du nom de machine.";
|
||||
};
|
||||
};
|
||||
|
||||
#* Utilisé dans les fichiers .nix
|
||||
r6d.config-generator = {
|
||||
enable = mkEnableOption "Génération de la configuration d'une machine.";
|
||||
auto-upgrade = mkEnableOption "Profil pour activer les mises à jour automatiques.";
|
||||
docker = mkEnableOption "Profil pour l'utilisation de Docker.";
|
||||
fail2ban = mkEnableOption "Profil pour activer Fail2ban.";
|
||||
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.";
|
||||
nix-serve-client= mkEnableOption "Profil pour que la machine soit un serveur de cache nix.";
|
||||
nix-serve-server= mkEnableOption "Profil pour que la machine soit un serveur de cache nix.";
|
||||
swap = mkEnableOption "Profil pour que le swap soit activé.";
|
||||
virtualbox = mkEnableOption "Profil pour l'utilisation de VirtualBox.";
|
||||
};
|
||||
#* Utilisé pour avoir des raccourcis de machine
|
||||
r6d.computers = {
|
||||
isLatitude = mkEnableOption "Identification du nom de machine.";
|
||||
isMonstre = mkEnableOption "Identification du nom de machine.";
|
||||
isNeoNomade = mkEnableOption "Identification du nom de machine.";
|
||||
isPhenom = mkEnableOption "Identification du nom de machine.";
|
||||
isRadx = mkEnableOption "Identification du nom de machine.";
|
||||
isXray = mkEnableOption "Identification du nom de machine.";
|
||||
};
|
||||
};
|
||||
|
||||
###### implementation
|
||||
# https://nixos.org/releases/nixos/14.12-small/nixos-14.12.374.61adf9e/manual/sec-writing-modules.html
|
||||
# https://nixos.org/wiki/NixOS:extend_NixOS
|
||||
config = mkMerge
|
||||
[ # Unconditional stuff.
|
||||
###### implementation
|
||||
# https://nixos.org/releases/nixos/14.12-small/nixos-14.12.374.61adf9e/manual/sec-writing-modules.html
|
||||
# https://nixos.org/wiki/NixOS:extend_NixOS
|
||||
config = mkMerge
|
||||
[ # Unconditional stuff.
|
||||
{
|
||||
r6d.config-generator.enable = true;
|
||||
r6d.computers = {
|
||||
isLatitude = host == "latitude.dubronetwork.fr";
|
||||
isMonstre = host == "monstre.dubronetwork.fr";
|
||||
isNeoNomade = host == "neo-nomade.dubronetwork.fr";
|
||||
isNomade = host == "nomade.dubronetwork.fr";
|
||||
isOcean = host == "ocean.prunetwork.fr";
|
||||
isPhenom = host == "phenom.dubronetwork.fr";
|
||||
isRadx = host == "radx.prunetwork.fr";
|
||||
isXray = host == "xray.prunetwork.fr";
|
||||
@@ -82,6 +91,8 @@ in
|
||||
|
||||
## Définition des profils génériques
|
||||
(mkIf pfl.isDesktop {
|
||||
r6d.config-generator.awesome = true;
|
||||
r6d.config-generator.nix-serve-client = true;
|
||||
})
|
||||
(mkIf pfl.isHome {
|
||||
r6d.profiles.isDesktop = true;
|
||||
@@ -91,12 +102,13 @@ in
|
||||
})
|
||||
(mkIf pfl.isWorkstation {
|
||||
r6d.profiles.isDesktop = true;
|
||||
|
||||
|
||||
r6d.config-generator.docker = true;
|
||||
})
|
||||
(mkIf pfl.isDubronetwork {
|
||||
(mkIf pfl.isDubronetwork {
|
||||
r6d.config-generator.auto-upgrade = true;
|
||||
r6d.config-generator.nix-serve-client = true;
|
||||
r6d.config-generator.print = true;
|
||||
})
|
||||
(mkIf (pfl.isDubronetwork && pfl.isHome) {
|
||||
r6d.config-generator.jeux = true;
|
||||
@@ -110,12 +122,15 @@ in
|
||||
(mkIf pfl.isPrunetwork {
|
||||
r6d.config-generator.auto-upgrade = true;
|
||||
r6d.config-generator.fail2ban = true;
|
||||
r6d.config-generator.nix-serve-client = true;
|
||||
r6d.config-generator.swap = true;
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
## Affectation des profils aux machines
|
||||
(mkIf comp.isOcean {
|
||||
r6d.profiles.isPrunetwork = true;
|
||||
r6d.profiles.isServer = true;
|
||||
})
|
||||
(mkIf comp.isRadx {
|
||||
r6d.profiles.isHome = true;
|
||||
r6d.profiles.isPrunetwork = true;
|
||||
@@ -138,9 +153,10 @@ in
|
||||
|
||||
r6d.config-generator = {
|
||||
laptop = true;
|
||||
xmonad = true;
|
||||
};
|
||||
})
|
||||
(mkIf comp.isMonstre {
|
||||
(mkIf comp.isMonstre {
|
||||
r6d.profiles.isDubronetwork = true;
|
||||
r6d.profiles.isServer = true;
|
||||
|
||||
@@ -154,12 +170,20 @@ in
|
||||
laptop = true;
|
||||
};
|
||||
})
|
||||
(mkIf comp.isPhenom {
|
||||
(mkIf comp.isNomade{
|
||||
r6d.profiles.isDubronetwork = true;
|
||||
|
||||
r6d.config-generator = {
|
||||
laptop = true;
|
||||
};
|
||||
})
|
||||
(mkIf comp.isPhenom {
|
||||
r6d.profiles.isDubronetwork = true;
|
||||
r6d.profiles.isHome = true;
|
||||
r6d.profiles.isWorkstation = true;
|
||||
|
||||
r6d.config-generator.nix-serve-server = true;
|
||||
r6d.config-generator.xmonad = true;
|
||||
})
|
||||
];
|
||||
}
|
||||
|
||||
@@ -22,12 +22,14 @@
|
||||
gnupg # GPG
|
||||
gpm # prise en charge de la souris en console
|
||||
htop # monitoring
|
||||
#libressl # librairie pour faire du TLS et les algorithmes de crypto par OpenBSD
|
||||
ncdu # outil pour voir l'espace utilisé
|
||||
nmap # outil de scan de port réseau
|
||||
mtr # outil de diagnostic réseau
|
||||
p7zip # compression de fichier
|
||||
parted # partitionnement de disque
|
||||
pciutils
|
||||
python # python -- python -m SimpleHTTPServer 8000
|
||||
python34Packages.glances # monitoring
|
||||
pwgen # générateur de mot de passe
|
||||
tmux # nécessaire pour byobu
|
||||
@@ -53,4 +55,16 @@
|
||||
promptInit = builtins.readFile ./bash-prompt.sh;
|
||||
interactiveShellInit = builtins.readFile ./bash-interactive-init.sh;
|
||||
};
|
||||
|
||||
# https://wiki.mozilla.org/Security/Guidelines/OpenSSH#Modern
|
||||
programs.ssh.extraConfig = ''
|
||||
# Ensure KnownHosts are unreadable if leaked - it is otherwise easier to know which hosts your keys have access to.
|
||||
HashKnownHosts yes
|
||||
# Host keys the client accepts - order here is honored by OpenSSH
|
||||
HostKeyAlgorithms ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,ssh-rsa,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256
|
||||
|
||||
KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp256,ecdh-sha2-nistp384,diffie-hellman-group-exchange-sha256
|
||||
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com
|
||||
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
|
||||
'';
|
||||
}
|
||||
|
||||
19
services.nix
19
services.nix
@@ -13,14 +13,19 @@
|
||||
## OpenSSH daemon
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
};
|
||||
# https://wiki.mozilla.org/Security/Guidelines/OpenSSH#Modern_.28OpenSSH_6.7.2B.29
|
||||
extraConfig = ''
|
||||
KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256
|
||||
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
|
||||
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com
|
||||
|
||||
# Enable CUPS to print documents.
|
||||
services.printing = {
|
||||
enable = true;
|
||||
drivers = [
|
||||
pkgs.samsung-unified-linux-driver
|
||||
];
|
||||
# LogLevel VERBOSE logs user's key fingerprint on login. Needed to have a clear audit track of which key was using to log in.
|
||||
LogLevel VERBOSE
|
||||
|
||||
# Use kernel sandbox mechanisms where possible in unprivilegied processes
|
||||
# Systrace on OpenBSD, Seccomp on Linux, seatbelt on MacOSX/Darwin, rlimit elsewhere.
|
||||
UsePrivilegeSeparation sandbox
|
||||
'';
|
||||
};
|
||||
|
||||
# Monitoring
|
||||
|
||||
Reference in New Issue
Block a user