From 1e83c8adf7d94d603eab7e4de978f96ceedc6902 Mon Sep 17 00:00:00 2001 From: materus Date: Thu, 10 Jul 2025 19:39:04 +0200 Subject: [PATCH] update --- .../host/materusPC/hardware/boot.nix | 2 +- .../host/materusPC/home/materus/plasma.nix | 2 +- .../host/materusPC/vm/win-vfio/default.nix | 30 ++-- configurations/profile/home/editor/code.nix | 1 + extraFiles/config/emacs/EMACS-CONFIG.org | 27 ++-- extraFiles/config/emacs/init.el | 25 ++-- flake.lock | 132 ++++++++---------- 7 files changed, 105 insertions(+), 114 deletions(-) diff --git a/configurations/host/materusPC/hardware/boot.nix b/configurations/host/materusPC/hardware/boot.nix index 2148f9f..f196c93 100644 --- a/configurations/host/materusPC/hardware/boot.nix +++ b/configurations/host/materusPC/hardware/boot.nix @@ -33,7 +33,7 @@ in "nvme_core.shutdown_timeout=10" "amd_iommu=on" "amdgpu.ppfeaturemask=0xffffffff" - "amdgpu.runpm=0" + #"amdgpu.runpm=0" "iommu=pt" "psi=1" "i915.force_probe=!56a6" diff --git a/configurations/host/materusPC/home/materus/plasma.nix b/configurations/host/materusPC/home/materus/plasma.nix index b840ada..624b64c 100644 --- a/configurations/host/materusPC/home/materus/plasma.nix +++ b/configurations/host/materusPC/home/materus/plasma.nix @@ -124,7 +124,7 @@ "dolphinrc"."General"."RememberOpenedTabs" = false; - "kwalletrc"."Wallet"."Enabled" = false; + "kwalletrc"."Wallet"."Enabled" = true; }; dataFile = { diff --git a/configurations/host/materusPC/vm/win-vfio/default.nix b/configurations/host/materusPC/vm/win-vfio/default.nix index 6f7a57e..45f9c3d 100644 --- a/configurations/host/materusPC/vm/win-vfio/default.nix +++ b/configurations/host/materusPC/vm/win-vfio/default.nix @@ -44,6 +44,8 @@ let systemctl stop windows-share-mount.service # Make sure nothing renders on gpu to prevent "sysfs: cannot create duplicate filename" after rebinding to amdgpu + echo remove > /sys/bus/pci/devices/$VIRSH_GPU_VIDEO/drm/card*/uevent + sleep 2s chmod 0 /dev/dri/by-path/pci-$VIRSH_GPU_VIDEO-render chmod 0 /dev/dri/by-path/pci-$VIRSH_GPU_VIDEO-card fuser -k /dev/dri/by-path/pci-$VIRSH_GPU_VIDEO-render @@ -57,19 +59,19 @@ let # Weird bug on kernel 6.7+, after changing bar sizes and binding to vfio driver, performance after returning to host will be lower than expected # binding to amdgpu after changing bar sizes and binding after it to vfio will work as expected. # I could skip changing bar sizes since I'm able to use full bar, but keeping it just in case - echo ''$VIRSH_GPU_VIDEO > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/driver/unbind" - sleep 1s - echo "${bar0_host}" > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/resource0_resize" - echo "${bar2_host}" > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/resource2_resize" + #echo ''$VIRSH_GPU_VIDEO > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/driver/unbind" + #sleep 1s + #echo "${bar0_host}" > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/resource0_resize" + #echo "${bar2_host}" > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/resource2_resize" - echo ''$VIRSH_GPU_VIDEO > /sys/bus/pci/drivers/amdgpu/bind + #echo ''$VIRSH_GPU_VIDEO > /sys/bus/pci/drivers/amdgpu/bind - sleep 1s - - chmod 0 /dev/dri/by-path/pci-$VIRSH_GPU_VIDEO-card - chmod 0 /dev/dri/by-path/pci-$VIRSH_GPU_VIDEO-render - fuser -k /dev/dri/by-path/pci-$VIRSH_GPU_VIDEO-render - fuser -k /dev/dri/by-path/pci-$VIRSH_GPU_VIDEO-card + #sleep 1s + #echo remove > /sys/bus/pci/devices/$VIRSH_GPU_VIDEO/drm/card*/uevent + #chmod 0 /dev/dri/by-path/pci-$VIRSH_GPU_VIDEO-card + #chmod 0 /dev/dri/by-path/pci-$VIRSH_GPU_VIDEO-render + #fuser -k /dev/dri/by-path/pci-$VIRSH_GPU_VIDEO-render + #fuser -k /dev/dri/by-path/pci-$VIRSH_GPU_VIDEO-card ##################################################################### echo ''$VIRSH_GPU_VIDEO > "/sys/bus/pci/devices/''${VIRSH_GPU_VIDEO}/driver/unbind" @@ -175,9 +177,9 @@ in ${startHook} fi - if [ ''$2 = "started" ] && [ ''$3 = "begin" ]; then - ${startedHook} - fi + #if [ ''$2 = "started" ] && [ ''$3 = "begin" ]; then + + #fi if [ ''$2 = "release" ] && [ ''$3 = "end" ]; then ${stopHook} diff --git a/configurations/profile/home/editor/code.nix b/configurations/profile/home/editor/code.nix index e72250d..3bb001f 100644 --- a/configurations/profile/home/editor/code.nix +++ b/configurations/profile/home/editor/code.nix @@ -67,6 +67,7 @@ let open-vsx.ms-vscode.hexeditor open-vsx.alefragnani.project-manager vscode-marketplace.cantonios.project-templates + vscode-marketplace.betterthantomorrow.joyride #Icons open-vsx.pkief.material-icon-theme diff --git a/extraFiles/config/emacs/EMACS-CONFIG.org b/extraFiles/config/emacs/EMACS-CONFIG.org index 7374323..12f0f25 100644 --- a/extraFiles/config/emacs/EMACS-CONFIG.org +++ b/extraFiles/config/emacs/EMACS-CONFIG.org @@ -259,16 +259,17 @@ (eq major-mode 'c++-mode) (eq major-mode 'c++-ts-mode))) - (defun materus/--fix-outli-formatting (FORMATTER STATUS) + (defun materus/anchor-outli-headers () "Remove whitespaces before outli headers" - (when (and (materus/--outli-modes) - (eq STATUS :reformatted)) - (save-excursion - (save-restriction - (widen) - (goto-char (point-min)) - (while (re-search-forward (concat "^[ ]+\\(" comment-start "\\*+ +[^ ].*\\)[ ]*") nil t) - (replace-match "\\1")))))) + (save-excursion + (save-restriction + (widen) + (goto-char (point-min)) + (while (re-search-forward (concat "^[ ]+\\(" comment-start "\\*+ +[^ ].*\\)[ ]*") nil t) + (replace-match "\\1"))))) + (defun materus/--fix-outli-formatting (FORMATTER STATUS) + (materus/anchor-outli-headers) + ) (defun materus/--electric-indent-ignore-outli (char) "Don't indent outli headers" @@ -277,7 +278,7 @@ (backward-char) (beginning-of-line) (if (not (looking-at-p (concat "^\\(" comment-start "\\*+ +[^ ].*\\)[ ]*"))) nil 'no-indent)))) -#+END_src + #+END_src ** Custom File #+begin_src emacs-lisp :noweb-ref init-custom-file @@ -644,6 +645,7 @@ Setting up mouse :config (setq lsp-keep-workspace-alive nil) (setq lsp-enable-on-type-formatting nil) + (setq lsp-ui-doc-show-with-mouse nil) (defun lsp-booster--advice-json-parse (old-fn &rest args) "Try to parse bytecode instead of json." @@ -691,6 +693,7 @@ Setting up mouse (require 'dap-gdb-lldb) (require 'dap-cpptools) (setq dap-gdb-lldb-extension-version "0.27.0") + (setq dap-auto-configure-features '(sessions locals breakpoints controls)) (dap-auto-configure-mode 1)) #+end_src @@ -775,7 +778,9 @@ Setting up mouse #+end_src *** Nix #+begin_src emacs-lisp - (use-package nix-mode) + (use-package nix-mode + :config + (advice-add 'nix-format-buffer :after #'materus/anchor-outli-headers)) (use-package nix-ts-mode) (use-package lsp-nix :after (lsp-mode nix-mode nix-ts-mode format-all) diff --git a/extraFiles/config/emacs/init.el b/extraFiles/config/emacs/init.el index 2ee8811..318511e 100644 --- a/extraFiles/config/emacs/init.el +++ b/extraFiles/config/emacs/init.el @@ -76,16 +76,17 @@ (eq major-mode 'c++-mode) (eq major-mode 'c++-ts-mode))) -(defun materus/--fix-outli-formatting (FORMATTER STATUS) +(defun materus/anchor-outli-headers () "Remove whitespaces before outli headers" - (when (and (materus/--outli-modes) - (eq STATUS :reformatted)) - (save-excursion - (save-restriction - (widen) - (goto-char (point-min)) - (while (re-search-forward (concat "^[ ]+\\(" comment-start "\\*+ +[^ ].*\\)[ ]*") nil t) - (replace-match "\\1")))))) + (save-excursion + (save-restriction + (widen) + (goto-char (point-min)) + (while (re-search-forward (concat "^[ ]+\\(" comment-start "\\*+ +[^ ].*\\)[ ]*") nil t) + (replace-match "\\1"))))) +(defun materus/--fix-outli-formatting (FORMATTER STATUS) + (materus/anchor-outli-headers) + ) (defun materus/--electric-indent-ignore-outli (char) "Don't indent outli headers" @@ -361,6 +362,7 @@ :config (setq lsp-keep-workspace-alive nil) (setq lsp-enable-on-type-formatting nil) + (setq lsp-ui-doc-show-with-mouse nil) (defun lsp-booster--advice-json-parse (old-fn &rest args) "Try to parse bytecode instead of json." @@ -405,6 +407,7 @@ (require 'dap-gdb-lldb) (require 'dap-cpptools) (setq dap-gdb-lldb-extension-version "0.27.0") + (setq dap-auto-configure-features '(sessions locals breakpoints controls)) (dap-auto-configure-mode 1)) (use-package format-all @@ -470,7 +473,9 @@ (add-hook 'python-mode-hook 'lsp-deferred) (add-hook 'python-ts-mode-hook 'lsp-deferred) (when (treesit-language-available-p 'python) (push '(python-mode . python-ts-mode) major-mode-remap-alist))) -(use-package nix-mode) +(use-package nix-mode + :config + (advice-add 'nix-format-buffer :after #'materus/anchor-outli-headers)) (use-package nix-ts-mode) (use-package lsp-nix :after (lsp-mode nix-mode nix-ts-mode format-all) diff --git a/flake.lock b/flake.lock index 8dd6a5b..f0bf23b 100644 --- a/flake.lock +++ b/flake.lock @@ -159,11 +159,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1749806554, - "narHash": "sha256-mvvQ8dcGJTmUfudSD8i0Wd4uiQpjcKjDPX9ruEbYK2k=", + "lastModified": 1752164814, + "narHash": "sha256-F2c24r/c1tL0WC2uTUaWKTSuWAAu6Mi9CX8VCnns32g=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "d2fb39a8ecf7610891cbc64cff05588308c5166a", + "rev": "9972974b23747d11421187718a5039bec3b5f675", "type": "github" }, "original": { @@ -182,11 +182,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1749806554, - "narHash": "sha256-mvvQ8dcGJTmUfudSD8i0Wd4uiQpjcKjDPX9ruEbYK2k=", + "lastModified": 1752164814, + "narHash": "sha256-F2c24r/c1tL0WC2uTUaWKTSuWAAu6Mi9CX8VCnns32g=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "d2fb39a8ecf7610891cbc64cff05588308c5166a", + "rev": "9972974b23747d11421187718a5039bec3b5f675", "type": "github" }, "original": { @@ -436,11 +436,11 @@ ] }, "locked": { - "lastModified": 1749154018, - "narHash": "sha256-gjN3j7joRvT3a8Zgcylnd4NFsnXeDBumqiu4HmY1RIg=", + "lastModified": 1751810233, + "narHash": "sha256-kllkNbIqQi3VplgTMeGzuh1t8Gk8TauvkTRt93Km+tQ=", "owner": "nix-community", "repo": "home-manager", - "rev": "7aae0ee71a17b19708b93b3ed448a1a0952bf111", + "rev": "9b0873b46c9f9e4b7aa01eb634952c206af53068", "type": "github" }, "original": { @@ -458,11 +458,11 @@ ] }, "locked": { - "lastModified": 1749821119, - "narHash": "sha256-X3WAS322EsebI4ohJcXhKpiyG1v+7wE4VOiXy1pxM/c=", + "lastModified": 1752093218, + "narHash": "sha256-+3rXu8ewcNDi65/2mKkdSGrivQs5zEZVp5aYszXC0d0=", "owner": "nix-community", "repo": "home-manager", - "rev": "79dfd9aa295e53773aad45480b44c131da29f35b", + "rev": "206ed3c71418b52e176f16f58805c96e84555320", "type": "github" }, "original": { @@ -477,11 +477,11 @@ "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1749821119, - "narHash": "sha256-X3WAS322EsebI4ohJcXhKpiyG1v+7wE4VOiXy1pxM/c=", + "lastModified": 1752093218, + "narHash": "sha256-+3rXu8ewcNDi65/2mKkdSGrivQs5zEZVp5aYszXC0d0=", "owner": "nix-community", "repo": "home-manager", - "rev": "79dfd9aa295e53773aad45480b44c131da29f35b", + "rev": "206ed3c71418b52e176f16f58805c96e84555320", "type": "github" }, "original": { @@ -501,11 +501,11 @@ ] }, "locked": { - "lastModified": 1749780284, - "narHash": "sha256-at8sCy3IXlgo1zV0j0Wowhn/dHXqBkb2huSdJ2Jt+mo=", + "lastModified": 1752113362, + "narHash": "sha256-KWELfQtHJjNG7X485TplXmKSmZIsYXHeruAxxEnsH7M=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "6ec5e3e4a11887ae47d55ece1b83a0ed8082cddf", + "rev": "6e1e610de8302bd2b1575c90c73997acd333a311", "type": "github" }, "original": { @@ -527,11 +527,11 @@ ] }, "locked": { - "lastModified": 1749780284, - "narHash": "sha256-at8sCy3IXlgo1zV0j0Wowhn/dHXqBkb2huSdJ2Jt+mo=", + "lastModified": 1752113362, + "narHash": "sha256-KWELfQtHJjNG7X485TplXmKSmZIsYXHeruAxxEnsH7M=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "6ec5e3e4a11887ae47d55ece1b83a0ed8082cddf", + "rev": "6e1e610de8302bd2b1575c90c73997acd333a311", "type": "github" }, "original": { @@ -597,11 +597,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1749808356, - "narHash": "sha256-VQ2HFRVz0VxjYYFtdRTlAq/PuOT+j876YTWubk0WLJM=", + "lastModified": 1752048960, + "narHash": "sha256-gATnkOe37eeVwKKYCsL+OnS2gU4MmLuZFzzWCtaKLI8=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "b328aa7871068d9f98b656d8f6829b39a541a114", + "rev": "7ced9122cff2163c6a0212b8d1ec8c33a1660806", "type": "github" }, "original": { @@ -613,11 +613,11 @@ }, "nixos-hardware_2": { "locked": { - "lastModified": 1749808356, - "narHash": "sha256-VQ2HFRVz0VxjYYFtdRTlAq/PuOT+j876YTWubk0WLJM=", + "lastModified": 1752048960, + "narHash": "sha256-gATnkOe37eeVwKKYCsL+OnS2gU4MmLuZFzzWCtaKLI8=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "b328aa7871068d9f98b656d8f6829b39a541a114", + "rev": "7ced9122cff2163c6a0212b8d1ec8c33a1660806", "type": "github" }, "original": { @@ -645,11 +645,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1749668643, - "narHash": "sha256-gaWJEWGBW/g1u6o5IM4Un0vluv86cigLuBnjsKILffc=", + "lastModified": 1751274312, + "narHash": "sha256-/bVBlRpECLVzjV19t5KMdMFWSwKLtb5RyXdjz3LJT+g=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1965fd20a39c8e441746bee66d550af78f0c0a7b", + "rev": "50ab793786d9de88ee30ec4e4c24fb4236fc2674", "type": "github" }, "original": { @@ -661,11 +661,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1749668643, - "narHash": "sha256-gaWJEWGBW/g1u6o5IM4Un0vluv86cigLuBnjsKILffc=", + "lastModified": 1751274312, + "narHash": "sha256-/bVBlRpECLVzjV19t5KMdMFWSwKLtb5RyXdjz3LJT+g=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1965fd20a39c8e441746bee66d550af78f0c0a7b", + "rev": "50ab793786d9de88ee30ec4e4c24fb4236fc2674", "type": "github" }, "original": { @@ -677,11 +677,11 @@ }, "nixpkgs-stable_3": { "locked": { - "lastModified": 1749727998, - "narHash": "sha256-mHv/yeUbmL91/TvV95p+mBVahm9mdQMJoqaTVTALaFw=", + "lastModified": 1751943650, + "narHash": "sha256-7orTnNqkGGru8Je6Un6mq1T8YVVU/O5kyW4+f9C1mZQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "fd487183437963a59ba763c0cc4f27e3447dd6dd", + "rev": "88983d4b665fb491861005137ce2b11a9f89f203", "type": "github" }, "original": { @@ -741,11 +741,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1749285348, - "narHash": "sha256-frdhQvPbmDYaScPFiCnfdh3B/Vh81Uuoo0w5TkWmmjU=", + "lastModified": 1751637120, + "narHash": "sha256-xVNy/XopSfIG9c46nRmPaKfH1Gn/56vQ8++xWA8itO4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3e3afe5174c561dee0df6f2c2b2236990146329f", + "rev": "5c724ed1388e53cc231ed98330a60eb2f7be4be3", "type": "github" }, "original": { @@ -757,11 +757,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1749285348, - "narHash": "sha256-frdhQvPbmDYaScPFiCnfdh3B/Vh81Uuoo0w5TkWmmjU=", + "lastModified": 1751984180, + "narHash": "sha256-LwWRsENAZJKUdD3SpLluwDmdXY9F45ZEgCb0X+xgOL0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3e3afe5174c561dee0df6f2c2b2236990146329f", + "rev": "9807714d6944a957c2e036f84b0ff8caf9930bc0", "type": "github" }, "original": { @@ -773,11 +773,11 @@ }, "nixpkgs_7": { "locked": { - "lastModified": 1749285348, - "narHash": "sha256-frdhQvPbmDYaScPFiCnfdh3B/Vh81Uuoo0w5TkWmmjU=", + "lastModified": 1751984180, + "narHash": "sha256-LwWRsENAZJKUdD3SpLluwDmdXY9F45ZEgCb0X+xgOL0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "3e3afe5174c561dee0df6f2c2b2236990146329f", + "rev": "9807714d6944a957c2e036f84b0ff8caf9930bc0", "type": "github" }, "original": { @@ -868,15 +868,14 @@ "nur_5": { "inputs": { "flake-parts": "flake-parts_5", - "nixpkgs": "nixpkgs_7", - "treefmt-nix": "treefmt-nix_5" + "nixpkgs": "nixpkgs_7" }, "locked": { - "lastModified": 1749820497, - "narHash": "sha256-l6gXEHXGZxsvOZylT4oWqw1syKtcKfnZMQ9wtR4PwSc=", + "lastModified": 1752165826, + "narHash": "sha256-oAiIhK1Q8Yp80XYK6zikKoRvKf9sU6M3//IUToQQDSQ=", "owner": "nix-community", "repo": "NUR", - "rev": "7c388148972b182ef27bddff0f36c515011b3dfe", + "rev": "7378170573977f289ae127727e238a74b451afd9", "type": "github" }, "original": { @@ -972,11 +971,11 @@ ] }, "locked": { - "lastModified": 1749592509, - "narHash": "sha256-VunQzfZFA+Y6x3wYi2UE4DEQ8qKoAZZCnZPUlSoqC+A=", + "lastModified": 1751606940, + "narHash": "sha256-KrDPXobG7DFKTOteqdSVeL1bMVitDcy7otpVZWDE6MA=", "owner": "Mic92", "repo": "sops-nix", - "rev": "50754dfaa0e24e313c626900d44ef431f3210138", + "rev": "3633fc4acf03f43b260244d94c71e9e14a2f6e0d", "type": "github" }, "original": { @@ -994,11 +993,11 @@ ] }, "locked": { - "lastModified": 1749592509, - "narHash": "sha256-VunQzfZFA+Y6x3wYi2UE4DEQ8qKoAZZCnZPUlSoqC+A=", + "lastModified": 1751606940, + "narHash": "sha256-KrDPXobG7DFKTOteqdSVeL1bMVitDcy7otpVZWDE6MA=", "owner": "Mic92", "repo": "sops-nix", - "rev": "50754dfaa0e24e313c626900d44ef431f3210138", + "rev": "3633fc4acf03f43b260244d94c71e9e14a2f6e0d", "type": "github" }, "original": { @@ -1127,27 +1126,6 @@ "repo": "treefmt-nix", "type": "github" } - }, - "treefmt-nix_5": { - "inputs": { - "nixpkgs": [ - "nur", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1733222881, - "narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=", - "owner": "numtide", - "repo": "treefmt-nix", - "rev": "49717b5af6f80172275d47a418c9719a31a78b53", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "treefmt-nix", - "type": "github" - } } }, "root": "root",