From 91fecfd631fb5530c19f3c44b2951ad60c261cf8 Mon Sep 17 00:00:00 2001 From: Henro Veijer Date: Wed, 25 Feb 2026 15:59:10 +0100 Subject: [PATCH] rebuild nix files --- henrovnix_ok/home/desktop/hyprscrolling.nix | 58 ++++++--------------- 1 file changed, 15 insertions(+), 43 deletions(-) diff --git a/henrovnix_ok/home/desktop/hyprscrolling.nix b/henrovnix_ok/home/desktop/hyprscrolling.nix index 4aab8892d..a220274f2 100644 --- a/henrovnix_ok/home/desktop/hyprscrolling.nix +++ b/henrovnix_ok/home/desktop/hyprscrolling.nix @@ -1,52 +1,24 @@ +# home/desktop/hyprscrolling.nix (Home-Manager module) +# home/desktop/hyprscrolling.nix (Home-Manager module) { config, lib, pkgs, flakeRoot, ... }: let cfg = config.programs.hyprscrolling; - defaultPluginPkg = (pkgs.hyprlandPlugins.hyprscrolling or null); - # Stable paths (avoid pinning /nix/store/... in your hyprland.conf) - stableSoPath = "/etc/hypr/plugins/libhyprscrolling.so"; - dropInConfPath = "/etc/hypr/conf.d/90-hyprscrolling.conf"; - # Read drop-in config from your repo (flake root) - dropInConfSourcePath = flakeRoot + "/assets/conf/desktop/hypr/hyprscrolling.conf"; - dropInConf = builtins.readFile dropInConfSourcePath; + repoConf = flakeRoot + "/assets/conf/desktop/hypr/hyprscrolling.conf"; + targetRel = "hypr/conf.d/90-hyprscrolling.conf"; in { - options.programs.hyprscrolling = { - enable = lib.mkEnableOption "Hyprland hyprscrolling (scrolling layout) plugin (NixOS-friendly)"; - pluginPackage = lib.mkOption { - type = lib.types.nullOr lib.types.package; - default = defaultPluginPkg; - description = '' - Package that provides the hyprscrolling plugin. - Defaults to pkgs.hyprlandPlugins.hyprscrolling when available. + options.programs.hyprscrolling.enable = + lib.mkEnableOption "hyprscrolling Hyprland plugin"; + config = lib.mkIf cfg.enable { + wayland.windowManager.hyprland = { + # the key part: load plugin like you did for hyprshell + plugins = [ pkgs.hyprlandPlugins.hyprscrolling ]; + # source the generated drop-in + extraConfig = lib.mkAfter '' + source = ~/.config/${targetRel} ''; }; - # Where we install the generated config snippet (so you can `source = ...` it) - dropInPath = lib.mkOption { - type = lib.types.str; - default = dropInConfPath; - description = "Path to the Hyprland drop-in config file (needs to be sourced by your hyprland.conf)."; - }; - # Where we install a stable symlink to the plugin .so - stablePluginSoPath = lib.mkOption { - type = lib.types.str; - default = stableSoPath; - description = "Stable path for the plugin shared object (symlinked to the Nix store)."; - }; - }; - config = lib.mkIf cfg.enable { - assertions = [ - { - assertion = cfg.pluginPackage != null; - message = '' - Could not find hyprscrolling plugin package in this nixpkgs. - Set programs.hyprscrolling.pluginPackage explicitly (e.g. pkgs.hyprlandPlugins.hyprscrolling). - ''; - } - ]; - environment.systemPackages = [ cfg.pluginPackage ]; - environment.etc."hypr/plugins/libhyprscrolling.so".source = - "${cfg.pluginPackage}/lib/libhyprscrolling.so"; - # Now /etc/hypr/conf.d/90-hyprscrolling.conf is exactly your file’s contents - environment.etc."hypr/conf.d/90-hyprscrolling.conf".text = dropInConf; + # place your repo config into ~/.config/hypr/conf.d/... + xdg.configFile."${targetRel}".source = repoConf; }; }