lor.sh/configuration.nix

81 lines
1.4 KiB
Nix
Raw Normal View History

2023-01-09 13:13:56 +00:00
{ config, pkgs, lib, ... }:
2023-01-09 22:41:09 +00:00
2023-01-09 13:13:56 +00:00
let
secrets = import ./secrets.nix;
in {
imports = [
./hardware-configuration.nix
./mastodon.nix
];
boot.loader = {
efi.canTouchEfiVariables = true;
grub = {
enable = true;
efiSupport = true;
device = "nodev";
mirroredBoots = [{
devices = [ "nodev" ];
path = "/boot-fallback";
}];
};
};
networking = {
hostName = "lor-sh";
hostId = (builtins.substring 0 8 (builtins.readFile "/etc/machine-id"));
useDHCP = false;
interfaces.eno1 = {
ipv4 = secrets.ipv4;
ipv6 = secrets.ipv6;
};
nameservers = [ "1.1.1.1" ];
firewall = {
enable = true;
allowedTCPPorts = [ 80 443 ];
};
};
users.extraUsers.root = {
openssh.authorizedKeys.keys = secrets.pubkeys;
};
services.openssh.enable = true;
environment.systemPackages = with pkgs; [
2023-01-10 14:09:32 +00:00
vim htop git tmux
2023-01-09 13:13:56 +00:00
];
services.postgresql.settings = {
max_connections = "512";
shared_buffers = "4096MB";
2024-09-10 07:22:15 +00:00
max_wal_size = "4096MB";
2023-01-09 13:13:56 +00:00
};
2023-01-09 22:41:09 +00:00
services.zfs = {
autoScrub.enable = true;
trim.enable = true;
};
2023-01-09 13:13:56 +00:00
time.timeZone = "UTC";
system.autoUpgrade = {
enable = true;
allowReboot = true;
};
system.stateVersion = "22.11";
nix = {
optimise.automatic = true;
gc = {
automatic = true;
options = "--delete-older-than 7d";
};
};
}