miku: Do a lot of things

This commit is contained in:
PapaTutuWawa 2022-02-14 18:34:04 +01:00
parent 1fa05e9822
commit fb4815a7dd
9 changed files with 45 additions and 46 deletions

View File

@ -17,6 +17,11 @@
"/mnt/Storage" = {
device = "/dev/disk/by-label/storage";
fsType = "btrfs";
options = [
"noatime"
"nodev"
"nosuid"
];
};
};
@ -27,8 +32,7 @@
vfio-isolate # Custom Package
steam-wrapped discord-wrapped # Custom package
mumble
piper
trackma # Custom package
piper trackma # Custom package
anime-dl # Custom package
thunderbird
#nwg-launchers
@ -53,7 +57,7 @@
#DGPU_DRM_NODE=$(ls /sys/bus/pci/devices/0000:01:00.0/drm | grep card)
#IGPU_DRM_NODE=$(ls /sys/bus/pci/devices/0000:08:00.0/drm | grep card)
#WLR_DRM_DEVICES=/dev/dri/$DGPU_DRM_NODE:/dev/dri/$IGPU_DRM_NODE
#export WLR_DRM_DEVICES=/dev/dri/$DGPU_DRM_NODE:/dev/dri/$IGPU_DRM_NODE
'';
};
alacritty.enable = true;
@ -74,9 +78,9 @@
};
services = {
gamemode.enable = true;
gnome.enable = true;
#gnome.enable = true;
greetd = {
enable = true;
enable = false;
/*
swayExtra = ''
output HDMI-A-3 transform 90 anticlockwise
@ -122,7 +126,7 @@
swaync.enable = true;
input-remapper = {
enable = true;
postStartCommand = "${pkgs.input-remapper}/bin/input-remapper-control --command start --preset NOOP --device \"Razer Razer Tartarus V2\"; exit 0";
postStartCommand = "${pkgs.input-remapper}/bin/input-remapper-control --command start --preset NOOP --device \"Razer Razer Tartarus V2\"";
};
};
system = {
@ -166,7 +170,7 @@
};
kernelParams = [
"amd_iommu=on"
"iommu=pt"
"iommu=on"
"sysrq_always_enabled=1"
"kvm.ignore_msrs=1"
"kvm.report_ignored_msrs=N"
@ -177,6 +181,7 @@
"nospec"
"clocksource=tsc"
"tsc=reliable"
"pci=noaer"
];
extraModulePackages = [ pkgs.linuxPackages_zen.vendor-reset ];
@ -200,8 +205,9 @@
libinput.enable = true;
displayManager.gdm = {
wayland = true;
enable = false;
enable = true;
};
desktopManager.plasma5.enable = true;
};
};
@ -223,15 +229,6 @@
};
};
user.services = {
scream = {
description = "Audio receiver for the Scream virtual network sound card";
#wantedBy = [ "default.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.scream}/bin/scream -i virbr0 -o pulse";
Restart = "always";
};
};
replaysorcery-kms = {
description = "An open-source, instant-replay solution for Linux; KMS service";
#wantedBy = [ "default.target" ];

View File

@ -28,6 +28,7 @@
./services/input-remapper
./services/gamemode
./services/i18n
./services/greetd
# User
#./users/default.nix

View File

@ -66,7 +66,7 @@ in {
desktopManager.gnome.enable = true;
displayManager.gdm = {
enable = true;
enable = false;
wayland = true;
};
};

View File

@ -35,6 +35,10 @@ let
in {
options.ptw.programs.sway = {
enable = lib.mkEnableOption "Configure sway using HomeManager";
extraSessionCommands = lib.mkOption {
description = "Commands to be run before sway is started. See programs.sway.extraSessionCommands";
default = "";
};
};
config = lib.mkIf cfg.enable {
@ -61,10 +65,14 @@ in {
};
};
programs.sway.enable = true;
programs.sway = {
enable = true;
extraSessionCommands = cfg.extraSessionCommands;
};
home-manager.users."${config.ptw.system.singleUser}" = {
wayland.windowManager.sway = {
enable = true;
extraSessionCommands = cfg.extraSessionCommands;
config = {
bars = [ ];
startup = [

View File

@ -1,4 +1,4 @@
{ lib, config, ... }:
{ lib, config, pkgs, ... }:
let
cfg = config.ptw.services.greetd;

View File

@ -23,12 +23,9 @@ in {
"/dev/random", "/dev/urandom",
"/dev/ptmx", "/dev/kvm", "/dev/kqemu",
"/dev/rtc","/dev/hpet",
"/dev/input/by-id/usb-Logitech_G700s_Rechargeable_Gaming_Mouse_93DF48160007-event-mouse",
"/dev/input/by-id/usb-Logitech_USB_Receiver-if02-event-mouse",
"/dev/input/by-id/usb-Razer_Razer_Tartarus_V2-event-kbd",
"/dev/input/by-id/virtual-event-EvdevProxyMouse",
"/dev/input/by-id/virtual-event-EvdevProxyTartarus",
"/dev/input/by-id/usb-Razer_Razer_BlackWidow_Ultimate-event-kbd"
"/dev/input/by-id/virtual-event-EvdevProxyKeyboard",
"/dev/input/by-id/usb-Logitech_USB_Receiver-if02-event-mouse"
]
'';
};

View File

@ -24,7 +24,7 @@ in {
USBIDClass = {vendor=0x046d, model=0xc07c, class="Mouse"}
[[device]]
[device.Simple]
name = "EvdevProxyTartarus"
name = "EvdevProxyKeyboard"
vendor = 0x1337
model = 0x1338
class = "Keyboard"
@ -32,7 +32,9 @@ in {
# the mapped version of the Tartarus evdev node.
# (Useful for qemu)
[[device.Simple.selector]]
EVDEVClass = {phys="\"key-mapper\""}
EVDEVClass = {phys="\"input-remapper\""}
[[device.Simple.selector]]
USBIDClass = {vendor=0x1532, model=0x011a, class="Keyboard"}
'';
"libvirt/hooks/qemu".source = let
vfio-isolate-state = "/tmp/vfio-isolate-state";
@ -43,16 +45,14 @@ in {
phase=$3
extra=$4
if [[ "$guest" = "win10" ]]; then
echo "called with $1 $2 $3 $4" > /dev/stderr
if [[ "$guest" = "win10-gaming" ]]; then
case "$action" in
prepare)
# Only do this while in preparation
[[ ! "$phase" = "prepare" ]] && exit 0
sudo -u alexander systemctl --user start evdev-proxy.service
sudo -u alexander systemctl --user start scream.service
sleep 2
GUEST_CORES="C1-3,5-7"
${pkgs.vfio-isolate}/bin/vfio-isolate \
-u ${vfio-isolate-state} \
cpu-governor performance "$GUEST_CORES" \
@ -64,9 +64,6 @@ in {
stopped)
# Only run when the VM is fully stopped
[[ ! "$phase" = "end" ]] && exit 0
sudo -u alexander systemctl --user stop evdev-proxy.service
sudo -u alexander systemctl --user stop scream.service
${pkgs.vfio-isolate}/bin/vfio-isolate \
restore ${vfio-isolate-state}
esac
@ -85,15 +82,6 @@ in {
systemd = {
services = {
libvirtd.path = with pkgs; [ vfio-isolate systemd bash ];
virtiofsd = {
description = "vhost-user virtio-fs device backend written in Rust";
wantedBy = [ "default.target" "libvirtd.service" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.virtiofsd}/bin/virtiofsd --socket-path=/tmp/vfsd.sock --shared-dir /mnt/Storage/Games --announce-submounts --inode-file-handles=mandatory";
Restart = "always";
};
};
};
user.services.evdev-proxy = {

View File

@ -1,16 +1,17 @@
{
lib, stdenv, pkgs
, extraStartupArgs ? ""
, upstreamElectron ? pkgs.electron
}:
pkgs.unstable.discord.overrideAttrs (old: let
pkgs.discord.overrideAttrs (old: let
asar = pkgs.nodePackages.asar;
gtk3 = pkgs.gtk3;
binaryName = "Discord";
system-electron = "$out/opt/${binaryName}/system-electron.sh";
in rec {
version = "0.0.16";
nativeBuildInputs = with pkgs.unstable; old.nativeBuildInputs ++ [ electron asar ];
nativeBuildInputs = with pkgs.unstable; old.nativeBuildInputs ++ [ upstreamElectron asar ];
buildPhase = ''
${asar}/bin/asar e resources/app.asar resources/app
rm resources/app.asar

View File

@ -6,10 +6,13 @@ let
discord-system-electron = prev.callPackage ./applications/networking/instant-messengers/discord {
# Wayland
# NOTE: electron under Wayland has no window titlebars
upstreamElectron = prev.electron_16;
extraStartupArgs = "--enable-features=UseOzonePlatform --ozone-platform=wayland";
#extraStartupArgs = "--enable-features=UseOzonePlatform --ozone-platform=wayland --enable-features=WebRTCPipeWireCapturer";
};
in {
inherit discord-system-electron;
input-remapper = prev.callPackage ./tools/games/input-remapper {};
vfio-isolate = prev.callPackage ./tools/virtualisation/vfio-isolate {};
mopidy-funkwhale = prev.callPackage ./applications/audio/mopidy/funkwhale.nix {};
@ -20,6 +23,7 @@ in {
replaysorcery = prev.callPackage ./tools/games/replaysorcery {};
evdev-proxy = prev.callPackage ./tools/virtualisation/evdev-proxy {};
virtiofsd = prev.callPackage ./tools/virtualisation/virtiofsd {};
anime4k = prev.callPackage ./misc/video/anime4k {};
anime-dl = prev.callPackage ./tools/video/animedl {
pySmartDL = pySmartDL;
@ -52,4 +56,7 @@ in {
payload-dumper = prev.callPackage tools/system/payload-dumper {};
psst = prev.callPackage tools/audio/psst {};
wlrootsqt = prev.libsForQt5.callPackage ./wlrootsqt.nix {};
qtgreet = prev.libsForQt5.callPackage ./qtgreet.nix {};
}