nixos-config/modules/baseline.nix

73 lines
1.7 KiB
Nix
Raw Normal View History

2023-12-21 06:38:32 +00:00
{ config, lib, ... }:
2020-09-18 13:54:09 +00:00
{
2023-02-11 02:57:38 +00:00
time.timeZone = "America/New_York";
2021-11-07 01:09:53 +00:00
# the default is all languages. this just shrinks the install size
2021-04-14 14:24:51 +00:00
i18n.supportedLocales = [ "en_US.UTF-8/UTF-8" ];
2020-09-18 13:54:09 +00:00
2023-03-27 15:17:08 +00:00
# makes system evaluation much faster
documentation.nixos.enable = false;
2020-09-24 05:45:48 +00:00
boot = {
zfs.forceImportRoot = false;
2023-05-25 17:16:25 +00:00
initrd.availableKernelModules = [ "nvme" ];
2022-11-21 19:04:04 +00:00
kernelParams = [
"amdgpu.gpu_recovery=1"
"nohibernate"
"panic=99"
2023-05-24 16:49:33 +00:00
"sysctl.vm.overcommit_memory=1"
2022-11-21 19:04:04 +00:00
];
2020-09-24 05:45:48 +00:00
};
2020-09-18 13:54:09 +00:00
2024-12-06 17:57:59 +00:00
nixpkgs.config.allowUnfreePredicate =
pkg:
# builtins.trace "unfree: ${lib.getName pkg}" (
builtins.elem (lib.getName pkg) [
"cuda_cudart"
"libcublas"
"cuda_cccl"
"cuda_nvcc"
"nvidia-x11"
"vscode-with-extensions"
"vscode"
"burpsuite"
"terraform"
"discord"
"steam"
"steam-unwrapped"
"nvidia-settings"
];
2020-09-18 13:54:09 +00:00
2021-10-03 21:29:58 +00:00
security.sudo.extraConfig = "Defaults lecture=never";
2021-11-09 17:20:34 +00:00
systemd.tmpfiles.rules = [ "e /nix/var/log - - - 30d" ];
2020-09-18 13:54:09 +00:00
2024-03-14 16:56:36 +00:00
systemd.oomd.enable = false; # using earlyoom
2021-11-21 18:11:47 +00:00
zramSwap.enable = lib.mkDefault true;
2020-09-18 13:54:09 +00:00
2021-04-04 22:25:13 +00:00
networking.hostId = builtins.substring 0 8 (builtins.hashString "md5" config.networking.hostName);
2021-11-07 01:09:53 +00:00
2022-12-20 23:43:08 +00:00
networking.usePredictableInterfaceNames = lib.mkDefault false;
2021-04-29 16:00:42 +00:00
nix = {
2024-06-10 03:28:59 +00:00
nixPath = [ "nixpkgs=flake:nixpkgs" ];
2021-05-28 20:16:28 +00:00
extraOptions = ''
experimental-features = nix-command flakes
'';
2021-04-29 16:00:42 +00:00
};
2020-09-24 05:45:48 +00:00
services = {
2024-03-14 16:56:36 +00:00
earlyoom.enable = true;
2023-03-27 15:17:08 +00:00
logind.lidSwitch = "ignore";
2022-09-03 02:53:25 +00:00
openssh.enable = true;
2024-08-29 02:58:19 +00:00
openssh.startWhenNeeded = true;
2024-05-27 21:10:14 +00:00
libinput.mouse.middleEmulation = false;
2021-11-12 16:09:04 +00:00
xserver = {
deviceSection = ''
Option "VariableRefresh" "true"
'';
};
2020-09-24 05:45:48 +00:00
};
2020-09-18 13:54:09 +00:00
}