Files
nixos-template-base/configuration/environment.nix

62 lines
2.6 KiB
Nix
Raw Normal View History

2016-08-12 12:46:36 +02:00
{ config, lib, pkgs, ... }:
let
inherit (lib) mkIf mkMerge mkThenElse;
annuaire = config.r6d.machines;
currentMachine = annuaire."${config.networking.hostName}";
flags = currentMachine.configurationFlags;
2016-08-12 12:46:36 +02:00
in
2016-04-23 12:43:24 +02:00
{
# 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.
2017-11-19 22:09:01 +01:00
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;
2016-06-09 16:31:18 +02:00
# On autorise les paquets non-libres
nixpkgs.config.allowUnfree = true;
2016-10-26 08:32:16 +02:00
# NixOS Hardening
2016-10-28 21:27:00 +02:00
#security.grsecurity.enable = true;
2016-10-26 08:32:16 +02:00
2016-08-12 12:46:36 +02:00
# Paquets
2016-04-23 12:43:24 +02:00
environment = {
shellAliases = {
byobu = "byobu-tmux";
2016-10-25 19:52:45 +02:00
gpg = "gpg2";
jacques-a-dit = "sudo";
2016-04-23 12:43:24 +02:00
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";
2016-04-23 12:43:24 +02:00
grep = "grep --color=auto";
vi = "vim";
byobu-adminsys = "/etc/nixos/base/byobu-adminsys";
2016-04-23 12:43:24 +02:00
};
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
'';
2016-04-23 12:43:24 +02:00
}