nixos-config/hosts/miku.nix

172 lines
5.1 KiB
Nix
Raw Normal View History

2021-08-31 16:01:29 +00:00
{ config, lib, pkgs, ... }:
2021-07-29 20:21:51 +00:00
2021-08-31 16:01:29 +00:00
let
2021-09-01 14:37:36 +00:00
mkHost = (import ../modules { lib = lib; pkgs = pkgs; }).mkHost;
in mkHost config {
2021-08-31 16:01:29 +00:00
userName = "alexander";
hostName = "miku";
2021-09-11 22:32:18 +00:00
primaryInterface = "enp6s0";
overlays = [ "nur" "unstable" "simple" "custom" "emacs" ];
2021-08-31 16:15:06 +00:00
hardwareImports = [ "amdgpu" "amd" ];
2021-08-31 16:01:29 +00:00
programImports = [
2021-10-22 19:40:21 +00:00
"zsh" "git" "mpv" "tmux" "emacs" "firefox" "i18n" "gamemode" #"gnome-terminal" "gnome"
"alacritty" "sway" "waybar" "kanshi"
2021-08-31 16:01:29 +00:00
"distributed-build/builder.nix"
"music"
2021-07-29 20:21:51 +00:00
];
extraImports = [ "virtualisation/gaming.nix" "virtualisation" ];
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";
fsType = "ext4";
2021-08-23 18:28:54 +00:00
};
};
2021-08-31 16:01:29 +00:00
extraPackages = pkgs: with pkgs; [
emacsPgtkGcc
gajim
virt-manager unstable.qemu scream
2021-10-22 19:40:21 +00:00
#gamemode # Custom package
2021-08-31 16:01:29 +00:00
key-mapper # Custom package
replaysorcery # Custom package
2021-10-22 19:40:21 +00:00
#evdev-proxy # Custom package
2021-08-31 16:01:29 +00:00
vfio-isolate # Custom Package
steam-wrapped
2021-10-21 21:42:36 +00:00
discord-wrapped # Custom package
2021-08-31 16:01:29 +00:00
superpaper # Custom package
mumble
piper
2021-10-21 21:42:36 +00:00
anime-dl trackma # Custom package
2021-09-11 18:37:49 +00:00
unstable.thunderbird
2021-10-21 21:42:36 +00:00
multimc-wrapped # Custom package
2021-10-22 19:40:21 +00:00
nwg-launchers
2021-08-31 16:01:29 +00:00
];
extraOptions = old: {
2021-10-22 12:58:27 +00:00
system.autoUpgrade.channel = "https://nixos.org/channels/nixos-unstable";
2021-09-06 16:10:14 +00:00
programs = {
mpv.primaryScreen = "C27F398";
adb.enable = true;
2021-10-22 19:40:21 +00:00
sway.enable = true;
2021-09-06 16:10:14 +00:00
};
2021-07-29 20:52:07 +00:00
2021-08-31 16:01:29 +00:00
boot = {
extraModprobeConfig = ''
options kvm_amd nested=1
options vfio-pci ids=1002:67df,1002:aaf0
2021-10-21 21:42:36 +00:00
options amdgpu dpm=0
2021-08-31 16:01:29 +00:00
'';
initrd = {
availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "sd_mod" "amdgpu" "vendor-reset" ];
kernelModules = [
"amdgpu" # GPU (duh)
"kvm-amd" "vfio_virqfd" "vfio_pci" "vfio_iommu_type1" "vfio" # Virt
"uinput" # key-mapper
"vendor-reset"
];
};
kernelParams = [
"amd_iommu=on"
"iommu=pt"
"sysrq_always_enabled=1"
"kvm.ignore_msrs=1"
"kvm.report_ignored_msrs=N"
"fbcon=rotate:1"
"quiet"
2021-10-22 19:40:21 +00:00
"tsc=unstable"
2021-07-29 20:21:51 +00:00
];
2021-10-22 19:40:21 +00:00
extraModulePackages = [ pkgs.linuxPackages_xanmod.vendor-reset ];
#extraModulePackages = [ pkgs.linuxPackages.vendor-reset ];
2021-08-31 16:01:29 +00:00
# NOTE: A regression appears to have happend between 5.10 and 5.12
# which leads to the RX590 to have the fence fallback timer on
# sdma0 time out (whatever this means). Maybe bisect?
2021-10-22 19:40:21 +00:00
kernelPackages = pkgs.linuxPackages_xanmod;
};
xdg.portal = {
enable = true;
extraPortals = [
pkgs.xdg-desktop-portal-wlr
];
2021-07-29 20:21:51 +00:00
};
2021-08-31 16:01:29 +00:00
services = {
ratbagd.enable = true;
flatpak.enable = true;
2021-09-11 18:37:49 +00:00
etesync-dav.enable = true;
connman.extraConfig = ''
WriteResolvConf=false
'';
2021-10-22 19:40:21 +00:00
udev = {
packages = with pkgs; [ key-mapper ];
extraRules = ''
KERNEL=="uinput", GROUP="input", MODE="0660"
'';
};
xserver.displayManager.gdm = {
enable = true;
wayland = true;
2021-08-31 16:01:29 +00:00
};
};
2021-10-21 21:42:36 +00:00
2021-08-31 16:01:29 +00:00
# TODO: Move into modules
systemd.user.services = {
2021-07-29 20:21:51 +00:00
scream = {
description = "Audio receiver for the Scream virtual network sound card";
2021-08-07 15:26:11 +00:00
#wantedBy = [ "default.target" ];
2021-07-29 20:21:51 +00:00
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.scream}/bin/scream -i virbr0 -o pulse";
2021-08-07 15:26:11 +00:00
Restart = "always";
};
};
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";
};
};
key-mapper = {
description = "A tool to change the mapping of your input device buttons";
wantedBy = [ "default.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.key-mapper}/bin/key-mapper-service";
Restart = "always";
2021-08-22 19:58:05 +00:00
# NOTE: The Tartarus may not be connected, so don't fail if we cannot set the preset
ExecPostStart = "${pkgs.key-mapper}/bin/key-mapper --command start --preset NOOP --device \"Razer Razer Tartarus V2\"; exit 0";
};
};
2021-08-07 15:26:11 +00:00
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
};
};
2021-08-28 14:49:14 +00:00
superpaper = {
description = "A cross-platform multi monitor wallpaper manager.";
wantedBy = [ "default.target" ];
path = [ pkgs.glib ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.superpaper}/bin/superpaper";
Restart = "always";
};
};
2021-07-29 20:21:51 +00:00
};
};
}