diff --git a/configs/hw/signed-kmods.nix b/configs/hw/signed-kmods.nix new file mode 100644 index 00000000..5f4e0a68 --- /dev/null +++ b/configs/hw/signed-kmods.nix @@ -0,0 +1,59 @@ +# Out-of-tree kernel modules installed through the kernel's modules_install, +# imported (not as a module) by the hardware configs that load them. +# +# Since NixOS/nixpkgs#571181 the kernel signs modules deterministically and +# the module aggregator (pkgs/os-specific/linux/kmod/aggregator.nix) expects +# a .ko.cer next to every out-of-tree module. modules_install writes +# it; these packages' own installPhase copies the bare .ko, so the system +# build fails with "cat: ...ko.cer: No such file or directory". +# +# Drop each entry once nixpkgs installs it that way: +# - acpi_call: NixOS/nixpkgs#575394 +# - framework-laptop-kmod: NixOS/nixpkgs#575818 (merged) +# - tp_smapi: no upstream fix yet +{ lib, kernelPackages }: +let + inherit (kernelPackages) kernel kernelModuleMakeFlags; + modulesInstallFlags = dir: [ + "INSTALL_MOD_PATH=${placeholder "out"}" + "INSTALL_MOD_DIR=${dir}" + "DEPMOD=true" + ]; +in +{ + # As in NixOS/nixpkgs#575394: its Makefile's install target runs + # modules_install. + acpi_call = kernelPackages.acpi_call.overrideAttrs (old: { + makeFlags = old.makeFlags ++ modulesInstallFlags "misc"; + installPhase = null; + postInstall = '' + install -D -m755 examples/turn_off_gpu.sh $out/bin/test_discrete_video_off.sh + ''; + }); + + # As in NixOS/nixpkgs#575818. + framework-laptop-kmod = kernelPackages.framework-laptop-kmod.overrideAttrs (old: { + makeFlags = old.makeFlags ++ modulesInstallFlags "extra"; + installPhase = null; + installTargets = [ "modules_install" ]; + }); + + # Same place as before. hdaps.ko keeps its old file name hdapsd.ko: + # modprobe goes by file name, so it doesn't shadow the in-tree hdaps + # driver. + tp_smapi = kernelPackages.tp_smapi.overrideAttrs { + installPhase = '' + runHook preInstall + + make -C ${kernel.dev}/lib/modules/${kernel.modDirVersion}/build M="$PWD" \ + ${lib.escapeShellArgs (kernelModuleMakeFlags ++ modulesInstallFlags "kernel/drivers/firmware")} \ + modules_install + cd $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/firmware + for f in hdaps.ko*; do + mv "$f" "hdapsd''${f#hdaps}" + done + + runHook postInstall + ''; + }; +} diff --git a/configs/hw/x220.nix b/configs/hw/x220.nix index 79ecb2b3..18880ee8 100644 --- a/configs/hw/x220.nix +++ b/configs/hw/x220.nix @@ -4,6 +4,12 @@ pkgs, ... }: +let + kmods = import ./signed-kmods.nix { + inherit lib; + inherit (config.boot) kernelPackages; + }; +in { # Hardware configuration from krebs/stockholm x220.nix, with updated package names networking.wireless.enable = lib.mkDefault true; @@ -30,8 +36,8 @@ "usb_storage" ]; extraModulePackages = [ - config.boot.kernelPackages.tp_smapi - config.boot.kernelPackages.acpi_call + kmods.tp_smapi + kmods.acpi_call ]; kernelModules = [ "kvm-intel" diff --git a/configs/monitoring/agent.nix b/configs/monitoring/agent.nix index 65acef3e..d4240a16 100644 --- a/configs/monitoring/agent.nix +++ b/configs/monitoring/agent.nix @@ -5,6 +5,7 @@ config, lib, pkgs, + self, ... }: let @@ -67,6 +68,7 @@ in config.services.vector = { enable = true; journaldAccess = true; + package = self.packages.${pkgs.stdenv.hostPlatform.system}.vector; settings = { data_dir = "/var/lib/vector"; diff --git a/configs/orca/server.nix b/configs/orca/server.nix index 12f94d8f..3d8163fa 100644 --- a/configs/orca/server.nix +++ b/configs/orca/server.nix @@ -33,7 +33,7 @@ in ]; packages = [ orca - self.packages.${pkgs.system}.omp + pkgs.omp # GitHub issues/PRs in the work item lists. pkgs.gh ]; diff --git a/configs/services/radio/tts.nix b/configs/services/radio/tts.nix index d6266afe..7e08b160 100644 --- a/configs/services/radio/tts.nix +++ b/configs/services/radio/tts.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, self, ... }: let model = pkgs.runCommand "model" { } '' mkdir -p $out @@ -31,7 +31,7 @@ let fi filename=$(printf '%04d' $offset).wav echo "$line" | - ${pkgs.piper-tts}/bin/piper \ + ${self.packages.${pkgs.stdenv.hostPlatform.system}.piper-tts}/bin/piper \ --model ${model}/model.onnx \ -s "$SPEAKER" \ -f "$OUTPUT"/"$filename" >/dev/null diff --git a/flake.lock b/flake.lock index c8443aa8..08d42847 100644 --- a/flake.lock +++ b/flake.lock @@ -90,11 +90,11 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1792143782, - "narHash": "sha256-5/IQBPuDEFf3wh6Td0p3ftQpIycClssbaBOKL9wUlWw=", + "lastModified": 1792422590, + "narHash": "sha256-PQjBfmQPYZoOJZ76Fzgrg070tT2zEI01N45STYirDe4=", "owner": "clan-lol", "repo": "clan-core", - "rev": "340bae7dc0f3e82d41029974b4f7883fab507e85", + "rev": "86d72f39b3765b5261cb576c8aa2ec20e77d7599", "type": "github" }, "original": { @@ -105,11 +105,11 @@ }, "crane": { "locked": { - "lastModified": 1790899423, - "narHash": "sha256-THGtz65UGJU+sonZidRboyCMk+9DclpMF7pwL4uDV4M=", + "lastModified": 1791754810, + "narHash": "sha256-cN0Mgk+sQtCJcGWs9H4M0CnLRAuC4I8aCwiBTcBJs6E=", "owner": "ipetkov", "repo": "crane", - "rev": "47b6b27ed9a3a9181415e4367d0c30ab2a0e0250", + "rev": "bd63bf1d0a0f6dcacd7549c714a671ee63b0db6a", "type": "github" }, "original": { @@ -140,11 +140,11 @@ ] }, "locked": { - "lastModified": 1789770686, - "narHash": "sha256-uZkBR7yHdIKUFB5SZdfgh1qkGfI3XmYmI/lTiquxbck=", + "lastModified": 1792526520, + "narHash": "sha256-3hSJlv8mUVnZPMWK2+CM7a9O+nR6Z4mCh27NfLCmTPc=", "owner": "nix-community", "repo": "disko", - "rev": "725ea35e410ad83be4931d1bff7e090eacaf3563", + "rev": "cedd626e11b635470fa6f9fdb8ad79b0075dd7f9", "type": "github" }, "original": { @@ -313,11 +313,11 @@ "uv2nix": "uv2nix" }, "locked": { - "lastModified": 1792379206, - "narHash": "sha256-r/eEmVoDD2PoFQwWqOOYDS+5xIb8PxJ6vFauGLkXXco=", + "lastModified": 1792551457, + "narHash": "sha256-YYgjl6AmOHRnDxy9bmYB/UYUEzAZtFG3JxfQyuHUTCA=", "owner": "nousresearch", "repo": "hermes-agent", - "rev": "0b7d3df7b4b7c809a027d2a92a22bfd8627ddff6", + "rev": "40cc180823d182826536416de2fc27be44b4ac57", "type": "github" }, "original": { @@ -355,11 +355,11 @@ ] }, "locked": { - "lastModified": 1792282487, - "narHash": "sha256-1W+Kg/pviKwFxCzWAMr5uRJ+OMrMASP98Me/J+vyxKQ=", + "lastModified": 1792534189, + "narHash": "sha256-/GFsF0aY7UOMuynKGxMCVpo8Ci7LpaSgR5RwYYJ55XU=", "owner": "numtide", "repo": "iets", - "rev": "79c4346887c450eb684bb66402cb16fd5c9bbd77", + "rev": "0fba531c064e818701b02590bb647e83ee0f74a0", "type": "github" }, "original": { @@ -411,11 +411,11 @@ "treefmt-nix": "treefmt-nix_3" }, "locked": { - "lastModified": 1792365592, - "narHash": "sha256-3hqNK8+5FllvUfqw8+8YnzAgQZqCmwLQIHrG+jNLMRk=", + "lastModified": 1792537819, + "narHash": "sha256-ARZDzZjNO5qnUkPyREMbAMA/+9HzlQ/vzpbLzAeBdRU=", "owner": "numtide", "repo": "llm-agents.nix", - "rev": "5a3be28f941d6cf6fc1538bd0a6136993c9e542e", + "rev": "9d41351cd41c70c69f9a4ba635d95d5921ceed33", "type": "github" }, "original": { @@ -455,11 +455,11 @@ ] }, "locked": { - "lastModified": 1786845137, - "narHash": "sha256-oQFip+v0luP8NIxJzmiW4Wu8bILsbFWom5l0zonl8hQ=", + "lastModified": 1792366139, + "narHash": "sha256-jto4pdsl0bgErQ5vaMc3gOyj//PILLRJuqX3I7fUk6s=", "owner": "nix-darwin", "repo": "nix-darwin", - "rev": "4cff07de74b50e64bdd68cd4e722ab5b6b35ee48", + "rev": "f0ec2b3fae4df92ea7788359aef9e07bb88d720f", "type": "github" }, "original": { @@ -528,11 +528,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1791721963, - "narHash": "sha256-BYhx89XJltnRyQeuDKHVL5eSqbbfAcOKuDts7QRsrxQ=", + "lastModified": 1792491056, + "narHash": "sha256-6n1Dn+WYtD8lprnSi+0k4FjbKfIVNG8lblpJ5MiiqXs=", "owner": "nixos", "repo": "nixos-hardware", - "rev": "60a624466c08787ee8303393b7d4752d1826f14f", + "rev": "efb6d0d5e2394c3c5416a18652808aba206c0988", "type": "github" }, "original": { @@ -599,11 +599,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1792094642, - "narHash": "sha256-zp8ToDMnqZcu4o4IH9pdwXFXGp7yLm/M0dEnNWnyd7I=", + "lastModified": 1792502884, + "narHash": "sha256-IoNisKcGbUjdd45qCqywGMCYmZ5EnkxezvLII0FWwNA=", "owner": "nixos", "repo": "nixpkgs", - "rev": "fe13242281a67641c0102cdb1087f0ebe586c7df", + "rev": "02c087f3fe673c9e317f206a627cb6b910336dbe", "type": "github" }, "original": { @@ -826,11 +826,11 @@ ] }, "locked": { - "lastModified": 1792327966, - "narHash": "sha256-H71omFpIXx/0OeTtjRDam7UVK3JCtHgwFQ/M1VdGCbU=", + "lastModified": 1792492486, + "narHash": "sha256-HOxpcrcF56OvToeXnGbrbcYCVgLK3Zbtpm9kADlD7IA=", "owner": "Lassulus", "repo": "tincr", - "rev": "830364917ef24008bed34c838d7796f0c004e577", + "rev": "ec6798c234f7138bc6b1e6da3b6190948b3ba95b", "type": "github" }, "original": { @@ -955,11 +955,11 @@ ] }, "locked": { - "lastModified": 1791312500, - "narHash": "sha256-Wr358xHHD0XHNzl2V6bzHJRvnrwLpa1/o+AjdYKDs1g=", + "lastModified": 1792487907, + "narHash": "sha256-X/+r5QLrzFmlO4Kx4WKEu2Ol/Xr6XWSjyIMd//Sl0Mo=", "owner": "lassulus", "repo": "wrappers", - "rev": "d814b84aa832bb01630439c6b3566652da83a786", + "rev": "37d05efcab820ef96f083b251040ae2848445959", "type": "github" }, "original": { diff --git a/machines/barnacle/configuration.nix b/machines/barnacle/configuration.nix index 0c81a0f8..768b2728 100644 --- a/machines/barnacle/configuration.nix +++ b/machines/barnacle/configuration.nix @@ -26,7 +26,7 @@ self.packages.${pkgs.system}.s self.packages.${pkgs.system}.secretive - self.packages.${pkgs.system}.omp + pkgs.omp self.packages.${pkgs.system}.browser-mcp # zsh dependencies diff --git a/machines/coaxmetal/hermes.nix b/machines/coaxmetal/hermes.nix index 7606effa..6bbc7e84 100644 --- a/machines/coaxmetal/hermes.nix +++ b/machines/coaxmetal/hermes.nix @@ -36,7 +36,7 @@ let # Contract: hermes writes the reply text to $1 and expects audio at $2. hermes-tts = pkgs.writeShellApplication { name = "hermes-tts"; - runtimeInputs = [ pkgs.piper-tts ]; + runtimeInputs = [ self.packages.${pkgs.stdenv.hostPlatform.system}.piper-tts ]; text = '' piper --model ${piperVoice}/model.onnx --output-file "$2" < "$1" ''; diff --git a/machines/daedalus/config.nix b/machines/daedalus/config.nix index 7959a436..01b35ecb 100644 --- a/machines/daedalus/config.nix +++ b/machines/daedalus/config.nix @@ -1,4 +1,5 @@ { + self, lib, pkgs, ... @@ -43,7 +44,7 @@ chromium networkmanagerapplet libreoffice - audacity + self.packages.${pkgs.stdenv.hostPlatform.system}.audacity zathura wine vlc diff --git a/machines/daedalus/physical.nix b/machines/daedalus/physical.nix index f6dc67fb..3f1f1555 100644 --- a/machines/daedalus/physical.nix +++ b/machines/daedalus/physical.nix @@ -1,4 +1,10 @@ -{ config, ... }: +{ config, lib, ... }: +let + kmods = import ../../configs/hw/signed-kmods.nix { + inherit lib; + inherit (config.boot) kernelPackages; + }; +in { imports = [ ./config.nix @@ -48,8 +54,8 @@ "usb_storage" ]; extraModulePackages = [ - config.boot.kernelPackages.tp_smapi - config.boot.kernelPackages.acpi_call + kmods.tp_smapi + kmods.acpi_call ]; kernelModules = [ "acpi_call" diff --git a/machines/ignavia/physical.nix b/machines/ignavia/physical.nix index 4796d7c1..8902f27d 100644 --- a/machines/ignavia/physical.nix +++ b/machines/ignavia/physical.nix @@ -1,5 +1,7 @@ { self, + config, + lib, modulesPath, pkgs, ... @@ -41,8 +43,23 @@ hardware.graphics.enable = true; hardware.acpilight.enable = true; - # DDC/CI: expose /dev/i2c-* so ddcutil can drive external monitor brightness - boot.kernelModules = [ "i2c-dev" ]; + boot.kernelModules = [ + # DDC/CI: expose /dev/i2c-* so ddcutil can drive external monitor brightness + "i2c-dev" + # what hardware.framework.enableKmod loads, see below + "cros_ec" + "cros_ec_lpcs" + ]; + + # nixos-hardware's framework-laptop-kmod lacks the module certificate the + # module aggregator needs, see configs/hw/signed-kmods.nix. + hardware.framework.enableKmod = false; + boot.extraModulePackages = [ + (import ../../configs/hw/signed-kmods.nix { + inherit lib; + inherit (config.boot) kernelPackages; + }).framework-laptop-kmod + ]; # Use latest kernel for better Strix Point GPU support. The MT7925 BT init # regression fix (e3ac0d9f1a20) landed upstream in 7.0.10. diff --git a/machines/shodan/physical.nix b/machines/shodan/physical.nix index 2aa27474..128f530b 100644 --- a/machines/shodan/physical.nix +++ b/machines/shodan/physical.nix @@ -1,4 +1,9 @@ -{ self, ... }: +{ + self, + config, + lib, + ... +}: { imports = [ ./config.nix @@ -6,6 +11,17 @@ self.inputs.nixos-hardware.nixosModules.lenovo-thinkpad-x220 ]; + # nixos-hardware's tp_smapi lacks the module certificate the module + # aggregator needs, see configs/hw/signed-kmods.nix. + disabledModules = [ "${self.inputs.nixos-hardware}/lenovo/thinkpad/tp-smapi.nix" ]; + boot.kernelModules = [ "tp_smapi" ]; + boot.extraModulePackages = [ + (import ../../configs/hw/signed-kmods.nix { + inherit lib; + inherit (config.boot) kernelPackages; + }).tp_smapi + ]; + # Disable hdapsd - not needed for SSD, and the package is broken with newer GCC services.hdapsd.enable = false; diff --git a/pkgs/audacity/package.nix b/pkgs/audacity/package.nix new file mode 100644 index 00000000..96b02001 --- /dev/null +++ b/pkgs/audacity/package.nix @@ -0,0 +1,13 @@ +{ audacity }: +# audacity 4.0.0 fails against Qt 6.12 in the unity build of +# muse_extensions_qml: its qmlcachegen output lands in one translation unit +# with the module's mocs, and "reference to 'Type' is ambiguous" there. +# Build that one target without unity; the whole project can't, other +# modules rely on it for their includes. Drop this package once nixpkgs' +# audacity builds again. +audacity.overrideAttrs (old: { + postPatch = (old.postPatch or "") + '' + echo 'set_target_properties(muse_extensions_qml PROPERTIES UNITY_BUILD OFF)' \ + >> muse/framework/extensions/qml/Muse/Extensions/CMakeLists.txt + ''; +}) diff --git a/pkgs/noctalia-qs/package.nix b/pkgs/noctalia-qs/package.nix new file mode 100644 index 00000000..d2ebafa0 --- /dev/null +++ b/pkgs/noctalia-qs/package.nix @@ -0,0 +1,9 @@ +{ noctalia-qs }: +# noctalia-qs 0.0.12 fails against Qt 6.12 ("Meta Types must be fully +# defined" in the hyprland ipc mocs). qt-6.12.patch backports quickshell +# 5d5d49873f ("all: use MOC includes instead of opaque pointer +# definitions") to the fork, whose i3 getters are non-const. Drop this +# package once nixpkgs' noctalia-qs builds again. +noctalia-qs.overrideAttrs (old: { + patches = (old.patches or [ ]) ++ [ ./qt-6.12.patch ]; +}) diff --git a/pkgs/noctalia-qs/qt-6.12.patch b/pkgs/noctalia-qs/qt-6.12.patch new file mode 100644 index 00000000..b4e22f9d --- /dev/null +++ b/pkgs/noctalia-qs/qt-6.12.patch @@ -0,0 +1,287 @@ +diff --git a/src/services/pipewire/peak.hpp b/src/services/pipewire/peak.hpp +index c4af3c2..3465852 100644 +--- a/src/services/pipewire/peak.hpp ++++ b/src/services/pipewire/peak.hpp +@@ -8,18 +8,12 @@ + #include + + #include "node.hpp" ++#include "qml.hpp" + + namespace qs::service::pipewire { + +-class PwNodeIface; + class PwPeakStream; + +-} // namespace qs::service::pipewire +- +-Q_DECLARE_OPAQUE_POINTER(qs::service::pipewire::PwNodeIface*); +- +-namespace qs::service::pipewire { +- + ///! Monitors peak levels of an audio node. + /// Tracks volume peaks for a node across all its channels. + /// +diff --git a/src/wayland/hyprland/ipc/connection.cpp b/src/wayland/hyprland/ipc/connection.cpp +index 3d7a397..2519dac 100644 +--- a/src/wayland/hyprland/ipc/connection.cpp ++++ b/src/wayland/hyprland/ipc/connection.cpp +@@ -37,6 +37,18 @@ QS_LOGGING_CATEGORY(logHyprlandIpc, "quickshell.hyprland.ipc", QtWarningMsg); + QS_LOGGING_CATEGORY(logHyprlandIpcEvents, "quickshell.hyprland.ipc.events", QtWarningMsg); + } // namespace + ++QBindable HyprlandIpc::bindableFocusedMonitor() const { ++ return &this->bFocusedMonitor; ++} ++ ++QBindable HyprlandIpc::bindableFocusedWorkspace() const { ++ return &this->bFocusedWorkspace; ++} ++ ++QBindable HyprlandIpc::bindableActiveToplevel() const { ++ return &this->bActiveToplevel; ++} ++ + HyprlandIpc::HyprlandIpc() { + auto his = qEnvironmentVariable("HYPRLAND_INSTANCE_SIGNATURE"); + if (his.isEmpty()) { +diff --git a/src/wayland/hyprland/ipc/connection.hpp b/src/wayland/hyprland/ipc/connection.hpp +index ba1e7c9..945c4d5 100644 +--- a/src/wayland/hyprland/ipc/connection.hpp ++++ b/src/wayland/hyprland/ipc/connection.hpp +@@ -25,9 +25,9 @@ class HyprlandToplevel; + + } // namespace qs::hyprland::ipc + +-Q_DECLARE_OPAQUE_POINTER(qs::hyprland::ipc::HyprlandWorkspace*); +-Q_DECLARE_OPAQUE_POINTER(qs::hyprland::ipc::HyprlandMonitor*); +-Q_DECLARE_OPAQUE_POINTER(qs::hyprland::ipc::HyprlandToplevel*); ++Q_MOC_INCLUDE("hyprland_toplevel.hpp") ++Q_MOC_INCLUDE("monitor.hpp") ++Q_MOC_INCLUDE("workspace.hpp") + + namespace qs::hyprland::ipc { + +@@ -81,17 +81,9 @@ public: + + [[nodiscard]] HyprlandMonitor* monitorFor(QuickshellScreenInfo* screen); + +- [[nodiscard]] QBindable bindableFocusedMonitor() const { +- return &this->bFocusedMonitor; +- } +- +- [[nodiscard]] QBindable bindableFocusedWorkspace() const { +- return &this->bFocusedWorkspace; +- } +- +- [[nodiscard]] QBindable bindableActiveToplevel() const { +- return &this->bActiveToplevel; +- } ++ [[nodiscard]] QBindable bindableFocusedMonitor() const; ++ [[nodiscard]] QBindable bindableFocusedWorkspace() const; ++ [[nodiscard]] QBindable bindableActiveToplevel() const; + + void setFocusedMonitor(HyprlandMonitor* monitor); + +diff --git a/src/wayland/hyprland/ipc/hyprland_toplevel.cpp b/src/wayland/hyprland/ipc/hyprland_toplevel.cpp +index 43b9838..524fee1 100644 +--- a/src/wayland/hyprland/ipc/hyprland_toplevel.cpp ++++ b/src/wayland/hyprland/ipc/hyprland_toplevel.cpp +@@ -8,6 +8,7 @@ + + #include "../../toplevel_management/qml.hpp" + #include "connection.hpp" ++#include "monitor.hpp" + #include "toplevel_mapping.hpp" + #include "workspace.hpp" + +@@ -15,6 +16,10 @@ using namespace qs::wayland::toplevel_management; + + namespace qs::hyprland::ipc { + ++QBindable HyprlandToplevel::bindableWorkspace() { return &this->bWorkspace; } ++ ++QBindable HyprlandToplevel::bindableMonitor() { return &this->bMonitor; } ++ + HyprlandToplevel::HyprlandToplevel(HyprlandIpc* ipc): QObject(ipc), ipc(ipc) { + this->bMonitor.setBinding([this]() { + return this->bWorkspace ? this->bWorkspace->bindableMonitor().value() : nullptr; +diff --git a/src/wayland/hyprland/ipc/hyprland_toplevel.hpp b/src/wayland/hyprland/ipc/hyprland_toplevel.hpp +index ebd4f84..404ce87 100644 +--- a/src/wayland/hyprland/ipc/hyprland_toplevel.hpp ++++ b/src/wayland/hyprland/ipc/hyprland_toplevel.hpp +@@ -81,10 +81,10 @@ public: + return &this->bLastIpcObject; + }; + +- [[nodiscard]] QBindable bindableWorkspace() { return &this->bWorkspace; } ++ [[nodiscard]] QBindable bindableWorkspace(); + void setWorkspace(HyprlandWorkspace* workspace); + +- [[nodiscard]] QBindable bindableMonitor() { return &this->bMonitor; } ++ [[nodiscard]] QBindable bindableMonitor(); + + signals: + void addressChanged(); +diff --git a/src/wayland/hyprland/ipc/monitor.cpp b/src/wayland/hyprland/ipc/monitor.cpp +index ddf3706..3b753dd 100644 +--- a/src/wayland/hyprland/ipc/monitor.cpp ++++ b/src/wayland/hyprland/ipc/monitor.cpp +@@ -13,6 +13,10 @@ namespace qs::hyprland::ipc { + + QVariantMap HyprlandMonitor::lastIpcObject() const { return this->mLastIpcObject; } + ++QBindable HyprlandMonitor::bindableActiveWorkspace() const { ++ return &this->bActiveWorkspace; ++} ++ + void HyprlandMonitor::updateInitial(qint32 id, const QString& name, const QString& description) { + Qt::beginPropertyUpdateGroup(); + this->bId = id; +diff --git a/src/wayland/hyprland/ipc/monitor.hpp b/src/wayland/hyprland/ipc/monitor.hpp +index b9ac434..d368adf 100644 +--- a/src/wayland/hyprland/ipc/monitor.hpp ++++ b/src/wayland/hyprland/ipc/monitor.hpp +@@ -54,9 +54,7 @@ public: + [[nodiscard]] QBindable bindableHeight() { return &this->bHeight; } + [[nodiscard]] QBindable bindableScale() { return &this->bScale; } + +- [[nodiscard]] QBindable bindableActiveWorkspace() const { +- return &this->bActiveWorkspace; +- } ++ [[nodiscard]] QBindable bindableActiveWorkspace() const; + + [[nodiscard]] QBindable bindableFocused() const { return &this->bFocused; } + +diff --git a/src/wayland/hyprland/ipc/workspace.cpp b/src/wayland/hyprland/ipc/workspace.cpp +index c5d63b0..f1ab6e4 100644 +--- a/src/wayland/hyprland/ipc/workspace.cpp ++++ b/src/wayland/hyprland/ipc/workspace.cpp +@@ -15,6 +15,8 @@ namespace qs::hyprland::ipc { + + QVariantMap HyprlandWorkspace::lastIpcObject() const { return this->mLastIpcObject; } + ++QBindable HyprlandWorkspace::bindableMonitor() { return &this->bMonitor; } ++ + HyprlandWorkspace::HyprlandWorkspace(HyprlandIpc* ipc): QObject(ipc), ipc(ipc) { + Qt::beginPropertyUpdateGroup(); + +diff --git a/src/wayland/hyprland/ipc/workspace.hpp b/src/wayland/hyprland/ipc/workspace.hpp +index a0b09cf..3a3a710 100644 +--- a/src/wayland/hyprland/ipc/workspace.hpp ++++ b/src/wayland/hyprland/ipc/workspace.hpp +@@ -64,7 +64,7 @@ public: + [[nodiscard]] QBindable bindableFocused() { return &this->bFocused; } + [[nodiscard]] QBindable bindableUrgent() { return &this->bUrgent; } + [[nodiscard]] QBindable bindableHasFullscreen() { return &this->bHasFullscreen; } +- [[nodiscard]] QBindable bindableMonitor() { return &this->bMonitor; } ++ [[nodiscard]] QBindable bindableMonitor(); + [[nodiscard]] ObjectModel* toplevels() { return &this->mToplevels; } + + [[nodiscard]] QVariantMap lastIpcObject() const; +diff --git a/src/x11/i3/ipc/controller.cpp b/src/x11/i3/ipc/controller.cpp +index 30b0fe1..4e39847 100644 +--- a/src/x11/i3/ipc/controller.cpp ++++ b/src/x11/i3/ipc/controller.cpp +@@ -31,6 +31,14 @@ QS_LOGGING_CATEGORY(logI3Ipc, "quickshell.I3.ipc", QtWarningMsg); + QS_LOGGING_CATEGORY(logI3IpcEvents, "quickshell.I3.ipc.events", QtWarningMsg); + } // namespace + ++QBindable I3IpcController::bindableFocusedMonitor() const { ++ return &this->bFocusedMonitor; ++} ++ ++QBindable I3IpcController::bindableFocusedWorkspace() const { ++ return &this->bFocusedWorkspace; ++} ++ + I3IpcController::I3IpcController(): I3Ipc({"workspace", "output"}) { + // bind focused workspace to focused monitor's active workspace + this->bFocusedWorkspace.setBinding([this]() -> I3Workspace* { +diff --git a/src/x11/i3/ipc/controller.hpp b/src/x11/i3/ipc/controller.hpp +index 464f6f6..9e9d914 100644 +--- a/src/x11/i3/ipc/controller.hpp ++++ b/src/x11/i3/ipc/controller.hpp +@@ -20,8 +20,8 @@ class I3Workspace; + class I3Monitor; + } // namespace qs::i3::ipc + +-Q_DECLARE_OPAQUE_POINTER(qs::i3::ipc::I3Workspace*); +-Q_DECLARE_OPAQUE_POINTER(qs::i3::ipc::I3Monitor*); ++Q_MOC_INCLUDE("monitor.hpp") ++Q_MOC_INCLUDE("workspace.hpp") + + namespace qs::i3::ipc { + +@@ -43,13 +43,8 @@ public: + + I3Monitor* monitorFor(QuickshellScreenInfo* screen); + +- [[nodiscard]] QBindable bindableFocusedMonitor() const { +- return &this->bFocusedMonitor; +- }; +- +- [[nodiscard]] QBindable bindableFocusedWorkspace() const { +- return &this->bFocusedWorkspace; +- }; ++ [[nodiscard]] QBindable bindableFocusedMonitor() const; ++ [[nodiscard]] QBindable bindableFocusedWorkspace() const; + + [[nodiscard]] ObjectModel* monitors(); + [[nodiscard]] ObjectModel* workspaces(); +diff --git a/src/x11/i3/ipc/monitor.cpp b/src/x11/i3/ipc/monitor.cpp +index ed5506d..13e0e12 100644 +--- a/src/x11/i3/ipc/monitor.cpp ++++ b/src/x11/i3/ipc/monitor.cpp +@@ -12,6 +12,10 @@ + + namespace qs::i3::ipc { + ++QBindable I3Monitor::bindableActiveWorkspace() { ++ return &this->bActiveWorkspace; ++} ++ + I3Monitor::I3Monitor(I3IpcController* ipc): QObject(ipc), ipc(ipc) { + // clang-format off + this->bFocused.setBinding([this]() { return this->ipc->bindableFocusedMonitor().value() == this; }); +diff --git a/src/x11/i3/ipc/monitor.hpp b/src/x11/i3/ipc/monitor.hpp +index 3ed9617..add67f1 100644 +--- a/src/x11/i3/ipc/monitor.hpp ++++ b/src/x11/i3/ipc/monitor.hpp +@@ -55,9 +55,7 @@ public: + [[nodiscard]] QBindable bindableScale() { return &this->bScale; } + [[nodiscard]] QBindable bindableFocused() { return &this->bFocused; } + +- [[nodiscard]] QBindable bindableActiveWorkspace() { +- return &this->bActiveWorkspace; +- } ++ [[nodiscard]] QBindable bindableActiveWorkspace(); + + [[nodiscard]] QVariantMap lastIpcObject() const; + +diff --git a/src/x11/i3/ipc/workspace.cpp b/src/x11/i3/ipc/workspace.cpp +index 632fdfa..8940266 100644 +--- a/src/x11/i3/ipc/workspace.cpp ++++ b/src/x11/i3/ipc/workspace.cpp +@@ -12,6 +12,8 @@ + + namespace qs::i3::ipc { + ++QBindable I3Workspace::bindableMonitor() { return &this->bMonitor; } ++ + I3Workspace::I3Workspace(I3IpcController* ipc): QObject(ipc), ipc(ipc) { + Qt::beginPropertyUpdateGroup(); + +diff --git a/src/x11/i3/ipc/workspace.hpp b/src/x11/i3/ipc/workspace.hpp +index 8824cbe..01eeb5f 100644 +--- a/src/x11/i3/ipc/workspace.hpp ++++ b/src/x11/i3/ipc/workspace.hpp +@@ -57,7 +57,7 @@ public: + [[nodiscard]] QBindable bindableActive() { return &this->bActive; } + [[nodiscard]] QBindable bindableFocused() { return &this->bFocused; } + [[nodiscard]] QBindable bindableUrgent() { return &this->bUrgent; } +- [[nodiscard]] QBindable bindableMonitor() { return &this->bMonitor; } ++ [[nodiscard]] QBindable bindableMonitor(); + [[nodiscard]] QVariantMap lastIpcObject() const; + + void updateFromObject(const QVariantMap& obj); diff --git a/pkgs/omp/package.nix b/pkgs/omp/package.nix deleted file mode 100644 index ef951d32..00000000 --- a/pkgs/omp/package.nix +++ /dev/null @@ -1,27 +0,0 @@ -# nixpkgs' omp at the version of nixpkgs master (18.11.2). -{ - lib, - omp, - fetchFromGitHub, - rustPlatform, -}: -assert lib.assertMsg ( - omp.version == "18.11.0" -) "nixpkgs has omp ${omp.version} now; drop pkgs/omp and use pkgs.omp again"; -omp.overrideAttrs ( - finalAttrs: _: { - version = "18.11.2"; - - src = fetchFromGitHub { - owner = "can1357"; - repo = "oh-my-pi"; - tag = "v${finalAttrs.version}"; - hash = "sha256-PJbclp6GbOtIFkIVXQaJYlF63ArcqHgzlRLolrzXNDI="; - }; - - cargoDeps = rustPlatform.fetchCargoVendor { - inherit (finalAttrs) src; - hash = "sha256-2gnzA/DyvVHErgYoz8ORH29Oul1xxa2msH4/VAD3Aa4="; - }; - } -) diff --git a/pkgs/piper-tts/package.nix b/pkgs/piper-tts/package.nix new file mode 100644 index 00000000..6836ba7c --- /dev/null +++ b/pkgs/piper-tts/package.nix @@ -0,0 +1,6 @@ +{ piper-tts }: +# piper-tts without Japanese support, which pulls in pyopenjtalk-plus: its +# tests fail with Cython 3.3 (fixed by NixOS/nixpkgs#576063). We only use +# English voices (configs/services/radio/tts.nix, machines/coaxmetal/hermes.nix). +# Drop this package once our nixpkgs pin includes that fix. +piper-tts.override { withJapanese = false; } diff --git a/pkgs/vector/package.nix b/pkgs/vector/package.nix new file mode 100644 index 00000000..5e83eecb --- /dev/null +++ b/pkgs/vector/package.nix @@ -0,0 +1,14 @@ +{ vector }: +# vector 0.59.0 against the current rustc: +# - #![deny(warnings)] turns the deprecation of Atomic::fetch_update into an +# error in vector-common. Downgrade the lint to warn, as nixpkgs does +# since vector 0.60.0 (NixOS/nixpkgs#576203). +# - The debug build of the test crate gets OOM-killed. Skip the tests, as +# nixpkgs does since vector 0.60.0. +# Drop this package once our nixpkgs pin includes vector 0.60.0. +vector.overrideAttrs (old: { + postPatch = (old.postPatch or "") + '' + sed -i 's/#!\[deny(warnings)]/#!\[warn(warnings)]/' lib/*/src/lib.rs src/lib.rs src/main.rs vdev/src/main.rs + ''; + doCheck = false; +}) diff --git a/tools/noctalia-shell/flake-module.nix b/tools/noctalia-shell/flake-module.nix index 84ff3419..eed310b5 100644 --- a/tools/noctalia-shell/flake-module.nix +++ b/tools/noctalia-shell/flake-module.nix @@ -1,11 +1,12 @@ { self, inputs, ... }: { perSystem = - { pkgs, ... }: + { pkgs, self', ... }: let noctalia = inputs.wrappers.lib.wrapModule { imports = [ self.wrapperModules.noctalia-shell ]; inherit pkgs; + inherit (self'.packages) noctalia-qs; # Declarative settings merged into ~/.config/noctalia/settings.json # on every start. Anything not listed here remains user-mutable. diff --git a/wrapperModules/noctalia-shell/flake-module.nix b/wrapperModules/noctalia-shell/flake-module.nix index ec9b7602..9f4143e1 100644 --- a/wrapperModules/noctalia-shell/flake-module.nix +++ b/wrapperModules/noctalia-shell/flake-module.nix @@ -18,6 +18,8 @@ ${pkgs.sway}/bin/swaymsg "workspace $ws, move workspace to output $current_output" ''; + noctalia-shell = pkgs.noctalia-shell.override { inherit (config) noctalia-qs; }; + # Patch noctalia-shell for sway: # - Use workspace name instead of number (activate() sends # "workspace number " which fails for named workspaces) @@ -29,7 +31,7 @@ # logs "Workspace doesn't exist"). A renamed workspace thus # lingers as a stale pill until a full refresh; clicking that ghost # pill then re-creates the old name as a real workspace. - swayPatched = pkgs.noctalia-shell.overrideAttrs (old: { + swayPatched = noctalia-shell.overrideAttrs (old: { postInstall = (old.postInstall or "") + '' substituteInPlace $out/share/noctalia-shell/Services/Compositor/SwayService.qml \ --replace-fail 'workspace.handle.activate();' \ @@ -100,6 +102,16 @@ ''; }; + noctalia-qs = lib.mkOption { + type = lib.types.package; + default = pkgs.noctalia-qs; + defaultText = lib.literalExpression "pkgs.noctalia-qs"; + description = '' + The quickshell fork the default package runs on. Ignored if you + override `package`. + ''; + }; + swayWorkspaceFix = lib.mkOption { type = lib.types.bool; default = true; @@ -111,9 +123,7 @@ }; }; - config.package = lib.mkDefault ( - if config.swayWorkspaceFix then swayPatched else pkgs.noctalia-shell - ); + config.package = lib.mkDefault (if config.swayWorkspaceFix then swayPatched else noctalia-shell); config.extraPackages = [ pkgs.jq