infra/modules/nixos/common/default.nix

51 lines
1.1 KiB
Nix
Raw Normal View History

2024-07-24 19:05:26 +10:00
{
config,
inputs,
pkgs,
...
}:
2019-08-11 19:53:02 +01:00
{
2021-01-21 16:28:48 +01:00
imports = [
2024-03-10 09:26:39 +10:00
../../shared/known-hosts.nix
2023-07-29 17:37:07 +10:00
../../shared/nix-daemon.nix
2024-11-21 12:53:07 +10:00
./builder.nix
2021-01-21 16:28:48 +01:00
./security.nix
2022-12-03 12:45:45 +10:00
./sops-nix.nix
2024-05-04 18:51:58 +10:00
./telegraf.nix
2024-08-27 09:26:35 +10:00
./update.nix
./users.nix
2023-05-16 09:53:27 +10:00
inputs.srvos.nixosModules.server
2019-08-12 11:33:34 +02:00
];
# Hard-link duplicated files
nix.settings.auto-optimise-store = true;
nix.optimise.automatic = false;
2023-07-29 17:37:07 +10:00
# Sometimes it fails if a store path is still in use.
# This should fix intermediate issues.
systemd.services.nix-gc.serviceConfig = {
Restart = "on-failure";
};
2024-07-24 19:05:26 +10:00
boot.kernelPackages = pkgs.lib.mkIf (
!config.boot.supportedFilesystems.zfs or false
) pkgs.linuxPackages_latest;
zramSwap.enable = true;
zramSwap.memoryPercent = 100;
2024-09-02 10:05:38 +10:00
# https://github.com/NixOS/nixpkgs/pull/268121
# https://wiki.archlinux.org/title/Zram#Optimizing_swap_on_zram
boot.kernel.sysctl = {
"vm.page-cluster" = 0;
"vm.swappiness" = 180;
"vm.watermark_boost_factor" = 0;
"vm.watermark_scale_factor" = 125;
};
security.acme.defaults.email = "trash@nix-community.org";
2021-03-04 10:55:37 +01:00
security.acme.acceptTerms = true;
2022-08-13 11:13:06 +02:00
networking.domain = "nix-community.org";
2019-08-11 19:53:02 +01:00
}