From 2d35d8e272b4d5725c686be5d2b4436a55fe8141 Mon Sep 17 00:00:00 2001 From: Andrew Opalach Date: Sat, 11 Jan 2025 12:40:33 -0500 Subject: Update libvirt configs, laptop theme --- files/nvim/init.vim | 2 + flake.lock | 56 ++--- hosts/denpa/cgit/custom.css | 4 + hosts/iroha/grub_config | 77 +++++++ hosts/iroha/libvirt/hooks/arcade.conf | 7 +- hosts/iroha/libvirt/hooks/cpuset.conf | 4 +- hosts/iroha/libvirt/hooks/cpuset_release_common.sh | 1 + .../arcade/prepare/begin/cpuset_prepare_common.sh | 1 - .../qemu.d/arcade/prepare/begin/port_forward.sh | 14 -- .../arcade/release/end/cpuset_release_common.sh | 1 - .../hooks/qemu.d/arcade/release/end/port_close.sh | 14 -- .../hooks/qemu.d/corpa/prepare/begin/bind_vfio.sh | 16 ++ .../hooks/qemu.d/corpa/release/end/unbind_vfio.sh | 16 ++ hosts/iroha/libvirt/qemu/arcade.xml | 90 ++++---- hosts/iroha/libvirt/qemu/corpa-nogpu.xml | 237 +++++++++++++++++++++ hosts/iroha/libvirt/qemu/corpa.xml | 119 +++++------ hosts/iroha/libvirt/qemu/soy.xml | 7 - hosts/iroha/libvirt/qemu/xp.xml | 11 +- hosts/moyo/grub_config | 77 +++++++ hosts/moyo/libvirt/qemu/denpa.xml | 4 +- hosts/sofue/configuration.nix | 5 +- hosts/sofue/programs.nix | 3 +- hosts/yashinoki/configuration.nix | 23 +- nix/gaming.nix | 2 +- nix/programs/sway.nix | 2 +- nix/scripts.nix | 1 + nix/user.nix | 4 + nix/virtualisation.nix | 2 +- scripts/looking-glass | 2 + themes/year_of_snake/snake.nix | 23 ++ themes/year_of_snake/splash.kra | Bin 0 -> 1441596 bytes themes/year_of_snake/splash.png | Bin 0 -> 501920 bytes themes/year_of_snake/wallpaper.kra | Bin 0 -> 7984814 bytes themes/year_of_snake/wallpaper.png | Bin 0 -> 2346081 bytes 34 files changed, 621 insertions(+), 204 deletions(-) create mode 100644 hosts/iroha/grub_config delete mode 120000 hosts/iroha/libvirt/hooks/qemu.d/arcade/prepare/begin/cpuset_prepare_common.sh delete mode 100755 hosts/iroha/libvirt/hooks/qemu.d/arcade/prepare/begin/port_forward.sh delete mode 120000 hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/cpuset_release_common.sh delete mode 100755 hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/port_close.sh create mode 100755 hosts/iroha/libvirt/hooks/qemu.d/corpa/prepare/begin/bind_vfio.sh create mode 100755 hosts/iroha/libvirt/hooks/qemu.d/corpa/release/end/unbind_vfio.sh create mode 100644 hosts/iroha/libvirt/qemu/corpa-nogpu.xml create mode 100644 hosts/moyo/grub_config create mode 100755 scripts/looking-glass create mode 100644 themes/year_of_snake/snake.nix create mode 100644 themes/year_of_snake/splash.kra create mode 100644 themes/year_of_snake/splash.png create mode 100644 themes/year_of_snake/wallpaper.kra create mode 100644 themes/year_of_snake/wallpaper.png diff --git a/files/nvim/init.vim b/files/nvim/init.vim index aa6cd7d..6bbb558 100644 --- a/files/nvim/init.vim +++ b/files/nvim/init.vim @@ -244,6 +244,8 @@ vim.keymap.set('n', 'K', '', { silent = true }) vim.keymap.set('n', 'L', '', { silent = true }) -- Normal mode tab no-op. vim.keymap.set('n', '', '', { silent = true }) +-- ctrl + c no-op. +vim.keymap.set('n', '', '', { silent = true }) -- Disable F1 for help. vim.keymap.set('n', '', '', { silent = true }) -- Disable q: for histroy. diff --git a/flake.lock b/flake.lock index 45b6c4d..8b088f1 100644 --- a/flake.lock +++ b/flake.lock @@ -35,11 +35,11 @@ ] }, "locked": { - "lastModified": 1736112920, - "narHash": "sha256-MME0HoMWJtk67vW4lop1eTK4//EXJB/hefo6+JbdHZs=", + "lastModified": 1736524793, + "narHash": "sha256-UEbNwGorRiNLtzhshxe/2J2BmwGI1cDCDhSYtY8qREU=", "owner": "chaotic-cx", "repo": "nyx", - "rev": "aa7b9944e164d9284939b78d05b8cf8df319a5d5", + "rev": "38844e9b3e17948a66b0dea0ce0bcc0355d6d876", "type": "github" }, "original": { @@ -198,11 +198,11 @@ ] }, "locked": { - "lastModified": 1736066484, - "narHash": "sha256-uTstP36WaFrw+TEHb8nLF14hFPzQBOhmIxzioHCDaL8=", + "lastModified": 1736421950, + "narHash": "sha256-RyrX0WFXxFrYvzHNLTIyuk3NcNl3UBykuYru/P0zW5E=", "owner": "nix-community", "repo": "home-manager", - "rev": "5ad12b6ea06b84e48f6b677957c74f32d47bdee0", + "rev": "d4aebb947a301b8da8654a804979a738c5c5da50", "type": "github" }, "original": { @@ -218,11 +218,11 @@ ] }, "locked": { - "lastModified": 1736204492, - "narHash": "sha256-CoBPRgkUex9Iz6qGSzi/BFVUQjndB0PmME2B6eEyeCs=", + "lastModified": 1736508663, + "narHash": "sha256-ZOaGwa+WnB7Zn3YXimqjmIugAnHePdXCmNu+AHkq808=", "owner": "nix-community", "repo": "home-manager", - "rev": "20665c6efa83d71020c8730f26706258ba5c6b2a", + "rev": "2532b500c3ed2b8940e831039dcec5a5ea093afc", "type": "github" }, "original": { @@ -240,11 +240,11 @@ ] }, "locked": { - "lastModified": 1735931035, - "narHash": "sha256-f3WRxasPYVKzrvAlLq+/3FRHQVfxVf5xxf0WWwnO99k=", + "lastModified": 1736409493, + "narHash": "sha256-XezBEaGENmXgndx2gsVxQ0JoHUeQs9OSUZvVx/GDqyQ=", "owner": "Jovian-Experiments", "repo": "Jovian-NixOS", - "rev": "7e530766a5fd9b7577296fedd655f3255f7495d8", + "rev": "9a958cc0aa5241ea3badf44a063a4b0389dc0110", "type": "github" }, "original": { @@ -397,11 +397,11 @@ }, "nixos-hardware_2": { "locked": { - "lastModified": 1736237814, - "narHash": "sha256-uTdscVaKjnRnBIMuu/oWwdiGhYd/JOQ4YZGHeCoroqs=", + "lastModified": 1736441705, + "narHash": "sha256-OL7leZ6KBhcDF3nEKe4aZVfIm6xQpb1Kb+mxySIP93o=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "ca30f8501ab452ca687a7fdcb2d43e1fb1732317", + "rev": "8870dcaff63dfc6647fb10648b827e9d40b0a337", "type": "github" }, "original": { @@ -473,11 +473,11 @@ ] }, "locked": { - "lastModified": 1736274403, - "narHash": "sha256-gOd1twminF/G/kX3zRmxXL39+0bF6BaVapOdvf8K8oY=", + "lastModified": 1736512664, + "narHash": "sha256-/vw0//f1FAwpy6eY3qLGohgohuLWYBDw+iy34wL6M/M=", "owner": "nix-community", "repo": "nixpkgs-wayland", - "rev": "8411b42979359adfbcc78b2a3daadfb1c661817e", + "rev": "ce4056d912438ae120814431657c0d8ef88b0b2f", "type": "github" }, "original": { @@ -488,11 +488,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1736012469, - "narHash": "sha256-/qlNWm/IEVVH7GfgAIyP6EsVZI6zjAx1cV5zNyrs+rI=", + "lastModified": 1736344531, + "narHash": "sha256-8YVQ9ZbSfuUk2bUf2KRj60NRraLPKPS0Q4QFTbc+c2c=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8f3e1f807051e32d8c95cd12b9b421623850a34d", + "rev": "bffc22eb12172e6db3c5dde9e3e5628f8e3e7912", "type": "github" }, "original": { @@ -527,11 +527,11 @@ "treefmt-nix": "treefmt-nix_2" }, "locked": { - "lastModified": 1736268958, - "narHash": "sha256-O3cfbKgDb8A5VsUN0fPVpNf2EEFO5itnbkTYP+Vsuto=", + "lastModified": 1736538354, + "narHash": "sha256-qPgUE5K/qcgzpQRHzruAgwT/7SCSAOUOyK1qyofe0TY=", "owner": "nix-community", "repo": "NUR", - "rev": "706045eb80f347d5418e81c5aa80d6c410394991", + "rev": "80b24eed6e716dc5a31a360f8465636a7a2a990f", "type": "github" }, "original": { @@ -650,11 +650,11 @@ }, "locked": { "dir": "packaging/nix", - "lastModified": 1736271378, - "narHash": "sha256-j1TqXcffjqp/xmWvY9j4Johj1AdKiGXv94pNZHXEz6Y=", + "lastModified": 1736534482, + "narHash": "sha256-aHDxVKA4GgohIPCDUX9zMF4UnLQR7U6Dj9mOmhZYSoc=", "ref": "refs/heads/main", - "rev": "f423d6683cac7037333fbf38db8d0cc94c984fda", - "revCount": 880, + "rev": "e9cb4d764013d4c8c3d1166f59581da8f56a3d83", + "revCount": 896, "submodules": true, "type": "git", "url": "https://github.com/Open-Wine-Components/umu-launcher/?dir=packaging/nix" diff --git a/hosts/denpa/cgit/custom.css b/hosts/denpa/cgit/custom.css index 29a2080..2bcabe9 100644 --- a/hosts/denpa/cgit/custom.css +++ b/hosts/denpa/cgit/custom.css @@ -82,6 +82,10 @@ a:hover { color: rgb(var(--highlight1)) !important; } +ul { + padding-left: 2rem; +} + code { background-color: var(--color1); } diff --git a/hosts/iroha/grub_config b/hosts/iroha/grub_config new file mode 100644 index 0000000..dced1d3 --- /dev/null +++ b/hosts/iroha/grub_config @@ -0,0 +1,77 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 +# +# To populate all changes in this file you need to regenerate your +# grub configuration file afterwards: +# 'grub-mkconfig -o /boot/grub/grub.cfg' +# +# See the grub info page for documentation on possible variables and +# their associated values. + +GRUB_DISTRIBUTOR="Gentoo" + +# Default menu entry +#GRUB_DEFAULT=0 + +# Boot the default entry this many seconds after the menu is displayed +#GRUB_TIMEOUT=5 +#GRUB_TIMEOUT_STYLE=menu + +# Append parameters to the linux kernel command line +GRUB_CMDLINE_LINUX="quiet text rd.lvm.vg=iroha-vg0" +# +# Examples: +# +# Boot with network interface renaming disabled +# GRUB_CMDLINE_LINUX="net.ifnames=0" +# +# Boot with systemd instead of sysvinit (openrc) +# GRUB_CMDLINE_LINUX="init=/usr/lib/systemd/systemd" + +# Append parameters to the linux kernel command line for non-recovery entries +# default_hugepagesz=1G hugepagesz=1G hugepages=48 +GRUB_CMDLINE_LINUX_DEFAULT="nowatchdog nmi_watchdog=0 amd_pstate=guided amd_iommu=on iommu=pt kvm.ignore_msrs=1 kvm.report_ignored_msrs=0 pcie_no_flr=1022:149c acpi_enforce_resources=lax amdgpu.ppfeaturemask=0xffffffff i915.force_probe=!56a0 xe.force_probe=56a0 psi=1 mitigations=off" + +# Uncomment to disable graphical terminal (grub-pc only) +#GRUB_TERMINAL=console + +# The resolution used on graphical terminal. +# Note that you can use only modes which your graphic card supports via VBE. +# You can see them in real GRUB with the command `vbeinfo'. +#GRUB_GFXMODE=640x480 + +# Set to 'text' to force the Linux kernel to boot in normal text +# mode, 'keep' to preserve the graphics mode set using +# 'GRUB_GFXMODE', 'WIDTHxHEIGHT'['xDEPTH'] to set a particular +# graphics mode, or a sequence of these separated by commas or +# semicolons to try several modes in sequence. +#GRUB_GFXPAYLOAD_LINUX= + +# Path to theme spec txt file. +# The starfield is by default provided with use truetype. +# NOTE: when enabling custom theme, ensure you have required font/etc. +#GRUB_THEME="/boot/grub/themes/starfield/theme.txt" + +# Background image used on graphical terminal. +# Can be in various bitmap formats. +#GRUB_BACKGROUND="/boot/grub/mybackground.png" + +# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel +#GRUB_DISABLE_LINUX_UUID=true + +# Comment if you don't want GRUB to pass "root=PARTUUID=xxx" parameter to kernel +GRUB_DISABLE_LINUX_PARTUUID=false + +# Uncomment to disable generation of recovery mode menu entries +#GRUB_DISABLE_RECOVERY=true + +# Uncomment to disable generation of the submenu and put all choices on +# the top-level menu. +# Besides the visual affect of no sub menu, this makes navigation of the +# menu easier for a user who can't see the screen. +#GRUB_DISABLE_SUBMENU=y + +# Uncomment to play a tone when the main menu is displayed. +# This is useful, for example, to allow users who can't see the screen +# to know when they can make a choice on the menu. +#GRUB_INIT_TUNE="60 800 1" diff --git a/hosts/iroha/libvirt/hooks/arcade.conf b/hosts/iroha/libvirt/hooks/arcade.conf index 4282629..acbc430 100644 --- a/hosts/iroha/libvirt/hooks/arcade.conf +++ b/hosts/iroha/libvirt/hooks/arcade.conf @@ -1,4 +1,3 @@ -VIRSH_GPU_VIDEO=pci_0000_0f_00_0 -VIRSH_GPU_AUDIO=pci_0000_0f_00_1 -VIRSH_USB=pci_0000_03_00_0 -VIRSH_NVME=pci_0000_0e_00_0 +VIRSH_GPU_VIDEO=pci_0000_10_00_0 +VIRSH_GPU_AUDIO=pci_0000_10_00_1 +VIRSH_USB=pci_0000_12_00_3 diff --git a/hosts/iroha/libvirt/hooks/cpuset.conf b/hosts/iroha/libvirt/hooks/cpuset.conf index d208294..74cb68b 100644 --- a/hosts/iroha/libvirt/hooks/cpuset.conf +++ b/hosts/iroha/libvirt/hooks/cpuset.conf @@ -1,6 +1,6 @@ TOTAL_CORES='0-23' # 3900X: 12-core, 24-thread cpu -HOST_CORES='0-4,12-16' -VIRT_CORES0='5-11,17-23' +HOST_CORES='6-11,18-23' +VIRT_CORES0='0-5,12-17' MEMNODES='0' CPUSET_REFCOUNT=/tmp/cpuset-ref diff --git a/hosts/iroha/libvirt/hooks/cpuset_release_common.sh b/hosts/iroha/libvirt/hooks/cpuset_release_common.sh index 624fa5b..d30a3d6 100755 --- a/hosts/iroha/libvirt/hooks/cpuset_release_common.sh +++ b/hosts/iroha/libvirt/hooks/cpuset_release_common.sh @@ -25,6 +25,7 @@ fi for i in blkio cpu cpuacct cpuset devices freezer memory net_cls perf_event; do rmdir ${CGROUP}/$i/machine/${PARTNAME0}.partition + rmdir ${CGROUP}/$i/machine/${PARTNAME1}.partition done /bin/echo ${TOTAL_CORES} > ${CPUSET}/machine/cpuset.cpus diff --git a/hosts/iroha/libvirt/hooks/qemu.d/arcade/prepare/begin/cpuset_prepare_common.sh b/hosts/iroha/libvirt/hooks/qemu.d/arcade/prepare/begin/cpuset_prepare_common.sh deleted file mode 120000 index fb5a2ab..0000000 --- a/hosts/iroha/libvirt/hooks/qemu.d/arcade/prepare/begin/cpuset_prepare_common.sh +++ /dev/null @@ -1 +0,0 @@ -../../../../cpuset_prepare_common.sh \ No newline at end of file diff --git a/hosts/iroha/libvirt/hooks/qemu.d/arcade/prepare/begin/port_forward.sh b/hosts/iroha/libvirt/hooks/qemu.d/arcade/prepare/begin/port_forward.sh deleted file mode 100755 index 7d5d484..0000000 --- a/hosts/iroha/libvirt/hooks/qemu.d/arcade/prepare/begin/port_forward.sh +++ /dev/null @@ -1,14 +0,0 @@ -#! /usr/bin/env bash - -# kdeconnect -iptables -t nat -C PREROUTING -p tcp -s 192.168.1.0/24 --dport 1714:1764 \ - -j DNAT --to-destination 192.168.122.40:1714-1764 || \ -iptables -t nat -A PREROUTING -p tcp -s 192.168.1.0/24 --dport 1714:1764 \ - -j DNAT --to-destination 192.168.122.40:1714-1764 -iptables -t nat -C PREROUTING -p udp -s 192.168.1.0/24 --dport 1714:1764 \ - -j DNAT --to-destination 192.168.122.40:1714-1764 || \ -iptables -t nat -A PREROUTING -p udp -s 192.168.1.0/24 --dport 1714:1764 \ - -j DNAT --to-destination 192.168.122.40:1714-1764 - -iptables -C FORWARD -m state -d 192.168.122.0/24 --state NEW,RELATED,ESTABLISHED -j ACCEPT || \ -iptables -I FORWARD -m state -d 192.168.122.0/24 --state NEW,RELATED,ESTABLISHED -j ACCEPT diff --git a/hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/cpuset_release_common.sh b/hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/cpuset_release_common.sh deleted file mode 120000 index d823a60..0000000 --- a/hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/cpuset_release_common.sh +++ /dev/null @@ -1 +0,0 @@ -../../../../cpuset_release_common.sh \ No newline at end of file diff --git a/hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/port_close.sh b/hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/port_close.sh deleted file mode 100755 index 0d58fa7..0000000 --- a/hosts/iroha/libvirt/hooks/qemu.d/arcade/release/end/port_close.sh +++ /dev/null @@ -1,14 +0,0 @@ -#! /usr/bin/env bash - -# kdeconnect (remove) -iptables -t nat -C PREROUTING -p tcp -s 192.168.1.0/24 --dport 1714:1764 \ - -j DNAT --to-destination 192.168.122.40:1714-1764 || \ -iptables -t nat -D PREROUTING -p tcp -s 192.168.1.0/24 --dport 1714:1764 \ - -j DNAT --to-destination 192.168.122.40:1714-1764 -iptables -t nat -C PREROUTING -p udp -s 192.168.1.0/24 --dport 1714:1764 \ - -j DNAT --to-destination 192.168.122.40:1714-1764 || \ -iptables -t nat -D PREROUTING -p udp -s 192.168.1.0/24 --dport 1714:1764 \ - -j DNAT --to-destination 192.168.122.40:1714-1764 - -iptables -C FORWARD -m state -d 192.168.122.0/24 --state NEW,RELATED,ESTABLISHED -j ACCEPT || \ -iptables -D FORWARD -m state -d 192.168.122.0/24 --state NEW,RELATED,ESTABLISHED -j ACCEPT diff --git a/hosts/iroha/libvirt/hooks/qemu.d/corpa/prepare/begin/bind_vfio.sh b/hosts/iroha/libvirt/hooks/qemu.d/corpa/prepare/begin/bind_vfio.sh new file mode 100755 index 0000000..3c602c5 --- /dev/null +++ b/hosts/iroha/libvirt/hooks/qemu.d/corpa/prepare/begin/bind_vfio.sh @@ -0,0 +1,16 @@ +#! /usr/bin/env bash + +source "/etc/libvirt/hooks/arcade.conf" + +modprobe -r nvidia-drm +modprobe -r nvidia-modeset +modprobe -r nvidia-uvm +modprobe -r nvidia + +modprobe vfio +modprobe vfio_iommu_type1 +modprobe vfio_pci + +virsh nodedev-detach $VIRSH_GPU_VIDEO +virsh nodedev-detach $VIRSH_GPU_AUDIO +virsh nodedev-detach $VIRSH_USB diff --git a/hosts/iroha/libvirt/hooks/qemu.d/corpa/release/end/unbind_vfio.sh b/hosts/iroha/libvirt/hooks/qemu.d/corpa/release/end/unbind_vfio.sh new file mode 100755 index 0000000..e3b1234 --- /dev/null +++ b/hosts/iroha/libvirt/hooks/qemu.d/corpa/release/end/unbind_vfio.sh @@ -0,0 +1,16 @@ +#! /usr/bin/env bash + +source "/etc/libvirt/hooks/arcade.conf" + +virsh nodedev-reattach $VIRSH_GPU_VIDEO +virsh nodedev-reattach $VIRSH_GPU_AUDIO +virsh nodedev-reattach $VIRSH_USB + +modprobe -r vfio_pci +modprobe -r vfio_iommu_type1 +modprobe -r vfio + +modprobe nvidia-drm +modprobe nvidia-modeset +modprobe nvidia-uvm +modprobe nvidia diff --git a/hosts/iroha/libvirt/qemu/arcade.xml b/hosts/iroha/libvirt/qemu/arcade.xml index 79e9216..5280dc9 100644 --- a/hosts/iroha/libvirt/qemu/arcade.xml +++ b/hosts/iroha/libvirt/qemu/arcade.xml @@ -7,7 +7,7 @@ or other application using the libvirt API. arcade - 0ccf2904-b393-41b0-98a6-3c8722efdc94 + ddc28570-735e-0000-0000-000000000000 @@ -15,10 +15,8 @@ or other application using the libvirt API. 16777216 16777216 - - - - 6 + 12 + 1 @@ -26,36 +24,43 @@ or other application using the libvirt API. + + + + + + + + + + + + + + + + + + + + + - hvm + hvm - /usr/share/edk2-ovmf/OVMF_CODE.fd - /var/lib/libvirt/qemu/nvram/arcade_VARS.fd + /usr/share/edk2-ovmf/OVMF_CODE.fd + /var/lib/libvirt/qemu/nvram/arcade_VARS.fd - - - - - - - - - - - - - - - - + + @@ -64,20 +69,21 @@ or other application using the libvirt API. - - + + + - - + + destroy @@ -89,6 +95,14 @@ or other application using the libvirt API. /usr/bin/qemu-system-x86_64 + + + + + WD_BLACK_SN770_1TB_230423802979_1 + +
+ @@ -172,15 +186,12 @@ or other application using the libvirt API.
- -
-
- + - +
@@ -192,26 +203,19 @@ or other application using the libvirt API.