sway-assign-cgroups: init at 0.4.0 (#268949)

This commit is contained in:
Nick Hu 2023-12-01 10:18:42 +00:00 committed by GitHub
parent 791dbd64f8
commit 3fde91cc13
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 44 additions and 0 deletions

View file

@ -0,0 +1,43 @@
{ lib
, fetchFromGitHub
, python3Packages
}:
python3Packages.buildPythonApplication rec {
pname = "assign-cgroups";
version = "0.4.0";
src = fetchFromGitHub {
owner = "alebastr";
repo = "sway-systemd";
rev = "v${version}";
sha256 = "sha256-wznYE1/lVJtvf5Nq96gbPYisxc2gWLahVydwcH1vwoQ=";
};
format = "other";
propagatedBuildInputs = with python3Packages; [ dbus-next i3ipc psutil tenacity xlib ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp src/assign-cgroups.py $out/bin/
runHook postInstall
'';
meta = with lib; {
description = "Place GUI applications into systemd scopes for systemd-oomd compatibility.";
longDescription = ''
Automatically assign a dedicated systemd scope to the GUI applications
launched in the same cgroup as the compositor. This could be helpful for
implementing cgroup-based resource management and would be necessary when
`systemd-oomd` is in use.
Limitations: The script is using i3ipc window:new event to detect application
launches and would fail to detect background apps or special surfaces.
Therefore it's recommended to supplement the script with use of systemd user
services for such background apps.
'';
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [ nickhu ];
};
}

View file

@ -32648,6 +32648,7 @@ with pkgs;
swayosd = callPackage ../applications/window-managers/sway/osd.nix { };
swayws = callPackage ../applications/window-managers/sway/ws.nix { };
swaywsr = callPackage ../applications/window-managers/sway/wsr.nix { };
sway-assign-cgroups = callPackage ../applications/window-managers/sway/assign-cgroups.nix { };
sway-contrib = recurseIntoAttrs (callPackages ../applications/window-managers/sway/contrib.nix { });
swaycons = callPackage ../applications/window-managers/sway/swaycons.nix { };