{ config, lib, pkgs, ... }: let inherit (lib) mkIf mkMerge mkThenElse; annuaire = config.r6d.machines; currentMachine = annuaire."${config.networking.fqdn}"; flags = currentMachine.configurationFlags; 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 = "19.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; # NixOS Hardening #security.grsecurity.enable = true; # Ménage de /tmp au boot boot.cleanTmpDir = true; # Activation des pages de manuel documentation.man.enable = true; # Paquets environment = { shellAliases = { byobu = "byobu-tmux"; gpg = "gpg2"; jacques-a-dit = "sudo"; tree = "tree -C"; tree1 = "tree -d -L 1"; tree2 = "tree -d -L 2"; tree3 = "tree -d -L 3"; # https://gist.github.com/amitchhajer/4461043 : Count number of code lines in git repository per user #git-loc = "git ls-files | while read f; do git blame --line-porcelain "${f}" | grep '^author '; done | sort -f | uniq -ic | sort -n"; grep = "grep --color=auto"; vi = "vim"; byobu-adminsys = "/etc/nixos/base/byobu-adminsys"; }; etc.gitconfig.text = builtins.readFile ./gitconfig; }; programs.bash = { enableCompletion = true; 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-nistp384,ecdh-sha2-nistp256,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 ''; }