dotfiles/system/hosts/nixmsi.nix

134 lines
4.1 KiB
Nix
Raw Normal View History

2023-05-17 07:16:03 +07:00
{ lib
, pkgs
, config
, ... }:
/*
# for old kernel versions
zenKernels = pkgs.callPackage "${nixpkgs}/pkgs/os-specific/linux/kernel/zen-kernels.nix";
zenKernel = (version: sha256: (zenKernels {
kernelPatches = [
pkgs.linuxKernel.kernelPatches.bridge_stp_helper
pkgs.linuxKernel.kernelPatches.request_key_helper
];
argsOverride = {
src = pkgs.fetchFromGitHub {
owner = "zen-kernel";
repo = "zen-kernel";
rev = "v${version}-zen1";
inherit sha256;
};
inherit version;
modDirVersion = lib.versions.pad 3 "${version}-zen1";
};
}).zen);
zenKernelPackages = version: sha256: pkgs.linuxPackagesFor (zenKernel version sha256);
*/
{
2023-01-24 02:24:40 +07:00
system.stateVersion = "22.11";
### SECTION 1: HARDWARE/BOOT PARAMETERS ###
2023-04-11 00:58:02 +07:00
2023-01-24 02:24:40 +07:00
boot = {
kernel.sysctl = {
"vm.dirty_ratio" = 4;
"vm.dirty_background_ratio" = 2;
"vm.swappiness" = 40;
};
kernelPackages = lib.mkDefault pkgs.linuxPackages_latest;
/*kernelPackages = zenKernelPackages "6.1.9" "0fsmcjsawxr32fxhpp6sgwfwwj8kqymy0rc6vh4qli42fqmwdjgv";*/
2023-01-24 02:24:40 +07:00
};
2023-04-11 00:58:02 +07:00
# for testing different zen kernel versions:
# specialisation = {
# zen619.configuration.boot.kernelPackages = zenKernelPackages "6.1.9" "0fsmcjsawxr32fxhpp6sgwfwwj8kqymy0rc6vh4qli42fqmwdjgv";
2023-02-13 21:56:34 +07:00
# };
2023-04-11 00:58:02 +07:00
nixpkgs.config.allowUnfreePredicate = pkg: (lib.getName pkg) == "steam-original";
2023-01-24 02:24:40 +07:00
hardware = {
steam-hardware.enable = true;
opengl.driSupport32Bit = true;
2023-04-11 00:58:02 +07:00
# needed for sway WLR_RENDERER=vulkan
opengl.extraPackages = with pkgs; [ vulkan-validation-layers ];
};
# see modules/vfio.nix
2023-01-24 02:24:40 +07:00
vfio.enable = true;
2023-05-17 07:16:03 +07:00
vfio.libvirtdGroup = [ config.common.mainUsername ];
# because libvirtd's nat is broken for some reason...
networking.nat = {
enable = true;
internalInterfaces = [ "virbr0" ];
externalInterface = "enp7s0f4u1c2";
};
2023-01-24 02:24:40 +07:00
### SECTION 2: SYSTEM CONFIG/ENVIRONMENT ###
2023-04-11 00:58:02 +07:00
2023-01-24 02:24:40 +07:00
networking.useDHCP = true;
# networking.firewall.enable = false;
2023-04-11 00:58:02 +07:00
networking.firewall.allowedTCPPorts = [
27015
25565
7777
2023-06-24 07:12:11 +07:00
9887
];
2023-04-11 00:58:02 +07:00
# kde connect
2023-06-24 07:12:11 +07:00
networking.firewall.allowedTCPPortRanges = [
{ from = 1714; to = 1764; }
];
networking.firewall.allowedUDPPortRanges = [
{ from = 1714; to = 1764; }
];
2023-01-24 02:24:40 +07:00
networking.wireless.iwd.enable = true;
2023-04-11 00:58:02 +07:00
services.ratbagd.enable = true;
2023-01-24 02:24:40 +07:00
services.mullvad-vpn.enable = true;
services.mullvad-vpn.package = pkgs.mullvad-vpn;
2023-04-11 00:58:02 +07:00
# System76 scheduler (not actually a scheduler, just a renice daemon) for improved responsiveness
/*services.dbus.packages = [ pkgs.system76-scheduler ];
systemd.services."system76-scheduler" = {
description = "Automatically configure CPU scheduler for responsiveness on AC";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "dbus";
BusName= "com.system76.Scheduler";
ExecStart = "${pkgs.system76-scheduler}/bin/system76-scheduler daemon";
ExecReload = "${pkgs.system76-scheduler}/bin/system76-scheduler daemon reload";
};
};
environment.etc."system76-scheduler/assignments.ron".source =
"${pkgs.system76-scheduler}/etc/system76-scheduler/assignments.ron";
environment.etc."system76-scheduler/config.ron".source =
"${pkgs.system76-scheduler}/etc/system76-scheduler/config.ron";
environment.etc."system76-scheduler/exceptions.ron".source =
"${pkgs.system76-scheduler}/etc/system76-scheduler/exceptions.ron";*/
services.system76-scheduler.enable = true;
services.system76-scheduler.assignments = {
games.matchers = [ "osu!" ];
};
2023-04-11 00:58:02 +07:00
2023-05-13 20:32:35 +07:00
common.workstation = true;
common.gettyAutologin = true;
# programs.firejail.enable = true;
# doesn't work:
# programs.wireshark.enable = true;
2023-05-17 07:16:03 +07:00
# users.groups.wireshark.members = [ config.common.mainUsername"];
2023-01-24 02:24:40 +07:00
services.printing.enable = true;
2023-05-13 20:32:35 +07:00
# from nix-gaming
services.pipewire.lowLatency = {
enable = true;
2023-05-13 20:32:35 +07:00
# 96 is mostly fine but has some xruns
# 128 has xruns every now and then too, but is overall fine
quantum = 128;
rate = 48000;
};
2023-01-24 02:24:40 +07:00
programs.ccache.enable = true;
services.sshd.enable = true;
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
2023-01-24 02:24:40 +07:00
}