mirror of https://github.com/materusPL/Nixerus.git
configurations: update
This commit is contained in:
parent
e70cb83ce8
commit
96c425a05e
|
@ -9,6 +9,8 @@
|
||||||
./scripts.nix
|
./scripts.nix
|
||||||
./tmp.nix
|
./tmp.nix
|
||||||
./network.nix
|
./network.nix
|
||||||
|
|
||||||
|
./kde.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
|
|
@ -12,13 +12,22 @@
|
||||||
enableTerminal = lib.mkDefault true;
|
enableTerminal = lib.mkDefault true;
|
||||||
enableTerminalExtra = lib.mkDefault true;
|
enableTerminalExtra = lib.mkDefault true;
|
||||||
enableNixDevel = lib.mkDefault true;
|
enableNixDevel = lib.mkDefault true;
|
||||||
|
editor.code.fhs.enable = true;
|
||||||
|
editor.code.fhs.packages = (ps: with ps;[
|
||||||
|
llvmPackages_16.clang
|
||||||
|
llvmPackages_16.llvm
|
||||||
|
llvmPackages_16.bintools
|
||||||
|
llvmPackages_16.lld
|
||||||
|
llvmPackages_16.lldb
|
||||||
|
llvmPackages_16.libllvm
|
||||||
|
]);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
home.packages = [
|
home.packages = [
|
||||||
pkgs.papirus-icon-theme
|
pkgs.papirus-icon-theme
|
||||||
materusPkgs.ffmpeg6-amf-full
|
materusPkgs.ffmpeg6-amf-full
|
||||||
(materusPkgs.polymc.wrap { extraJDKs = [ pkgs.graalvm17-ce ]; })
|
(materusPkgs.polymc.wrap { extraJDKs = [ pkgs.graalvm17-ce ]; extraLibs = [ ]; })
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.obs-studio = {
|
programs.obs-studio = {
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
services.gnome.core-os-services.enable = true;
|
services.gnome.core-os-services.enable = true;
|
||||||
|
|
||||||
programs.gnupg.agent.pinentryFlavor = "gnome3";
|
programs.gnupg.agent.pinentryFlavor = "gnome3";
|
||||||
|
|
||||||
|
|
||||||
programs.gnome-terminal.enable = true;
|
programs.gnome-terminal.enable = true;
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,26 @@
|
||||||
{ config, pkgs, lib, inputs, materusFlake, ... }:
|
{ config, pkgs, lib, inputs, materusFlake, ... }:
|
||||||
|
let
|
||||||
|
video = [
|
||||||
|
|
||||||
|
#"video=DP-3:1920x1080@144"
|
||||||
|
"video=HDMI-A-3:1920x1080@144"
|
||||||
|
|
||||||
|
"video=DP-1:1920x1080@240"
|
||||||
|
#"video=DP-2:1920x1080@240"
|
||||||
|
#"video=HDMI-A-1:1920x1080@240"
|
||||||
|
#"video=HDMI-A-2:1920x1080@240"
|
||||||
|
|
||||||
|
|
||||||
|
];
|
||||||
|
in
|
||||||
{
|
{
|
||||||
#Kernel
|
#Kernel
|
||||||
boot.kernelPackages = pkgs.linuxPackages_zen;
|
boot.kernelPackages = pkgs.linuxPackages_zen;
|
||||||
boot.kernelParams = [ "nvme_core.default_ps_max_latency_us=0" "nvme_core.io_timeout=255" "nvme_core.max_retries=10" "nvme_core.shutdown_timeout=10" "amd_iommu=on" "iommu=pt" "pcie_acs_override=downstream,multifunction" ];
|
boot.kernelParams = [ /*"pci-stub.ids=1002:744c"*/ "nox2apic" "nvme_core.default_ps_max_latency_us=0" "nvme_core.io_timeout=255" "nvme_core.max_retries=10" "nvme_core.shutdown_timeout=10" "amd_iommu=on" "iommu=pt"] ++ video;
|
||||||
boot.kernelModules = [ "i2c_dev" "kvm_amd" "vfio-pci" "v4l2loopback" "kvmfr" ];
|
boot.kernelModules = [ "pci-stub" "amdgpu" "i2c_dev" "kvm_amd" "vfio" "vfio_iommu_type1" "vfio-pci" "v4l2loopback" ];
|
||||||
boot.extraModprobeConfig = ''
|
boot.extraModprobeConfig = ''
|
||||||
options kvm_amd nested=1
|
options kvm_amd nested=1 avic=1 npt=1
|
||||||
|
options vfio_iommu_type1 allow_unsafe_interrupts=1
|
||||||
'';
|
'';
|
||||||
boot.kernel.sysctl = {"vm.max_map_count" = 1000000;};
|
boot.kernel.sysctl = {"vm.max_map_count" = 1000000;};
|
||||||
|
|
||||||
|
@ -13,7 +28,7 @@
|
||||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
|
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.initrd.kernelModules = [ ];
|
||||||
|
|
||||||
boot.extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback kvmfr];
|
boot.extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ];
|
||||||
|
|
||||||
|
|
||||||
boot.supportedFilesystems = [ "ntfs" "btrfs" "vfat" "exfat" "ext4"];
|
boot.supportedFilesystems = [ "ntfs" "btrfs" "vfat" "exfat" "ext4"];
|
||||||
|
@ -28,8 +43,8 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
efiSupport = true;
|
efiSupport = true;
|
||||||
device = "nodev";
|
device = "nodev";
|
||||||
gfxmodeEfi = pkgs.lib.mkDefault "1920x1080";
|
gfxmodeEfi = pkgs.lib.mkDefault "1920x1080@240";
|
||||||
gfxmodeBios = pkgs.lib.mkDefault "1920x1080";
|
gfxmodeBios = pkgs.lib.mkDefault "1920x1080@240";
|
||||||
useOSProber = true;
|
useOSProber = true;
|
||||||
memtest86.enable = true;
|
memtest86.enable = true;
|
||||||
};
|
};
|
||||||
|
|
|
@ -15,7 +15,7 @@ in
|
||||||
];
|
];
|
||||||
hardware.firmware = with pkgs; [
|
hardware.firmware = with pkgs; [
|
||||||
materusPkgs.amdgpu-pro-libs.firmware.vcn
|
materusPkgs.amdgpu-pro-libs.firmware.vcn
|
||||||
materusPkgs.amdgpu-pro-libs.firmware
|
#materusPkgs.amdgpu-pro-libs.firmware
|
||||||
linux-firmware
|
linux-firmware
|
||||||
alsa-firmware
|
alsa-firmware
|
||||||
sof-firmware
|
sof-firmware
|
||||||
|
@ -45,12 +45,14 @@ in
|
||||||
materusPkgs.i686Linux.amdgpu-pro-libs.vulkan
|
materusPkgs.i686Linux.amdgpu-pro-libs.vulkan
|
||||||
libvdpau-va-gl
|
libvdpau-va-gl
|
||||||
];
|
];
|
||||||
|
users.groups.gpurun = {};
|
||||||
#GPU bar size
|
|
||||||
services.udev.extraRules = ''
|
services.udev.extraRules = ''
|
||||||
|
|
||||||
|
#GPU bar size
|
||||||
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x1002", ATTR{device}=="0x744c", ATTR{resource0_resize}="15"
|
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x1002", ATTR{device}=="0x744c", ATTR{resource0_resize}="15"
|
||||||
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x1002", ATTR{device}=="0x744c", ATTR{resource2_resize}="8"
|
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x1002", ATTR{device}=="0x744c", ATTR{resource2_resize}="8"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
||||||
#Trim
|
#Trim
|
||||||
services.fstrim = {
|
services.fstrim = {
|
||||||
|
|
|
@ -35,7 +35,7 @@ in
|
||||||
CursorSize = "24";
|
CursorSize = "24";
|
||||||
};
|
};
|
||||||
Wayland = {
|
Wayland = {
|
||||||
#CompositorCommand = "${pkgs.weston}/bin/weston --drm-device=card0 --additional-devices=card1 -c ${westonSddm}";
|
#CompositorCommand = "${pkgs.weston}/bin/weston -c ${westonSddm}";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
services.xserver.desktopManager.plasma5.enable = true;
|
services.xserver.desktopManager.plasma5.enable = true;
|
||||||
|
@ -46,7 +46,7 @@ in
|
||||||
environment.plasma5.excludePackages = with pkgs; [ libsForQt5.kwallet libsForQt5.kwalletmanager libsForQt5.kwallet-pam ];
|
environment.plasma5.excludePackages = with pkgs; [ libsForQt5.kwallet libsForQt5.kwalletmanager libsForQt5.kwallet-pam ];
|
||||||
|
|
||||||
environment.variables = {
|
environment.variables = {
|
||||||
KWIN_DRM_NO_AMS = "1";
|
#KWIN_DRM_NO_AMS = "1";
|
||||||
};
|
};
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{ config, pkgs, lib, inputs, materusFlake, materusPkgs, ... }:
|
{ config, pkgs, lib, inputs, materusFlake, materusPkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
virtualisation.lxc.enable = false;
|
virtualisation.lxc.enable = false;
|
||||||
virtualisation.lxc.lxcfs.enable = false;
|
virtualisation.lxc.lxcfs.enable = false;
|
||||||
|
@ -12,7 +13,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
services.xserver.displayManager.startx.enable = true;
|
|
||||||
services.teamviewer.enable = true;
|
services.teamviewer.enable = true;
|
||||||
|
|
||||||
systemd.tmpfiles.rules = [
|
systemd.tmpfiles.rules = [
|
||||||
|
@ -37,17 +38,16 @@
|
||||||
services.xserver.videoDrivers = [ "amdgpu" ];
|
services.xserver.videoDrivers = [ "amdgpu" ];
|
||||||
services.dbus.enable = true;
|
services.dbus.enable = true;
|
||||||
services.dbus.packages = [ pkgs.gcr_4 ];
|
services.dbus.packages = [ pkgs.gcr_4 ];
|
||||||
services.xserver.displayManager.lightdm.enable = true;
|
|
||||||
services.xserver.displayManager.lightdm.greeters.enso.enable = true;
|
|
||||||
services.xserver.displayManager.lightdm.greeters.enso.blur = true;
|
|
||||||
|
|
||||||
services.xserver.desktopManager.plasma5.enable = true;
|
|
||||||
services.xserver.desktopManager.plasma5.phononBackend = "gstreamer";
|
|
||||||
services.xserver.desktopManager.plasma5.useQtScaling = true;
|
|
||||||
services.xserver.desktopManager.plasma5.runUsingSystemd = true;
|
|
||||||
|
|
||||||
environment.plasma5.excludePackages = with pkgs; [ libsForQt5.kwallet libsForQt5.kwalletmanager libsForQt5.kwallet-pam ];
|
|
||||||
|
|
||||||
|
#services.xserver.displayManager.autoLogin.user = "materus";
|
||||||
|
services.xserver.displayManager.startx.enable = false;
|
||||||
|
/*
|
||||||
|
services.xserver.displayManager.lightdm.enable = true;
|
||||||
|
services.xserver.displayManager.lightdm.greeters.enso.enable = true;
|
||||||
|
services.xserver.displayManager.lightdm.greeters.enso.blur = true;
|
||||||
|
*/
|
||||||
|
|
||||||
services.xserver.config = pkgs.lib.mkAfter ''
|
services.xserver.config = pkgs.lib.mkAfter ''
|
||||||
Section "OutputClass"
|
Section "OutputClass"
|
||||||
Identifier "amd-options"
|
Identifier "amd-options"
|
||||||
|
@ -60,8 +60,7 @@
|
||||||
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
services.xserver.displayManager.defaultSession = "plasmawayland";
|
|
||||||
services.xserver.displayManager.autoLogin.user = "materus";
|
|
||||||
|
|
||||||
|
|
||||||
services.printing.enable = true;
|
services.printing.enable = true;
|
||||||
|
@ -106,11 +105,11 @@
|
||||||
# ];
|
# ];
|
||||||
};
|
};
|
||||||
environment.variables = {
|
environment.variables = {
|
||||||
KWIN_DRM_NO_AMS = "1";
|
|
||||||
DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1 = "1";
|
DISABLE_LAYER_AMD_SWITCHABLE_GRAPHICS_1 = "1";
|
||||||
VK_ICD_FILENAMES = "/run/opengl-driver/share/vulkan/icd.d/radeon_icd.x86_64.json:/run/opengl-driver-32/share/vulkan/icd.d/radeon_icd.i686.json";
|
VK_ICD_FILENAMES = "/run/opengl-driver/share/vulkan/icd.d/radeon_icd.x86_64.json:/run/opengl-driver-32/share/vulkan/icd.d/radeon_icd.i686.json";
|
||||||
AMD_VULKAN_ICD = "RADV";
|
AMD_VULKAN_ICD = "RADV";
|
||||||
RADV_PERFTEST = "gpl,rt,sam";
|
RADV_PERFTEST = "gpl,rt,sam";
|
||||||
|
ALSOFT_DRIVERS = "pulse";
|
||||||
};
|
};
|
||||||
environment.sessionVariables = rec {
|
environment.sessionVariables = rec {
|
||||||
XDG_CACHE_HOME = "\${HOME}/.cache";
|
XDG_CACHE_HOME = "\${HOME}/.cache";
|
||||||
|
@ -131,7 +130,7 @@
|
||||||
'';
|
'';
|
||||||
|
|
||||||
i18n.inputMethod.enabled = "fcitx5";
|
i18n.inputMethod.enabled = "fcitx5";
|
||||||
i18n.inputMethod.fcitx5.addons = [ pkgs.fcitx5-configtool pkgs.fcitx5-lua pkgs.fcitx5-mozc pkgs.libsForQt5.fcitx5-qt ];
|
i18n.inputMethod.fcitx5.addons = [ pkgs.fcitx5-configtool pkgs.fcitx5-lua pkgs.fcitx5-mozc pkgs.fcitx5-gtk pkgs.libsForQt5.fcitx5-qt ];
|
||||||
|
|
||||||
|
|
||||||
# Some programs need SUID wrappers, can be configured further or are
|
# Some programs need SUID wrappers, can be configured further or are
|
||||||
|
@ -150,7 +149,7 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
enableSSHSupport = false;
|
enableSSHSupport = false;
|
||||||
enableBrowserSocket = true;
|
enableBrowserSocket = true;
|
||||||
pinentryFlavor = "gtk2";
|
|
||||||
};
|
};
|
||||||
programs.ssh.startAgent = true;
|
programs.ssh.startAgent = true;
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
|
@ -198,7 +197,7 @@
|
||||||
gtk3
|
gtk3
|
||||||
gtk4
|
gtk4
|
||||||
gsettings-desktop-schemas
|
gsettings-desktop-schemas
|
||||||
|
libsForQt5.dolphin
|
||||||
|
|
||||||
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
|
||||||
|
|
||||||
|
@ -268,6 +267,8 @@
|
||||||
monkeysphere
|
monkeysphere
|
||||||
gparted
|
gparted
|
||||||
|
|
||||||
|
virt-viewer
|
||||||
|
|
||||||
inkscape
|
inkscape
|
||||||
gimp
|
gimp
|
||||||
|
|
||||||
|
@ -282,22 +283,6 @@
|
||||||
|
|
||||||
binutils
|
binutils
|
||||||
config.materus.profile.packages.firefox
|
config.materus.profile.packages.firefox
|
||||||
/*
|
|
||||||
gnome3.adwaita-icon-theme
|
|
||||||
gnome3.gnome-tweaks
|
|
||||||
gnome3.gnome-color-manager
|
|
||||||
gnome3.gnome-shell-extensions
|
|
||||||
|
|
||||||
gnomeExtensions.appindicator
|
|
||||||
gnomeExtensions.desktop-clock
|
|
||||||
gnomeExtensions.gtk4-desktop-icons-ng-ding
|
|
||||||
gnomeExtensions.compiz-windows-effect
|
|
||||||
gnomeExtensions.burn-my-windows
|
|
||||||
gnomeExtensions.user-themes
|
|
||||||
gnomeExtensions.gsconnect
|
|
||||||
gnomeExtensions.dash-to-panel
|
|
||||||
gnomeExtensions.dash-to-dock
|
|
||||||
*/
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
@ -308,148 +293,148 @@
|
||||||
|
|
||||||
environment.etc = {
|
environment.etc = {
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
"libvirt/hooks/qemu.d/win11/prepare/begin/start.sh" = {
|
"libvirt/hooks/qemu.d/win11/prepare/begin/start.sh" = {
|
||||||
text =
|
text =
|
||||||
''
|
''
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Debugging
|
# Debugging
|
||||||
exec 19>/home/materus/startlogfile
|
exec 19>/home/materus/startlogfile
|
||||||
BASH_XTRACEFD=19
|
BASH_XTRACEFD=19
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
exec 3>&1 4>&2
|
exec 3>&1 4>&2
|
||||||
trap 'exec 2>&4 1>&3' 0 1 2 3
|
trap 'exec 2>&4 1>&3' 0 1 2 3
|
||||||
exec 1>/home/materus/startlogfile.out 2>&1
|
exec 1>/home/materus/startlogfile.out 2>&1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Stop display manager
|
# Stop display manager
|
||||||
killall -u materus
|
killall -u materus
|
||||||
systemctl stop display-manager.service
|
systemctl stop display-manager.service
|
||||||
killall gdm-x-session
|
killall gdm-x-session
|
||||||
#systemctl isolate multi-user.target
|
#systemctl isolate multi-user.target
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
|
|
||||||
# Load variables we defined
|
# Load variables we defined
|
||||||
source "/etc/libvirt/hooks/kvm.conf"
|
source "/etc/libvirt/hooks/kvm.conf"
|
||||||
|
|
||||||
# Isolate host to core 0
|
# Isolate host to core 0
|
||||||
systemctl set-property --runtime -- user.slice AllowedCPUs=0
|
systemctl set-property --runtime -- user.slice AllowedCPUs=0
|
||||||
systemctl set-property --runtime -- system.slice AllowedCPUs=0
|
systemctl set-property --runtime -- system.slice AllowedCPUs=0
|
||||||
systemctl set-property --runtime -- init.scope AllowedCPUs=0
|
systemctl set-property --runtime -- init.scope AllowedCPUs=0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Unbind VTconsoles
|
# Unbind VTconsoles
|
||||||
for (( i = 0; i < 16; i++))
|
for (( i = 0; i < 16; i++))
|
||||||
do
|
do
|
||||||
if test -x /sys/class/vtconsole/vtcon"''${i}"; then
|
if test -x /sys/class/vtconsole/vtcon"''${i}"; then
|
||||||
if [ "$(grep -c "frame buffer" /sys/class/vtconsole/vtcon"''${i}"/name)" = 1 ]; then
|
if [ "$(grep -c "frame buffer" /sys/class/vtconsole/vtcon"''${i}"/name)" = 1 ]; then
|
||||||
echo 0 > /sys/class/vtconsole/vtcon"''${i}"/bind
|
echo 0 > /sys/class/vtconsole/vtcon"''${i}"/bind
|
||||||
echo "$DATE Unbinding Console ''${i}"
|
echo "$DATE Unbinding Console ''${i}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Unbind EFI Framebuffer
|
# Unbind EFI Framebuffer
|
||||||
echo "efi-framebuffer.0" > /sys/bus/platform/drivers/efi-framebuffer/unbind
|
echo "efi-framebuffer.0" > /sys/bus/platform/drivers/efi-framebuffer/unbind
|
||||||
|
|
||||||
# Avoid race condition
|
# Avoid race condition
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
# Unload NVIDIA kernel modules
|
# Unload NVIDIA kernel modules
|
||||||
modprobe -r nvidia_uvm
|
modprobe -r nvidia_uvm
|
||||||
modprobe -r nvidia_drm
|
modprobe -r nvidia_drm
|
||||||
modprobe -r nvidia_modeset
|
modprobe -r nvidia_modeset
|
||||||
modprobe -r nvidia
|
modprobe -r nvidia
|
||||||
modprobe -r i2c_nvidia_gpu
|
modprobe -r i2c_nvidia_gpu
|
||||||
modprobe -r drm_kms_helper
|
modprobe -r drm_kms_helper
|
||||||
modprobe -r drm
|
modprobe -r drm
|
||||||
|
|
||||||
# Detach GPU devices from host
|
# Detach GPU devices from host
|
||||||
#virsh nodedev-detach $VIRSH_GPU_VIDEO
|
#virsh nodedev-detach $VIRSH_GPU_VIDEO
|
||||||
#virsh nodedev-detach $VIRSH_GPU_AUDIO
|
#virsh nodedev-detach $VIRSH_GPU_AUDIO
|
||||||
#virsh nodedev-detach $VIRSH_GPU_USB
|
#virsh nodedev-detach $VIRSH_GPU_USB
|
||||||
#virsh nodedev-detach $VIRSH_GPU_SERIAL_BUS
|
#virsh nodedev-detach $VIRSH_GPU_SERIAL_BUS
|
||||||
|
|
||||||
# Load vfio module
|
# Load vfio module
|
||||||
modprobe vfio
|
modprobe vfio
|
||||||
modprobe vfio_pci
|
modprobe vfio_pci
|
||||||
modprobe vfio_iommu_type1
|
modprobe vfio_iommu_type1
|
||||||
'';
|
'';
|
||||||
mode = "0755";
|
mode = "0755";
|
||||||
};
|
};
|
||||||
|
|
||||||
"libvirt/hooks/qemu.d/win11/release/end/stop.sh" = {
|
"libvirt/hooks/qemu.d/win11/release/end/stop.sh" = {
|
||||||
text =
|
text =
|
||||||
''
|
''
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Debugging
|
# Debugging
|
||||||
exec 19>/home/materus/stoplogfile
|
exec 19>/home/materus/stoplogfile
|
||||||
BASH_XTRACEFD=19
|
BASH_XTRACEFD=19
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
exec 3>&1 4>&2
|
exec 3>&1 4>&2
|
||||||
trap 'exec 2>&4 1>&3' 0 1 2 3
|
trap 'exec 2>&4 1>&3' 0 1 2 3
|
||||||
exec 1>/home/materus/stoplogfile.out 2>&1
|
exec 1>/home/materus/stoplogfile.out 2>&1
|
||||||
|
|
||||||
# Load variables we defined
|
# Load variables we defined
|
||||||
source "/etc/libvirt/hooks/kvm.conf"
|
source "/etc/libvirt/hooks/kvm.conf"
|
||||||
|
|
||||||
# Unload vfio module
|
# Unload vfio module
|
||||||
modprobe -r vfio-pci
|
modprobe -r vfio-pci
|
||||||
modprobe -r vfio_iommu_type1
|
modprobe -r vfio_iommu_type1
|
||||||
modprobe -r vfio
|
modprobe -r vfio
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
modprobe drm
|
modprobe drm
|
||||||
modprobe drm_kms_helper
|
modprobe drm_kms_helper
|
||||||
modprobe i2c_nvidia_gpu
|
modprobe i2c_nvidia_gpu
|
||||||
modprobe nvidia
|
modprobe nvidia
|
||||||
modprobe nvidia_modeset
|
modprobe nvidia_modeset
|
||||||
modprobe nvidia_drm
|
modprobe nvidia_drm
|
||||||
modprobe nvidia_uvm
|
modprobe nvidia_uvm
|
||||||
|
|
||||||
# Attach GPU devices from host
|
# Attach GPU devices from host
|
||||||
#virsh nodedev-reattach $VIRSH_GPU_VIDEO
|
#virsh nodedev-reattach $VIRSH_GPU_VIDEO
|
||||||
#virsh nodedev-reattach $VIRSH_GPU_AUDIO
|
#virsh nodedev-reattach $VIRSH_GPU_AUDIO
|
||||||
#virsh nodedev-reattach $VIRSH_GPU_USB
|
#virsh nodedev-reattach $VIRSH_GPU_USB
|
||||||
#virsh nodedev-reattach $VIRSH_GPU_SERIAL_BUS
|
#virsh nodedev-reattach $VIRSH_GPU_SERIAL_BUS
|
||||||
|
|
||||||
#echo "0000:01:00.0" > /sys/bus/pci/drivers/nvidia/bind
|
#echo "0000:01:00.0" > /sys/bus/pci/drivers/nvidia/bind
|
||||||
# Bind EFI Framebuffer
|
# Bind EFI Framebuffer
|
||||||
echo "efi-framebuffer.0" > /sys/bus/platform/drivers/efi-framebuffer/bind
|
echo "efi-framebuffer.0" > /sys/bus/platform/drivers/efi-framebuffer/bind
|
||||||
|
|
||||||
# Bind VTconsoles
|
# Bind VTconsoles
|
||||||
echo 1 > /sys/class/vtconsole/vtcon0/bind
|
echo 1 > /sys/class/vtconsole/vtcon0/bind
|
||||||
#echo 1 > /sys/class/vtconsole/vtcon1/bind
|
#echo 1 > /sys/class/vtconsole/vtcon1/bind
|
||||||
|
|
||||||
|
|
||||||
# Start display manager
|
# Start display manager
|
||||||
sleep 1
|
sleep 1
|
||||||
systemctl start display-manager.service
|
systemctl start display-manager.service
|
||||||
|
|
||||||
# Return host to all cores
|
# Return host to all cores
|
||||||
systemctl set-property --runtime -- user.slice AllowedCPUs=0-3
|
systemctl set-property --runtime -- user.slice AllowedCPUs=0-3
|
||||||
systemctl set-property --runtime -- system.slice AllowedCPUs=0-3
|
systemctl set-property --runtime -- system.slice AllowedCPUs=0-3
|
||||||
systemctl set-property --runtime -- init.scope AllowedCPUs=0-3
|
systemctl set-property --runtime -- init.scope AllowedCPUs=0-3
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
text = ''
|
text = ''
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
reboot
|
reboot
|
||||||
'';*-/
|
'';*-/
|
||||||
mode = "0755";
|
mode = "0755";
|
||||||
};
|
};
|
||||||
"libvirt/vgabios/patched.rom".source = ./vbios.rom;
|
"libvirt/vgabios/patched.rom".source = ./vbios.rom;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
*/
|
*/
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
{ config, pkgs, lib, inputs, materusFlake, ... }:
|
{ config, pkgs, lib, inputs, materusFlake, ... }:
|
||||||
let
|
let
|
||||||
startHook = ''
|
startHook = ''
|
||||||
|
|
||||||
|
|
||||||
# Debugging
|
# Debugging
|
||||||
# exec 19>/home/materus/startlogfile
|
# exec 19>/home/materus/startlogfile
|
||||||
# BASH_XTRACEFD=19
|
# BASH_XTRACEFD=19
|
||||||
|
@ -10,10 +12,16 @@ let
|
||||||
# trap 'exec 2>&4 1>&3' 0 1 2 3
|
# trap 'exec 2>&4 1>&3' 0 1 2 3
|
||||||
# exec 1>/home/materus/startlogfile.out 2>&1
|
# exec 1>/home/materus/startlogfile.out 2>&1
|
||||||
|
|
||||||
|
# Make sure nothing renders on gpu to prevent "sysfs: cannot create duplicate filename" after rebinding to amdgpu
|
||||||
|
chmod 0 /dev/dri/renderD128
|
||||||
|
fuser -k /dev/dri/renderD128
|
||||||
|
|
||||||
|
# Seems to fix reset bug for 7900 XTX
|
||||||
|
echo "0" > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/d3cold_allowed"
|
||||||
|
|
||||||
systemctl stop mountWin10Share.service
|
systemctl stop mountWin10Share.service
|
||||||
sleep 1s
|
|
||||||
|
|
||||||
echo ''$VIRSH_GPU_VIDEO > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/driver/unbind"
|
echo ''$VIRSH_GPU_VIDEO > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/driver/unbind"
|
||||||
echo ''$VIRSH_GPU_AUDIO > "/sys/bus/pci/devices/''${VIRSH_GPU_AUDIO}/driver/unbind"
|
echo ''$VIRSH_GPU_AUDIO > "/sys/bus/pci/devices/''${VIRSH_GPU_AUDIO}/driver/unbind"
|
||||||
|
|
||||||
|
@ -23,6 +31,11 @@ let
|
||||||
echo "1" > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/resource2_resize"
|
echo "1" > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/resource2_resize"
|
||||||
|
|
||||||
|
|
||||||
|
systemctl set-property --runtime -- user.slice AllowedCPUs=12-15,28-31
|
||||||
|
systemctl set-property --runtime -- system.slice AllowedCPUs=12-15,28-31
|
||||||
|
systemctl set-property --runtime -- init.scope AllowedCPUs=12-15,28-31
|
||||||
|
|
||||||
|
|
||||||
'';
|
'';
|
||||||
stopHook = ''
|
stopHook = ''
|
||||||
|
|
||||||
|
@ -37,15 +50,17 @@ let
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
sleep 1s
|
||||||
echo ''$VIRSH_GPU_VIDEO > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/driver/unbind"
|
echo ''$VIRSH_GPU_VIDEO > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/driver/unbind"
|
||||||
echo ''$VIRSH_GPU_AUDIO > "/sys/bus/pci/devices/''${VIRSH_GPU_AUDIO}/driver/unbind"
|
echo ''$VIRSH_GPU_AUDIO > "/sys/bus/pci/devices/''${VIRSH_GPU_AUDIO}/driver/unbind"
|
||||||
|
|
||||||
|
|
||||||
sleep 1s
|
|
||||||
|
|
||||||
echo "15" > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/resource0_resize"
|
echo "15" > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/resource0_resize"
|
||||||
echo "8" > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/resource2_resize"
|
echo "8" > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/resource2_resize"
|
||||||
|
echo "1" > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/d3cold_allowed"
|
||||||
|
|
||||||
|
|
||||||
echo ''$VIRSH_GPU_VIDEO > /sys/bus/pci/drivers/amdgpu/bind
|
echo ''$VIRSH_GPU_VIDEO > /sys/bus/pci/drivers/amdgpu/bind
|
||||||
echo ''$VIRSH_GPU_AUDIO > /sys/bus/pci/drivers/snd_hda_intel/bind
|
echo ''$VIRSH_GPU_AUDIO > /sys/bus/pci/drivers/snd_hda_intel/bind
|
||||||
|
@ -53,6 +68,12 @@ let
|
||||||
|
|
||||||
systemctl start mountWin10Share.service
|
systemctl start mountWin10Share.service
|
||||||
|
|
||||||
|
systemctl set-property --runtime -- user.slice AllowedCPUs=0-31
|
||||||
|
systemctl set-property --runtime -- system.slice AllowedCPUs=0-31
|
||||||
|
systemctl set-property --runtime -- init.scope AllowedCPUs=0-31
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
@ -70,7 +91,7 @@ in
|
||||||
VIRSH_GPU_AUDIO="0000:03:00.1"
|
VIRSH_GPU_AUDIO="0000:03:00.1"
|
||||||
VIRSH_USB1="0000:10:00.0"
|
VIRSH_USB1="0000:10:00.0"
|
||||||
|
|
||||||
if [ ''$1 = "win10" ]; then
|
if [ ''$1 = "win10" ] || [ ''$1 = "win11" ]; then
|
||||||
if [ ''$2 = "prepare" ] && [ ''$3 = "begin" ]; then
|
if [ ''$2 = "prepare" ] && [ ''$3 = "begin" ]; then
|
||||||
${startHook}
|
${startHook}
|
||||||
fi
|
fi
|
||||||
|
@ -87,7 +108,7 @@ in
|
||||||
|
|
||||||
systemd.services.mountWin10Share = {
|
systemd.services.mountWin10Share = {
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
path = [ config.virtualisation.libvirtd.qemu.package pkgs.util-linux pkgs.kmod pkgs.coreutils ];
|
path = [ config.virtualisation.libvirtd.qemu.package pkgs.util-linux pkgs.kmod pkgs.coreutils pkgs.psmisc ];
|
||||||
serviceConfig.Type = "oneshot";
|
serviceConfig.Type = "oneshot";
|
||||||
serviceConfig.RemainAfterExit = true;
|
serviceConfig.RemainAfterExit = true;
|
||||||
script = ''
|
script = ''
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
# still possible to use this option, but it's recommended to use it in conjunction
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||||
networking.useDHCP = false;
|
networking.useDHCP = false;
|
||||||
networking.nameservers = [ "127.0.0.1" ];
|
networking.nameservers = [ "9.9.9.9" "1.1.1.1" "8.8.8.8" ];
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ in
|
||||||
config.nixpkgs.config = lib.mkIf cfg.enable{
|
config.nixpkgs.config = lib.mkIf cfg.enable{
|
||||||
allowUnfree = lib.mkDefault true;
|
allowUnfree = lib.mkDefault true;
|
||||||
joypixels.acceptLicense = lib.mkDefault true;
|
joypixels.acceptLicense = lib.mkDefault true;
|
||||||
firefox.enablePlasmaBrowserIntegration = lib.mkDefault true;
|
firefox.enablePlasmaBrowserIntegration = lib.mkDefault config.services.xserver.desktopManager.plasma5.enable;
|
||||||
};
|
};
|
||||||
config.nixpkgs.overlays = lib.mkIf cfg.enableOverlays [inputs.emacs-overlay.overlay];
|
config.nixpkgs.overlays = lib.mkIf cfg.enableOverlays [inputs.emacs-overlay.overlay];
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ with materusPkgs.lib;
|
||||||
tdesktop
|
tdesktop
|
||||||
mpv
|
mpv
|
||||||
ani-cli
|
ani-cli
|
||||||
(pkgs.obsidian.override {electron = pkgs.electron;})
|
(pkgs.obsidian)
|
||||||
spotify
|
spotify
|
||||||
thunderbird
|
thunderbird
|
||||||
keepassxc
|
keepassxc
|
||||||
|
|
|
@ -4,11 +4,12 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.materus.profile.editor.code.enable = materusPkgs.lib.mkBoolOpt config.materus.profile.enableDesktop "Enable VSCodium with materus cfg";
|
options.materus.profile.editor.code.enable = materusPkgs.lib.mkBoolOpt config.materus.profile.enableDesktop "Enable VSCodium with materus cfg";
|
||||||
|
options.materus.profile.editor.code.fhs.enable = materusPkgs.lib.mkBoolOpt false "Use fhs vscodium";
|
||||||
|
options.materus.profile.editor.code.fhs.packages = lib.mkOption { default = (ps: []);};
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
programs.vscode = {
|
programs.vscode = {
|
||||||
enable = lib.mkDefault true;
|
enable = lib.mkDefault true;
|
||||||
package = lib.mkDefault pkgs.vscodium;
|
package = lib.mkDefault (if (cfg.fhs.enable) then (pkgs.vscodium.fhsWithPackages cfg.fhs.packages) else pkgs.vscodium);
|
||||||
mutableExtensionsDir = lib.mkDefault true;
|
mutableExtensionsDir = lib.mkDefault true;
|
||||||
};
|
};
|
||||||
materus.profile.fonts.enable = lib.mkDefault true;
|
materus.profile.fonts.enable = lib.mkDefault true;
|
||||||
|
|
|
@ -1,10 +1,30 @@
|
||||||
{ config, pkgs, lib, materusPkgs, inputs, ... }:
|
{ config, pkgs, lib, materusPkgs, inputs, ... }:
|
||||||
let
|
let
|
||||||
|
optHip = pkgs.stdenv.mkDerivation rec {
|
||||||
|
pname = "optHip";
|
||||||
|
version = pkgs.hip.version;
|
||||||
|
|
||||||
|
|
||||||
|
dontFixup = true;
|
||||||
|
dontBuild = true;
|
||||||
|
dontPatchELF = true;
|
||||||
|
dontUnpack = true;
|
||||||
|
sourceRoot = ".";
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
pkgs.hip
|
||||||
|
];
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/opt/rocm
|
||||||
|
ln -s ${pkgs.hip} $out/opt/rocm/hip
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
steamPkg = pkgs.steam.override {
|
steamPkg = pkgs.steam.override {
|
||||||
extraPkgs = pkgs: [
|
extraPkgs = pkgs: [
|
||||||
config.materus.profile.packages.firefox
|
config.materus.profile.packages.firefox
|
||||||
|
optHip #for blender
|
||||||
pkgs.steamcmd
|
pkgs.steamcmd
|
||||||
pkgs.nss_latest
|
pkgs.nss_latest
|
||||||
pkgs.libstrangle
|
pkgs.libstrangle
|
||||||
|
|
Loading…
Reference in New Issue