infra/profiles/common.nix

72 lines
1.6 KiB
Nix
Raw Normal View History

2019-08-11 19:53:02 +01:00
{ pkgs, lib, config, ... }:
{
2021-01-21 16:28:48 +01:00
imports = [
./security.nix
2021-02-25 09:08:18 +01:00
../services/telegraf
2021-03-04 09:33:51 +01:00
../services/sshd.nix
2021-02-25 09:05:50 +01:00
./zfs.nix
./users.nix
2021-01-21 16:28:48 +01:00
];
2019-08-11 19:53:02 +01:00
2019-08-12 11:33:34 +02:00
environment.systemPackages = [
# for quick activity overview
pkgs.htop
# for users with TERM=xterm-termite
pkgs.termite.terminfo
];
2019-08-11 19:53:02 +01:00
# Nicer interactive shell
programs.fish.enable = true;
# And for the zsh peeps
programs.zsh.enable = true;
# Entropy gathering daemon
services.haveged.enable = true;
nix =
let asGB = size: toString (size * 1024 * 1024); in
2020-01-22 12:37:13 +01:00
{
binaryCachePublicKeys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
binaryCaches = [
"https://nix-community.cachix.org"
];
2020-01-22 12:37:13 +01:00
extraOptions = ''
# auto-free the /nix/store
min-free = ${asGB 10}
max-free = ${asGB 200}
2019-08-12 11:33:34 +02:00
2020-01-22 12:37:13 +01:00
# avoid copying unecessary stuff over SSH
builders-use-substitutes = true
2020-12-12 16:05:36 +00:00
# allow flakes
experimental-features = nix-command flakes
2020-01-22 12:37:13 +01:00
'';
# Hard-link duplicated files
autoOptimiseStore = true;
2020-12-12 16:05:36 +00:00
# Add support for flakes
package = pkgs.nixUnstable;
2020-01-22 12:37:13 +01:00
};
2019-08-11 19:53:02 +01:00
2021-02-17 23:31:22 +01:00
# Without configuration this unit will fail...
# Just disable it since we are using telegraf to monitor raid health.
systemd.services.mdmonitor.enable = false;
2019-08-12 11:33:34 +02:00
# enable "sar" system activity collection
services.sysstat.enable = true;
2019-08-11 19:53:02 +01:00
# Make debugging failed units easier
systemd.extraConfig = ''
DefaultStandardOutput=journal
DefaultStandardError=journal
'';
# The nix-community is global :)
time.timeZone = "UTC";
}