You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nixos-template-base/configuration/environment.nix

62 lines
2.6 KiB
Nix

{ config, lib, pkgs, ... }:
let
inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configurationFlags;
in
9 years ago
{
# 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 = "18.03";
# 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;
# Paquets
9 years ago
environment = {
shellAliases = {
byobu = "byobu-tmux";
gpg = "gpg2";
jacques-a-dit = "sudo";
9 years ago
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";
9 years ago
grep = "grep --color=auto";
vi = "vim";
byobu-adminsys = "/etc/nixos/base/byobu-adminsys";
9 years ago
};
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-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
'';
9 years ago
}