ark/hosts/tkaronto/default.nix

150 lines
3.2 KiB
Nix
Raw Normal View History

2022-07-18 19:34:54 +03:00
{
config,
lib,
2022-08-14 10:45:17 +03:00
tlib,
2022-07-18 19:34:54 +03:00
pkgs,
inputs,
...
2022-08-14 10:45:17 +03:00
}: {
2022-07-18 19:34:54 +03:00
imports = with inputs;
2022-08-23 08:18:37 +03:00
with nixos-hardware.nixosModules;
[
2023-10-08 09:51:05 +03:00
# vfio.nixosModules.kvmfr
# vfio.nixosModules.virtualisation
# vfio.nixosModules.vfio
# vfio.nixosModules.libvirtd
agenix.nixosModules.default
2022-08-23 08:18:37 +03:00
nixpkgs.nixosModules.notDetected
nixos-persistence.nixosModule
common-pc-ssd
common-pc-laptop
common-gpu-nvidia
common-gpu-amd
common-cpu-amd
2023-09-10 21:40:39 +03:00
common-cpu-amd-pstate
2022-08-23 08:18:37 +03:00
../../users/root
../../users/patriot
]
++ (tlib.importFolder (toString ./modules));
2022-07-18 19:34:54 +03:00
system.persistDir = "/persist";
2022-07-21 01:41:36 +03:00
nix.settings.max-jobs = lib.mkForce 16;
2022-07-18 19:34:54 +03:00
security = {
pam.loginLimits = [
{
domain = "*";
type = "soft";
item = "nofile";
2022-11-27 01:04:43 +03:00
value = "16777216";
2022-07-18 19:34:54 +03:00
}
{
domain = "*";
type = "hard";
item = "nofile";
2022-11-27 01:04:43 +03:00
value = "16777216";
2022-07-18 19:34:54 +03:00
}
];
allowSimultaneousMultithreading = true;
# Deleting root subvolume makes sudo show lecture every boot
sudo.extraConfig = ''
Defaults lecture = never
'';
rtkit.enable = true;
};
sound.enable = false;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
2023-10-08 09:51:05 +03:00
jack.enable = true;
2022-07-18 19:34:54 +03:00
};
2022-10-29 03:24:57 +03:00
hardware.pulseaudio = {
enable = false;
support32Bit = true;
};
2022-07-21 01:41:36 +03:00
services.xserver.videoDrivers = ["nvidia" "amdgpu"];
2022-07-18 19:34:54 +03:00
hardware = {
2024-01-23 02:11:22 +03:00
nvidia = {
package = config.boot.kernelPackages.nvidiaPackages.production;
modesetting.enable = true;
powerManagement.enable = false;
powerManagement.finegrained = true;
open = false;
nvidiaSettings = true;
prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
amdgpuBusId = "PCI:5:0:0";
nvidiaBusId = "PCI:1:0:0";
};
2022-07-21 01:41:36 +03:00
};
2022-07-18 19:34:54 +03:00
opengl = {
driSupport = true;
driSupport32Bit = true;
enable = true;
extraPackages = with pkgs; [
libvdpau-va-gl
vaapiVdpau
libva
vulkan-loader
];
2022-07-30 03:04:32 +03:00
extraPackages32 = with pkgs.pkgsi686Linux; [
libvdpau-va-gl
vaapiVdpau
libva
vulkan-loader
];
2022-07-18 19:34:54 +03:00
};
2022-10-29 03:24:57 +03:00
};
hardware = {
bluetooth.enable = true;
2022-07-18 19:34:54 +03:00
};
2022-07-30 03:04:32 +03:00
2022-07-21 01:41:36 +03:00
programs.light.enable = true;
2022-07-18 19:34:54 +03:00
fonts = {
2023-09-10 21:40:39 +03:00
enableDefaultPackages = true;
2022-07-18 19:34:54 +03:00
fontconfig.enable = true;
2023-09-10 21:40:39 +03:00
packages = [pkgs.dejavu_fonts];
2022-07-18 19:34:54 +03:00
};
environment = {
2023-09-10 21:40:39 +03:00
sessionVariables.FLAKE = "/etc/nixos";
2022-07-18 19:34:54 +03:00
pathsToLink = ["/share/zsh"];
persistence."${config.system.persistDir}" = {
2022-07-30 03:04:32 +03:00
directories = lib.flatten [
"/etc/nixos"
(
lib.optional
config.virtualisation.docker.enable
["/var/lib/docker" "/var/lib/containers"]
)
];
2022-07-18 19:34:54 +03:00
files = ["/etc/machine-id"];
};
};
2023-10-08 09:51:05 +03:00
# warframe
networking.firewall.allowedUDPPorts = [4990 4991 4992 4993 4994 4995];
2023-09-10 21:40:39 +03:00
# musikcube
2024-02-01 23:07:59 +03:00
networking.firewall.allowedTCPPorts = [7905 7906] ++ [6695 6696 6697 6698 6699] ++ [50300];
2023-05-04 03:13:26 +03:00
2022-10-29 03:24:57 +03:00
# for tailscale
2022-07-18 19:34:54 +03:00
networking.firewall.checkReversePath = "loose";
2022-10-29 23:50:53 +03:00
services.tailscale.enable = true;
2022-10-29 03:24:57 +03:00
2022-07-18 19:34:54 +03:00
services = {
earlyoom.enable = true;
2022-08-27 18:27:28 +03:00
gvfs.enable = true;
2022-07-18 19:34:54 +03:00
};
system.stateVersion = "22.05";
}