configurations: update

This commit is contained in:
Mateusz Słodkowicz 2023-08-31 11:01:38 +02:00
parent 5748882088
commit dacf1e1fe8
Signed by: materus
GPG Key ID: 28D140BCA60B4FD1
8 changed files with 91 additions and 95 deletions

View File

@ -157,9 +157,9 @@
services.openssh.enable = true; services.openssh.enable = true;
# Open ports in the firewall. # Open ports in the firewall.
networking.firewall.allowedTCPPorts = [ 22 27015 25565 24454 ]; networking.firewall.allowedTCPPorts = [ 22 27015 25565 24454 8123 ];
networking.firewall.allowedTCPPortRanges = [{ from = 16262; to = 16272; }]; networking.firewall.allowedTCPPortRanges = [{ from = 16262; to = 16272; }];
networking.firewall.allowedUDPPorts = [ 22 16261 16262 8766 8767 25565 24454 ]; networking.firewall.allowedUDPPorts = [ 22 16261 16262 8766 8767 25565 24454 8123 ];
# Or disable the firewall altogether. # Or disable the firewall altogether.
networking.firewall.enable = true; networking.firewall.enable = true;

View File

@ -16,7 +16,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
pkg.linux-firmware linux-firmware
alsa-firmware alsa-firmware
sof-firmware sof-firmware
]; ];

View File

