diff options
| author | Arpit Chakladar <arpitchakladar+git@gmail.com> | 2026-08-29 02:12:51 +0530 |
|---|---|---|
| committer | Arpit Chakladar <arpitchakladar+git@gmail.com> | 2026-08-29 03:50:32 +0530 |
| commit | 1cc7caf459c25f8dea24e40e68b89aaf4862eef4 (patch) | |
| tree | b2bd5ef2558b4fa36041049c87c0ae020217e5c6 /modules/desktop/eww/yuck.nix | |
| parent | 41bdeb88009dd232808edee9fc0e4ae94358d8d6 (diff) | |
| download | home-manager-config-1cc7caf459c25f8dea24e40e68b89aaf4862eef4.tar.gz home-manager-config-1cc7caf459c25f8dea24e40e68b89aaf4862eef4.zip | |
refactor: using the script maker script everywhere
Diffstat (limited to 'modules/desktop/eww/yuck.nix')
| -rw-r--r-- | modules/desktop/eww/yuck.nix | 97 |
1 files changed, 25 insertions, 72 deletions
diff --git a/modules/desktop/eww/yuck.nix b/modules/desktop/eww/yuck.nix index db49e99..611adf6 100644 --- a/modules/desktop/eww/yuck.nix +++ b/modules/desktop/eww/yuck.nix @@ -4,89 +4,42 @@ pkgs, ... }: +let + inherit ((import ../../lib/script.nix { inherit lib pkgs; })) mkPythonScript; +in { config = lib.mkIf config.desktop.enable { programs.eww.yuckConfig = let - pythonEnv = pkgs.python3.withPackages (ps: [ ps.pygobject3 ]); - system-stats = pkgs.stdenv.mkDerivation { - pname = "eww-system-stats"; - version = "0.1.0"; - src = ./system-stats.py; - dontUnpack = true; - meta.mainProgram = "eww-system-stats"; - - nativeBuildInputs = [ + system-stats = mkPythonScript { + name = "eww-system-stats"; + path = ./system-stats.py; + description = "Emit {cpu, ram, net} as JSON."; + deps = [ pkgs.iw + pkgs.iproute2 pkgs.pamixer - pkgs.wrapGAppsHook3 - pkgs.gobject-introspection + pkgs.inotify-tools + pkgs.dmidecode ]; - buildInputs = [ pkgs.gtk3 ]; - - installPhase = '' - mkdir -p $out/bin - install -m755 $src $out/bin/eww-system-stats - patchShebangs $out/bin/eww-system-stats - ''; - - # wrapGAppsHook3 wraps every executable in $out/bin automatically, - # setting GI_TYPELIB_PATH etc. from buildInputs' closure. - preFixup = '' - gappsWrapperArgs+=(--prefix PATH : "${pythonEnv}/bin") - ''; }; - workspaces = pkgs.stdenv.mkDerivation { - pname = "eww-workspaces"; - version = "0.1.0"; - src = ./workspaces.py; - dontUnpack = true; - meta.mainProgram = "eww-workspaces"; - - nativeBuildInputs = [ - pkgs.wrapGAppsHook3 - pkgs.gobject-introspection - ]; - buildInputs = [ pkgs.gtk3 ]; - - installPhase = '' - mkdir -p $out/bin - install -m755 $src $out/bin/eww-workspaces - patchShebangs $out/bin/eww-workspaces - ''; - - # wrapGAppsHook3 wraps every executable in $out/bin automatically, - # setting GI_TYPELIB_PATH etc. from buildInputs' closure. - preFixup = '' - gappsWrapperArgs+=(--prefix PATH : "${pythonEnv}/bin") - ''; + workspaces = mkPythonScript { + name = "eww-workspaces"; + path = ./workspaces.py; + description = "Emit workspace list with each focused-app icon, driven by niri's event-stream."; + pythonPackages = (ps: [ ps.pygobject3 ]); + deps = [ config.desktop.niri.package ]; + gobjectIntrospection = true; }; - activate-windows = pkgs.stdenv.mkDerivation { - pname = "eww-activate-windows"; - version = "0.1.0"; - src = ./activate-windows.py; - dontUnpack = true; - meta.mainProgram = "eww-activate-windows"; - - nativeBuildInputs = [ - pkgs.wrapGAppsHook3 - pkgs.gobject-introspection - ]; - buildInputs = [ pkgs.gtk3 ]; - - installPhase = '' - mkdir -p $out/bin - install -m755 $src $out/bin/eww-activate-windows - patchShebangs $out/bin/eww-activate-windows - ''; - - # wrapGAppsHook3 wraps every executable in $out/bin automatically, - # setting GI_TYPELIB_PATH etc. from buildInputs' closure. - preFixup = '' - gappsWrapperArgs+=(--prefix PATH : "${pythonEnv}/bin") - ''; + activate-windows = mkPythonScript { + name = "eww-activate-windows"; + path = ./activate-windows.py; + description = "Emit icons for windows on the active niri workspace via event-stream."; + pythonPackages = (ps: [ ps.pygobject3 ]); + deps = [ config.desktop.niri.package ]; + gobjectIntrospection = true; }; in builtins.replaceStrings |
