Compare commits
12 Commits
2016-07-18
...
2016-07-21
| Author | SHA1 | Date | |
|---|---|---|---|
| 20e8e8beaa | |||
| 66252cb498 | |||
| 906ae9b7d1 | |||
| 2195033ee5 | |||
| becd37ba28 | |||
| f55ae85a66 | |||
| cd458f24a7 | |||
| 86c46a97de | |||
| b2619291a7 | |||
| 5350372774 | |||
|
|
3d1a7d2161 | ||
|
|
111f33ff3d |
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
@@ -17,7 +17,9 @@ in
|
||||
./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
|
||||
@@ -46,10 +48,12 @@ in
|
||||
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-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 = {
|
||||
@@ -57,6 +61,7 @@ in
|
||||
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.";
|
||||
@@ -75,6 +80,7 @@ in
|
||||
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";
|
||||
@@ -86,6 +92,7 @@ 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;
|
||||
@@ -101,6 +108,7 @@ in
|
||||
(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;
|
||||
@@ -114,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;
|
||||
@@ -142,6 +153,7 @@ in
|
||||
|
||||
r6d.config-generator = {
|
||||
laptop = true;
|
||||
xmonad = true;
|
||||
};
|
||||
})
|
||||
(mkIf comp.isMonstre {
|
||||
@@ -171,6 +183,7 @@ in
|
||||
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