@ -1,8 +1,8 @@
{ config, pkgs, lib, inputs, materusFlake, materusPkgs, ... }: { config, pkgs, lib, inputs, materusFlake, materusPkgs, ... }:
{ {
virtualisation.lxc.enable = true; virtualisation.lxc.enable = false;
virtualisation.lxc.lxcfs.enable = true; virtualisation.lxc.lxcfs.enable = false;
virtualisation.lxd.enable = true; virtualisation.lxd.enable = false;
#virtualisation.lxd.recommendedSysctlSettings = true; #virtualisation.lxd.recommendedSysctlSettings = true;
programs.corectrl.enable = true; programs.corectrl.enable = true;
@ -83,7 +83,7 @@
services.xserver.libinput.enable = true; services.xserver.libinput.enable = true;
virtualisation.waydroid.enable = true; virtualisation.waydroid.enable = false;
virtualisation.podman = { virtualisation.podman = {
enable = true; enable = true;
#enableNvidia = true; #enableNvidia = true;
@ -220,7 +220,7 @@
aspellDicts.pl aspellDicts.pl
aspellDicts.en aspellDicts.en
aspellDicts.en-computers aspellDicts.en-computers
steamtinkerlaunch
distrobox distrobox
p7zip p7zip
@ -302,10 +302,7 @@
system.activationScripts.libvirt-hooks.text =
''
ln -Tfs /etc/libvirt/hooks /var/lib/libvirt/hooks
'';

View File

@ -4,40 +4,6 @@
./win10 ./win10
]; ];
system.activationScripts.libvirt-hooks.text =
''
ln -Tfs /etc/libvirt/hooks /var/lib/libvirt/hooks
'';
environment.etc."libvirt/hooks/qemu" = {
text =
''
#!${pkgs.bash}/bin/bash
GUEST_NAME="''$1"
HOOK_NAME="''$2"
STATE_NAME="''$3"
MISC="''${@:4}"
BASEDIR="''$(dirname ''$0)"
HOOKPATH="''$BASEDIR/qemu.d/''$GUEST_NAME/''$HOOK_NAME/''$STATE_NAME"
set -e # If a script exits with an error, we should as well.
# check if it's a non-empty executable file
if [ -f "''$HOOKPATH" ] && [ -s "''$HOOKPATH"] && [ -x "''$HOOKPATH" ]; then
eval \"''$HOOKPATH\" "$@"
elif [ -d "''$HOOKPATH" ]; then
while read file; do
# check for null string
if [ ! -z "''$file" ]; then
eval \"''$file\" "''$@"
fi
done <<< "''$(find -L "''$HOOKPATH" -maxdepth 1 -type f -executable -print;)"
fi
'';
mode = "0755";
};
virtualisation.libvirtd = { virtualisation.libvirtd = {
enable = true; enable = true;
@ -50,6 +16,8 @@
qemu.package = pkgs.qemu_full; qemu.package = pkgs.qemu_full;
}; };
virtualisation.spiceUSBRedirection.enable = true;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
virtiofsd virtiofsd
config.virtualisation.libvirtd.qemu.package config.virtualisation.libvirtd.qemu.package

View File

@ -1,63 +1,90 @@
{ config, pkgs, lib, inputs, materusFlake, ... }: { config, pkgs, lib, inputs, materusFlake, ... }:
let
startHook = ''
# Debugging
# exec 19>/home/materus/startlogfile
# BASH_XTRACEFD=19
# set -x
# exec 3>&1 4>&2
# trap 'exec 2>&4 1>&3' 0 1 2 3
# exec 1>/home/materus/startlogfile.out 2>&1
systemctl stop mountWin10Share.service
sleep 1s
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"
sleep 1s
echo "8" > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/resource0_resize"
echo "1" > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/resource2_resize"
'';
stopHook = ''
# Debugging
# exec 19>/home/materus/stoplogfile
# BASH_XTRACEFD=19
# set -x
# exec 3>&1 4>&2
# trap 'exec 2>&4 1>&3' 0 1 2 3
# exec 1>/home/materus/stoplogfile.out 2>&1
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"
sleep 1s
echo "15" > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/resource0_resize"
echo "8" > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/resource2_resize"
echo ''$VIRSH_GPU_VIDEO > /sys/bus/pci/drivers/amdgpu/bind
echo ''$VIRSH_GPU_AUDIO > /sys/bus/pci/drivers/snd_hda_intel/bind
systemctl start mountWin10Share.service
'';
in
{ {
environment.etc = {
"libvirt/hooks/kvm.conf" = {
text =
''
VIRSH_GPU_VIDEO="0000:03:00.0"
VIRSH_GPU_AUDIO="0000:03:00.1"
'';
mode = "0755";
};
"libvirt/hooks/qemu.d/win10/prepare/begin/start.sh" = {
text = ''
#!${pkgs.bash}/bin/bash
source /etc/libvirt/hooks/kvm.conf
systemctl stop mountWin10Share.service
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"
sleep 1s
echo "8" > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/resource0_resize" virtualisation.libvirtd.hooks.qemu = {
echo "1" > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/resource2_resize" "win10" = pkgs.writeShellScript "win10.sh" ''
VIRSH_GPU_VIDEO="0000:03:00.0"
VIRSH_GPU_AUDIO="0000:03:00.1"
VIRSH_USB1="0000:10:00.0"
''; if [ ''$1 = "win10" ]; then
mode = "0755"; if [ ''$2 = "prepare" ] && [ ''$3 = "begin" ]; then
}; ${startHook}
fi
"libvirt/hooks/qemu.d/win10/release/end/stop.sh" = { if [ ''$2 = "release" ] && [ ''$3 = "end" ]; then
text = '' ${stopHook}
#!${pkgs.bash}/bin/bash fi
source /etc/libvirt/hooks/kvm.conf
fi
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" '';
sleep 1s
echo "15" > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/resource0_resize"
echo "8" > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/resource2_resize"
echo ''$VIRSH_GPU_VIDEO > /sys/bus/pci/drivers/amdgpu/bind
echo ''$VIRSH_GPU_AUDIO > /sys/bus/pci/drivers/snd_hda_intel/bind
systemctl start mountWin10Share.service
'';
mode = "0755";
};
}; };
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 ];

View File

@ -6,8 +6,8 @@ in
options= let mkBoolOpt = materusPkgs.lib.mkBoolOpt; in{ options= let mkBoolOpt = materusPkgs.lib.mkBoolOpt; in{
materus.profile.browser.firefox.enable = mkBoolOpt config.materus.profile.enableDesktop "Enable Firefox with materus cfg"; materus.profile.browser.firefox.enable = mkBoolOpt config.materus.profile.enableDesktop "Enable Firefox with materus cfg";
materus.profile.browser.vivaldi.enable = mkBoolOpt false "Enable Vivaldi with materus cfg"; materus.profile.browser.vivaldi.enable = mkBoolOpt config.materus.profile.enableDesktop "Enable Vivaldi with materus cfg";
materus.profile.browser.brave.enable = mkBoolOpt config.materus.profile.enableDesktop "Enable Brave with materus cfg"; materus.profile.browser.brave.enable = mkBoolOpt false "Enable Brave with materus cfg";
}; };
#TODO: Make some config #TODO: Make some config

View File

@ -1,4 +1,4 @@
{ config, pkgs, lib, materusFlake, materusPkgs, ... }: { config, pkgs, lib, materusFlake, materusPkgs, options, ... }:
let let
p10kcfg = "${zshcfg}/p10kcfg"; p10kcfg = "${zshcfg}/p10kcfg";
zshcfg = "${materusFlake.path}/extraFiles/config/zsh"; zshcfg = "${materusFlake.path}/extraFiles/config/zsh";
@ -22,7 +22,7 @@ in
programs.zsh = { programs.zsh = {
enable = true; enable = true;
enableAutosuggestions = true; enableAutosuggestions = true;
syntaxHighlighting.enable = true; enableSyntaxHighlighting = true;
enableVteIntegration = true; enableVteIntegration = true;
historySubstringSearch.enable = true; historySubstringSearch.enable = true;
historySubstringSearch.searchUpKey = ";5A"; historySubstringSearch.searchUpKey = ";5A";

View File

@ -27,8 +27,12 @@ let
pkgs.xorg.xcbutilerrors pkgs.xorg.xcbutilerrors
pkgs.xorg.xcbutilrenderutil pkgs.xorg.xcbutilrenderutil
pkgs.xorg.xcbutil pkgs.xorg.xcbutil
pkgs.xorg.xwininfo
pkgs.yad
pkgs.xdotool
pkgs.libinput pkgs.libinput
pkgs.openvdb pkgs.openvdb
pkgs.openssl
pkgs.tbb_2021_8 pkgs.tbb_2021_8
pkgs.gtk4 pkgs.gtk4
pkgs.gtk3 pkgs.gtk3
@ -42,7 +46,7 @@ let
pkgs.tdb pkgs.tdb
pkgs.jbig2enc pkgs.jbig2enc
pkgs.jbig2dec pkgs.jbig2dec
pkgs.brave pkgs.vivaldi
] ++ config.materus.profile.packages.list.fonts; ] ++ config.materus.profile.packages.list.fonts;