nix-infra/config/common/default.nix

68 lines
1.5 KiB
Nix
Raw Normal View History

{ pkgs, ... }:
2023-07-10 15:30:51 +02:00
{
imports = [
2023-07-15 21:34:33 +02:00
./prometheus-node-exporter.nix
./nginx.nix
./openssh.nix
../users/colmena-deploy
../users/yuri
2024-09-10 17:44:41 +02:00
../users/fi
2023-07-10 15:30:51 +02:00
];
time.timeZone = "Europe/Berlin";
i18n.defaultLocale = "en_US.UTF-8";
console = {
keyMap = "de-latin1";
};
security.sudo.wheelNeedsPassword = false;
nix.settings = {
2023-07-13 20:56:30 +02:00
trusted-users = [ "colmena-deploy" ];
2023-07-10 15:30:51 +02:00
auto-optimise-store = true;
experimental-features = [ "nix-command" "flakes" ];
};
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
environment.systemPackages = with pkgs; [
htop
parted
tmux
nano
2023-09-19 00:06:12 +02:00
tcpdump
2023-07-10 15:30:51 +02:00
];
security.acme = {
defaults.email = "acme@grzb.de";
acceptTerms = true;
2023-07-20 06:29:15 +02:00
preliminarySelfsigned = true;
};
# Print the ed25519 public ssh host key to console when booting
systemd.units."print-public-ssh-host-key.service" = {
enable = true;
text = ''
[Unit]
Description=print-public-ssh-host-key.service
Before=getty@tty1.service
After=sshd.service
[Service]
Type=oneshot
ExecStart=/run/current-system/sw/bin/bash -c "/run/current-system/sw/bin/echo -e \"----- ED25519 PUBLIC SSH HOST KEY -----\
\n$(/run/current-system/sw/bin/cut -d ' ' -f 1-2 /etc/ssh/ssh_host_ed25519_key.pub)\""
RemainAfterExit=no
StandardOutput=tty
'';
wantedBy = [ "multi-user.target" ];
};
2023-07-10 15:30:51 +02:00
services.fstrim.enable = true;
}