2022-01-06 13:15:28 +00:00
|
|
|
{ config, lib, pkgs, inputs, ... }:
|
2021-07-29 20:21:51 +00:00
|
|
|
|
2021-11-01 20:33:21 +00:00
|
|
|
{
|
2022-01-06 13:15:28 +00:00
|
|
|
imports = with inputs.nixos-hardware.nixosModules; [
|
|
|
|
common-cpu-amd common-gpu-amd common-pc-ssd
|
|
|
|
];
|
|
|
|
|
2021-08-31 16:01:29 +00:00
|
|
|
fileSystems = {
|
|
|
|
"/" = {
|
|
|
|
device = "/dev/disk/by-label/root";
|
|
|
|
fsType = "btrfs";
|
|
|
|
};
|
|
|
|
"/boot" = {
|
|
|
|
device = "/dev/disk/by-label/boot";
|
|
|
|
fsType = "vfat";
|
|
|
|
};
|
|
|
|
"/mnt/Storage" = {
|
|
|
|
device = "/dev/disk/by-label/storage";
|
2022-02-11 13:01:52 +00:00
|
|
|
fsType = "btrfs";
|
2022-02-14 17:34:04 +00:00
|
|
|
options = [
|
|
|
|
"noatime"
|
|
|
|
"nodev"
|
|
|
|
"nosuid"
|
|
|
|
];
|
2021-08-23 18:28:54 +00:00
|
|
|
};
|
|
|
|
};
|
2021-11-01 20:33:21 +00:00
|
|
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
2022-06-15 17:43:12 +00:00
|
|
|
gajim
|
2021-11-01 20:33:21 +00:00
|
|
|
virt-manager qemu scream
|
2023-04-08 15:30:39 +00:00
|
|
|
#replaysorcery # Custom package
|
|
|
|
#vfio-isolate # Custom Package
|
2021-08-31 16:01:29 +00:00
|
|
|
mumble
|
2022-02-14 17:34:04 +00:00
|
|
|
piper trackma # Custom package
|
2021-12-06 12:39:37 +00:00
|
|
|
anime-dl # Custom package
|
2021-11-01 20:33:21 +00:00
|
|
|
thunderbird
|
2022-02-02 11:08:36 +00:00
|
|
|
anki
|
2022-04-26 15:14:08 +00:00
|
|
|
gimp
|
2023-09-17 11:35:43 +00:00
|
|
|
xwaylandvideobridge
|
2022-02-02 11:08:36 +00:00
|
|
|
#psst
|
2022-03-23 14:12:36 +00:00
|
|
|
|
2022-07-13 17:35:32 +00:00
|
|
|
#lapce
|
2021-08-31 16:01:29 +00:00
|
|
|
];
|
2022-05-22 18:42:18 +00:00
|
|
|
|
2021-11-01 20:33:21 +00:00
|
|
|
ptw = {
|
2021-09-06 16:10:14 +00:00
|
|
|
programs = {
|
2022-07-13 17:35:32 +00:00
|
|
|
#bluray.enable = true;
|
2021-11-04 14:11:46 +00:00
|
|
|
mpv = {
|
2023-03-31 22:12:40 +00:00
|
|
|
primaryScreen = "DP-1";
|
2023-01-26 15:26:49 +00:00
|
|
|
enable = true;
|
2021-11-04 14:11:46 +00:00
|
|
|
};
|
2022-07-09 16:18:15 +00:00
|
|
|
sway.enable = false;
|
2021-11-01 20:33:21 +00:00
|
|
|
alacritty.enable = true;
|
2023-09-17 11:35:43 +00:00
|
|
|
#emacs.enable = true;
|
2021-11-01 20:33:21 +00:00
|
|
|
firefox.enable = true;
|
2022-09-13 06:39:12 +00:00
|
|
|
git.enable = true;
|
2023-09-17 11:35:43 +00:00
|
|
|
#gnome-terminal.enable = true;
|
2021-11-01 20:33:21 +00:00
|
|
|
tmux.enable = true;
|
2021-11-05 22:41:19 +00:00
|
|
|
waybar = {
|
|
|
|
enable = true;
|
|
|
|
output = "DP-2";
|
|
|
|
};
|
2023-07-18 19:46:28 +00:00
|
|
|
neovim.enable = true;
|
2022-02-02 11:08:36 +00:00
|
|
|
#xournalpp.enable = true;
|
2021-11-01 20:33:21 +00:00
|
|
|
zsh.enable = true;
|
2022-04-23 18:12:59 +00:00
|
|
|
direnv.enable = true;
|
2022-03-19 14:19:11 +00:00
|
|
|
office.enable = true;
|
2022-07-13 18:19:53 +00:00
|
|
|
plasma = {
|
2022-10-15 10:06:07 +00:00
|
|
|
enable = true;
|
2023-07-21 18:03:01 +00:00
|
|
|
/*sddm = {
|
2022-07-13 18:19:53 +00:00
|
|
|
backgroundImage = pkgs.fetchurl {
|
|
|
|
url = "https://cdn.donmai.us/original/d3/1b/__manjuu_prinz_eugen_roon_bismarck_friedrich_der_grosse_and_3_more_azur_lane_drawn_by_zaphn__d31bf4ac564d60f8787818842c369e7f.jpg";
|
|
|
|
sha256 = "sha256-likoJuEaGzGH0RqjPsBE9o5ATwgnOo97PREh3oZBax8=";
|
|
|
|
};
|
2023-07-21 18:03:01 +00:00
|
|
|
};*/
|
2022-07-13 18:19:53 +00:00
|
|
|
};
|
2022-02-02 11:08:36 +00:00
|
|
|
gaming.enable = true;
|
2022-05-22 18:42:18 +00:00
|
|
|
obs.enable = true;
|
2022-11-12 20:59:36 +00:00
|
|
|
android.enable = true;
|
2021-09-06 16:10:14 +00:00
|
|
|
};
|
2021-11-01 20:33:21 +00:00
|
|
|
services = {
|
2023-07-21 18:03:01 +00:00
|
|
|
yubikey.enable = true;
|
2021-11-01 20:33:21 +00:00
|
|
|
gamemode.enable = true;
|
2022-10-15 10:06:07 +00:00
|
|
|
gnome.enable = false;
|
2022-05-29 17:06:32 +00:00
|
|
|
logiops.enable = true;
|
2022-09-13 06:39:12 +00:00
|
|
|
gdm = {
|
2022-10-15 10:06:07 +00:00
|
|
|
enable = false;
|
2022-09-13 06:39:12 +00:00
|
|
|
};
|
2021-11-01 20:33:21 +00:00
|
|
|
};
|
|
|
|
system = {
|
|
|
|
i18n.enable = true;
|
|
|
|
singleUser = "alexander";
|
|
|
|
primaryInterface = "enp6s0";
|
|
|
|
hostName = "miku";
|
2021-11-04 20:25:23 +00:00
|
|
|
offloading.builder.enable = true;
|
2021-11-01 20:33:21 +00:00
|
|
|
};
|
|
|
|
virtualisation = {
|
|
|
|
enable = true;
|
2023-02-17 14:07:55 +00:00
|
|
|
gaming.enable = false;
|
2021-11-01 20:33:21 +00:00
|
|
|
};
|
|
|
|
};
|
2021-11-05 16:53:43 +00:00
|
|
|
programs = {
|
|
|
|
adb.enable = true;
|
|
|
|
gnupg.agent.pinentryFlavor = "qt";
|
2022-04-23 11:22:03 +00:00
|
|
|
evolution.enable = true;
|
2021-11-05 16:53:43 +00:00
|
|
|
};
|
2021-11-01 20:33:21 +00:00
|
|
|
|
2021-11-09 19:17:34 +00:00
|
|
|
virtualisation = {
|
2023-09-17 11:35:43 +00:00
|
|
|
docker = {
|
2023-01-19 14:17:15 +00:00
|
|
|
enable = true;
|
2023-09-17 11:35:43 +00:00
|
|
|
storageDriver = "btrfs";
|
2023-01-19 14:17:15 +00:00
|
|
|
};
|
2021-11-09 19:17:34 +00:00
|
|
|
};
|
2022-06-30 17:59:45 +00:00
|
|
|
|
2022-05-03 13:04:01 +00:00
|
|
|
boot = let
|
2023-09-17 11:35:43 +00:00
|
|
|
kernel = pkgs.linuxPackages_xanmod_latest;
|
2022-05-03 13:04:01 +00:00
|
|
|
in {
|
2021-11-01 20:33:21 +00:00
|
|
|
extraModprobeConfig = ''
|
2021-08-31 16:01:29 +00:00
|
|
|
options kvm_amd nested=1
|
|
|
|
'';
|
2021-11-01 20:33:21 +00:00
|
|
|
initrd = {
|
2023-09-17 11:35:43 +00:00
|
|
|
availableKernelModules = [
|
|
|
|
"xhci_pci"
|
|
|
|
"ahci"
|
|
|
|
"usbhid"
|
|
|
|
"sd_mod"
|
|
|
|
"amdgpu"
|
|
|
|
"vendor-reset"
|
|
|
|
"winesync"
|
|
|
|
];
|
2021-11-01 20:33:21 +00:00
|
|
|
kernelModules = [
|
|
|
|
"amdgpu" # GPU (duh)
|
2023-04-08 15:30:39 +00:00
|
|
|
"kvm-amd" /*"vfio_virqfd"*/ "vfio_pci" "vfio_iommu_type1" "vfio" # Virt
|
2021-11-01 20:33:21 +00:00
|
|
|
"uinput" # key-mapper
|
2022-02-02 11:08:36 +00:00
|
|
|
"vendor-reset"
|
2023-09-17 11:35:43 +00:00
|
|
|
"winesync"
|
2021-10-22 19:40:21 +00:00
|
|
|
];
|
2021-07-29 20:21:51 +00:00
|
|
|
};
|
2021-11-01 20:33:21 +00:00
|
|
|
kernelParams = [
|
|
|
|
"amd_iommu=on"
|
2022-02-14 17:34:04 +00:00
|
|
|
"iommu=on"
|
2021-11-01 20:33:21 +00:00
|
|
|
"sysrq_always_enabled=1"
|
|
|
|
"kvm.ignore_msrs=1"
|
|
|
|
"kvm.report_ignored_msrs=N"
|
|
|
|
"fbcon=rotate:3"
|
|
|
|
"quiet"
|
2022-01-01 21:04:29 +00:00
|
|
|
"clocksource=tsc"
|
|
|
|
"tsc=reliable"
|
2022-02-14 17:34:04 +00:00
|
|
|
"pci=noaer"
|
2022-08-05 19:17:22 +00:00
|
|
|
# Disable mitigations
|
|
|
|
"mitigations=off"
|
|
|
|
"rhgb"
|
|
|
|
# Enable ZSwap
|
2023-09-17 11:35:43 +00:00
|
|
|
#"zswap.enabled=1"
|
2022-07-09 16:18:15 +00:00
|
|
|
# Enable Apparmor
|
|
|
|
"lsm=landlock,lockdown,yama,integrity,apparmor,bpf"
|
2022-08-05 19:17:22 +00:00
|
|
|
# Prevent sequential probing
|
|
|
|
"libahci.ignore_sss=1"
|
2023-09-17 11:35:43 +00:00
|
|
|
# Make the system less ready to swap
|
|
|
|
"sysctl.vm.swappiness=0"
|
2021-11-01 20:33:21 +00:00
|
|
|
];
|
2022-07-17 14:54:59 +00:00
|
|
|
kernel.sysctl = {
|
|
|
|
# League of Legends under Linux
|
|
|
|
"abi.vsyscall32" = 0;
|
2023-04-30 13:22:52 +00:00
|
|
|
# Fedora 39
|
|
|
|
"vm.max_map_count" = 2147483642;
|
2022-07-17 14:54:59 +00:00
|
|
|
};
|
2021-11-01 20:33:21 +00:00
|
|
|
|
2022-05-03 13:04:01 +00:00
|
|
|
extraModulePackages = [ kernel.vendor-reset ];
|
|
|
|
kernelPackages = kernel;
|
2023-09-17 11:35:43 +00:00
|
|
|
|
|
|
|
binfmt = {
|
|
|
|
emulatedSystems = [ "aarch64-linux" ];
|
|
|
|
registrations.aarch64-linux.fixBinary = true;
|
|
|
|
};
|
2021-11-01 20:33:21 +00:00
|
|
|
};
|
|
|
|
services = {
|
|
|
|
ratbagd.enable = true;
|
|
|
|
flatpak.enable = true;
|
2022-02-02 14:55:38 +00:00
|
|
|
#etesync-dav.enable = true;
|
2021-11-01 20:33:21 +00:00
|
|
|
connman.extraConfig = ''
|
2021-09-11 18:37:49 +00:00
|
|
|
WriteResolvConf=false
|
|
|
|
'';
|
2021-11-01 20:33:21 +00:00
|
|
|
xserver = {
|
|
|
|
enable = true;
|
|
|
|
layout = "de";
|
|
|
|
libinput.enable = true;
|
2021-08-31 16:01:29 +00:00
|
|
|
};
|
2022-02-18 19:18:56 +00:00
|
|
|
earlyoom.enable = lib.mkForce false;
|
2022-10-15 10:06:07 +00:00
|
|
|
|
|
|
|
udev.extraRules = ''
|
|
|
|
ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c52b", ATTR{power/wakeup}="disabled", ATTR{driver/1-7/power/wakeup}="disabled"
|
|
|
|
'';
|
2023-03-31 22:12:40 +00:00
|
|
|
|
|
|
|
hardware = {
|
|
|
|
openrgb = {
|
|
|
|
enable = true;
|
|
|
|
motherboard = "amd";
|
|
|
|
};
|
|
|
|
};
|
2023-09-17 11:35:43 +00:00
|
|
|
|
|
|
|
system76-scheduler = {
|
|
|
|
enable = false;
|
|
|
|
useStockConfig = true;
|
|
|
|
};
|
2021-11-01 20:33:21 +00:00
|
|
|
};
|
2023-04-15 17:09:05 +00:00
|
|
|
programs = {
|
|
|
|
cdemu = {
|
|
|
|
enable = true;
|
|
|
|
gui = true;
|
|
|
|
};
|
|
|
|
};
|
2021-12-06 12:39:37 +00:00
|
|
|
|
2022-02-02 11:08:36 +00:00
|
|
|
hardware = {
|
|
|
|
opentabletdriver.enable = true;
|
2022-05-03 13:04:01 +00:00
|
|
|
openrazer = {
|
|
|
|
enable = true;
|
|
|
|
devicesOffOnScreensaver = true;
|
|
|
|
users = [ "alexander" ];
|
|
|
|
};
|
2022-12-31 12:01:38 +00:00
|
|
|
bluetooth = {
|
|
|
|
enable = true;
|
|
|
|
powerOnBoot = true;
|
|
|
|
};
|
2022-02-02 11:08:36 +00:00
|
|
|
};
|
|
|
|
|
2021-11-04 14:11:46 +00:00
|
|
|
# TODO: Move into modules
|
2022-07-13 17:35:32 +00:00
|
|
|
/*
|
2022-02-02 11:08:36 +00:00
|
|
|
systemd = {
|
|
|
|
services = {
|
|
|
|
enable-vendor-reset = {
|
|
|
|
wantedBy = [ "default.target" ];
|
|
|
|
script = ''
|
|
|
|
echo "device_specific" > /sys/bus/pci/devices/0000:01:00.0/reset_method
|
|
|
|
'';
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "simple";
|
|
|
|
};
|
2021-08-07 15:26:11 +00:00
|
|
|
};
|
2021-11-04 14:11:46 +00:00
|
|
|
};
|
2022-02-02 11:08:36 +00:00
|
|
|
user.services = {
|
|
|
|
replaysorcery-kms = {
|
|
|
|
description = "An open-source, instant-replay solution for Linux; KMS service";
|
|
|
|
#wantedBy = [ "default.target" ];
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "simple";
|
|
|
|
ExecStart = "${pkgs.replaysorcery}/bin/replay-sorcery kms-service";
|
|
|
|
Restart = "always";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
replaysorcery = {
|
|
|
|
description = "An open-source, instant-replay solution for Linux";
|
|
|
|
#wantedBy = [ "default.target" ];
|
|
|
|
requires = [ "replaysorcery-kms.service" ];
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "simple";
|
|
|
|
ExecStart = "${pkgs.replaysorcery}/bin/replay-sorcery";
|
|
|
|
Restart = "always";
|
|
|
|
};
|
2021-07-29 20:21:51 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2022-07-13 17:35:32 +00:00
|
|
|
*/
|
2021-07-29 20:21:51 +00:00
|
|
|
}
|