diff options
author | Alyssa Ross <hi@alyssa.is> | 2024-01-06 02:12:23 +0100 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2024-01-06 02:12:23 +0100 |
commit | f34a1b70eb86e4a63cfb88ea460345bb1aed88e3 (patch) | |
tree | 32834d23912250e0c4b86aa4420baacf8091c0fe /nixpkgs/pkgs/by-name/sw | |
parent | 003ab91dd67b093890db1dd0bab564345db6e496 (diff) | |
parent | 7a7cfff8915e06365bc2365ff33d4d413184fa9f (diff) | |
download | nixlib-f34a1b70eb86e4a63cfb88ea460345bb1aed88e3.tar nixlib-f34a1b70eb86e4a63cfb88ea460345bb1aed88e3.tar.gz nixlib-f34a1b70eb86e4a63cfb88ea460345bb1aed88e3.tar.bz2 nixlib-f34a1b70eb86e4a63cfb88ea460345bb1aed88e3.tar.lz nixlib-f34a1b70eb86e4a63cfb88ea460345bb1aed88e3.tar.xz nixlib-f34a1b70eb86e4a63cfb88ea460345bb1aed88e3.tar.zst nixlib-f34a1b70eb86e4a63cfb88ea460345bb1aed88e3.zip |
Merge branch 'nixos-unstable-small' of https://github.com/NixOS/nixpkgs
Conflicts: nixpkgs/pkgs/build-support/go/module.nix
Diffstat (limited to 'nixpkgs/pkgs/by-name/sw')
22 files changed, 908 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/by-name/sw/sway-assign-cgroups/package.nix b/nixpkgs/pkgs/by-name/sw/sway-assign-cgroups/package.nix new file mode 100644 index 000000000000..c420a32cf37b --- /dev/null +++ b/nixpkgs/pkgs/by-name/sw/sway-assign-cgroups/package.nix @@ -0,0 +1,43 @@ +{ lib +, fetchFromGitHub +, python3Packages +}: + +python3Packages.buildPythonApplication rec { + pname = "sway-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 ]; + }; +} diff --git a/nixpkgs/pkgs/by-name/sw/sway-easyfocus/package.nix b/nixpkgs/pkgs/by-name/sw/sway-easyfocus/package.nix new file mode 100644 index 000000000000..022770a22344 --- /dev/null +++ b/nixpkgs/pkgs/by-name/sw/sway-easyfocus/package.nix @@ -0,0 +1,50 @@ +{ lib +, rustPlatform +, fetchFromGitHub +, pkg-config +, wrapGAppsHook +, atk +, cairo +, gdk-pixbuf +, glib +, gtk3 +, pango +, gtk-layer-shell +}: + +rustPlatform.buildRustPackage rec { + pname = "sway-easyfocus"; + version = "unstable-2023-11-05"; + + src = fetchFromGitHub { + owner = "edzdez"; + repo = "sway-easyfocus"; + rev = "4c70f6728dbfc859e60505f0a7fd82f5a90ed42c"; + hash = "sha256-WvYXhf13ZCoa+JAF4bYgi5mI22i9pZLtbIhF1odqaTU="; + }; + + cargoHash = "sha256-9cN0ervcU8JojwG7J250fprbCD2rB9kh9TbRU+wCE/Y="; + + nativeBuildInputs = [ + pkg-config + wrapGAppsHook + ]; + + buildInputs = [ + atk + cairo + gdk-pixbuf + glib + gtk3 + gtk-layer-shell + pango + ]; + + meta = { + description = "A tool to help efficiently focus windows in Sway, inspired by i3-easyfocus"; + homepage = "https://github.com/edzdez/sway-easyfocus"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ eclairevoyant ]; + mainProgram = "sway-easyfocus"; + }; +} diff --git a/nixpkgs/pkgs/by-name/sw/sway-unwrapped/fix-paths.patch b/nixpkgs/pkgs/by-name/sw/sway-unwrapped/fix-paths.patch new file mode 100644 index 000000000000..c52f65b146b7 --- /dev/null +++ b/nixpkgs/pkgs/by-name/sw/sway-unwrapped/fix-paths.patch @@ -0,0 +1,11 @@ +--- a/sway/config.c ++++ b/sway/config.c +@@ -276,7 +276,7 @@ + + if (!(config->active_bar_modifiers = create_list())) goto cleanup; + +- if (!(config->swaybg_command = strdup("swaybg"))) goto cleanup; ++ if (!(config->swaybg_command = strdup("@swaybg@/bin/swaybg"))) goto cleanup; + + if (!(config->config_chain = create_list())) goto cleanup; + config->current_config_path = NULL; diff --git a/nixpkgs/pkgs/by-name/sw/sway-unwrapped/load-configuration-from-etc.patch b/nixpkgs/pkgs/by-name/sw/sway-unwrapped/load-configuration-from-etc.patch new file mode 100644 index 000000000000..46a170abc04a --- /dev/null +++ b/nixpkgs/pkgs/by-name/sw/sway-unwrapped/load-configuration-from-etc.patch @@ -0,0 +1,48 @@ +From 92283df3acbffa5c1bb21f23cdd686113d905114 Mon Sep 17 00:00:00 2001 +From: Patrick Hilhorst <git@hilhorst.be> +Date: Wed, 31 Mar 2021 21:14:13 +0200 +Subject: [PATCH] Load configs from /etc but fallback to /nix/store + +This change will load all configuration files from /etc, to make it easy +to override them, but fallback to /nix/store/.../etc/sway/config to make +Sway work out-of-the-box with the default configuration on non NixOS +systems. + +Original patch by Michael Weiss, updated for Sway 1.6 by Patrick Hilhorst + +Co-authored-by: Michael Weiss <dev.primeos@gmail.com> +--- + meson.build | 3 ++- + sway/config.c | 3 ++- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/meson.build b/meson.build +index b7a29660..8ae8ceb3 100644 +--- a/meson.build ++++ b/meson.build +@@ -164,7 +164,8 @@ if scdoc.found() + endforeach + endif + +-add_project_arguments('-DSYSCONFDIR="/@0@"'.format(join_paths(prefix, sysconfdir)), language : 'c') ++add_project_arguments('-DSYSCONFDIR="/@0@"'.format(sysconfdir), language : 'c') ++add_project_arguments('-DNIX_SYSCONFDIR="/@0@"'.format(join_paths(prefix, sysconfdir)), language : 'c') + + version = '"@0@"'.format(meson.project_version()) + git = find_program('git', native: true, required: false) +diff --git a/sway/config.c b/sway/config.c +index 76b9ec08..fb5b51aa 100644 +--- a/sway/config.c ++++ b/sway/config.c +@@ -374,7 +374,8 @@ static char *get_config_path(void) { + { .prefix = home, .config_folder = ".i3"}, + { .prefix = config_home, .config_folder = "i3"}, + { .prefix = SYSCONFDIR, .config_folder = "sway"}, +- { .prefix = SYSCONFDIR, .config_folder = "i3"} ++ { .prefix = SYSCONFDIR, .config_folder = "i3"}, ++ { .prefix = NIX_SYSCONFDIR, .config_folder = "sway"}, + }; + + size_t num_config_paths = sizeof(config_paths)/sizeof(config_paths[0]); +-- +2.30.1 diff --git a/nixpkgs/pkgs/by-name/sw/sway-unwrapped/package.nix b/nixpkgs/pkgs/by-name/sw/sway-unwrapped/package.nix new file mode 100644 index 000000000000..452925beeabb --- /dev/null +++ b/nixpkgs/pkgs/by-name/sw/sway-unwrapped/package.nix @@ -0,0 +1,104 @@ +{ lib, stdenv, fetchFromGitHub, fetchpatch, substituteAll, swaybg +, meson, ninja, pkg-config, wayland-scanner, scdoc +, libGL, wayland, libxkbcommon, pcre2, json_c, libevdev +, pango, cairo, libinput, gdk-pixbuf, librsvg +, wlroots_0_16, wayland-protocols, libdrm +, nixosTests +# Used by the NixOS module: +, isNixOS ? false +, enableXWayland ? true, xorg +, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd +, trayEnabled ? systemdSupport +}: + +let + wlroots = wlroots_0_16; +in +stdenv.mkDerivation (finalAttrs: { + pname = "sway-unwrapped"; + version = "1.8.1"; + + inherit enableXWayland isNixOS systemdSupport trayEnabled; + src = fetchFromGitHub { + owner = "swaywm"; + repo = "sway"; + rev = finalAttrs.version; + hash = "sha256-WxnT+le9vneQLFPz2KoBduOI+zfZPhn1fKlaqbPL6/g="; + }; + + patches = [ + ./load-configuration-from-etc.patch + + (substituteAll { + src = ./fix-paths.patch; + inherit swaybg; + }) + + (fetchpatch { + name = "LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM.patch"; + url = "https://github.com/swaywm/sway/commit/dee032d0a0ecd958c902b88302dc59703d703c7f.diff"; + hash = "sha256-dx+7MpEiAkxTBnJcsT3/1BO8rYRfNLecXmpAvhqGMD0="; + }) + ] ++ lib.optionals (!finalAttrs.isNixOS) [ + # References to /nix/store/... will get GC'ed which causes problems when + # copying the default configuration: + ./sway-config-no-nix-store-references.patch + ] ++ lib.optionals finalAttrs.isNixOS [ + # Use /run/current-system/sw/share and /etc instead of /nix/store + # references: + ./sway-config-nixos-paths.patch + ]; + + strictDeps = true; + depsBuildBuild = [ + pkg-config + ]; + + nativeBuildInputs = [ + meson ninja pkg-config wayland-scanner scdoc + ]; + + buildInputs = [ + libGL wayland libxkbcommon pcre2 json_c libevdev + pango cairo libinput gdk-pixbuf librsvg + wayland-protocols libdrm + (wlroots.override { inherit (finalAttrs) enableXWayland; }) + ] ++ lib.optionals finalAttrs.enableXWayland [ + xorg.xcbutilwm + ]; + + mesonFlags = let + # The "sd-bus-provider" meson option does not include a "none" option, + # but it is silently ignored iff "-Dtray=disabled". We use "basu" + # (which is not in nixpkgs) instead of "none" to alert us if this + # changes: https://github.com/swaywm/sway/issues/6843#issuecomment-1047288761 + # assert trayEnabled -> systemdSupport && dbusSupport; + + sd-bus-provider = if systemdSupport then "libsystemd" else "basu"; + in + [ "-Dsd-bus-provider=${sd-bus-provider}" ] + ++ lib.optional (!finalAttrs.enableXWayland) "-Dxwayland=disabled" + ++ lib.optional (!finalAttrs.trayEnabled) "-Dtray=disabled" + ; + + passthru.tests.basic = nixosTests.sway; + + meta = with lib; { + description = "An i3-compatible tiling Wayland compositor"; + longDescription = '' + Sway is a tiling Wayland compositor and a drop-in replacement for the i3 + window manager for X11. It works with your existing i3 configuration and + supports most of i3's features, plus a few extras. + Sway allows you to arrange your application windows logically, rather + than spatially. Windows are arranged into a grid by default which + maximizes the efficiency of your screen and can be quickly manipulated + using only the keyboard. + ''; + homepage = "https://swaywm.org"; + changelog = "https://github.com/swaywm/sway/releases/tag/${version}"; + license = licenses.mit; + platforms = platforms.linux; + maintainers = with maintainers; [ primeos synthetica ]; + mainProgram = "sway"; + }; +}) diff --git a/nixpkgs/pkgs/by-name/sw/sway-unwrapped/sway-config-nixos-paths.patch b/nixpkgs/pkgs/by-name/sw/sway-unwrapped/sway-config-nixos-paths.patch new file mode 100644 index 000000000000..bbb0f722b8bc --- /dev/null +++ b/nixpkgs/pkgs/by-name/sw/sway-unwrapped/sway-config-nixos-paths.patch @@ -0,0 +1,21 @@ +diff --git a/config.in b/config.in +index 08703bef..f3872730 100644 +--- a/config.in ++++ b/config.in +@@ -22,8 +22,8 @@ set $menu dmenu_path | dmenu | xargs swaymsg exec -- + + ### Output configuration + # +-# Default wallpaper (more resolutions are available in @datadir@/backgrounds/sway/) +-output * bg @datadir@/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill ++# Default wallpaper (more resolutions are available in /run/current-system/sw/share/backgrounds/sway/) ++output * bg /run/current-system/sw/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill + # + # Example configuration: + # +@@ -214,4 +214,4 @@ bar { + } + } + +-include @sysconfdir@/sway/config.d/* ++include /etc/sway/config.d/* diff --git a/nixpkgs/pkgs/by-name/sw/sway-unwrapped/sway-config-no-nix-store-references.patch b/nixpkgs/pkgs/by-name/sw/sway-unwrapped/sway-config-no-nix-store-references.patch new file mode 100644 index 000000000000..009c12959430 --- /dev/null +++ b/nixpkgs/pkgs/by-name/sw/sway-unwrapped/sway-config-no-nix-store-references.patch @@ -0,0 +1,21 @@ +diff --git a/config.in b/config.in +--- a/config.in ++++ b/config.in +@@ -21,8 +21,8 @@ set $menu dmenu_path | dmenu | xargs swaymsg exec + + ### Output configuration + # +-# Default wallpaper (more resolutions are available in @datadir@/backgrounds/sway/) +-output * bg @datadir@/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill ++# Default wallpaper ++#output * bg ~/.config/sway/backgrounds/Sway_Wallpaper_Blue_1920x1080.png fill + # + # Example configuration: + # +@@ -213,5 +213,3 @@ bar { + inactive_workspace #32323200 #32323200 #5c5c5c + } + } +- +-include @sysconfdir@/sway/config.d/* + diff --git a/nixpkgs/pkgs/by-name/sw/sway/package.nix b/nixpkgs/pkgs/by-name/sw/sway/package.nix new file mode 100644 index 000000000000..3e9ed51613f8 --- /dev/null +++ b/nixpkgs/pkgs/by-name/sw/sway/package.nix @@ -0,0 +1,65 @@ +{ lib +, sway-unwrapped +, makeWrapper, symlinkJoin, writeShellScriptBin +, withBaseWrapper ? true, extraSessionCommands ? "", dbus +, withGtkWrapper ? false, wrapGAppsHook, gdk-pixbuf, glib, gtk3 +, extraOptions ? [] # E.g.: [ "--verbose" ] +# Used by the NixOS module: +, isNixOS ? false + +, enableXWayland ? true +, dbusSupport ? true +}: + +assert extraSessionCommands != "" -> withBaseWrapper; + +with lib; + +let + sway = sway-unwrapped.overrideAttrs (oa: { inherit isNixOS enableXWayland; }); + baseWrapper = writeShellScriptBin sway.meta.mainProgram '' + set -o errexit + if [ ! "$_SWAY_WRAPPER_ALREADY_EXECUTED" ]; then + export XDG_CURRENT_DESKTOP=${sway.meta.mainProgram} + ${extraSessionCommands} + export _SWAY_WRAPPER_ALREADY_EXECUTED=1 + fi + if [ "$DBUS_SESSION_BUS_ADDRESS" ]; then + export DBUS_SESSION_BUS_ADDRESS + exec ${lib.getExe sway} "$@" + else + exec ${lib.optionalString dbusSupport "${dbus}/bin/dbus-run-session"} ${lib.getExe sway} "$@" + fi + ''; +in symlinkJoin rec { + pname = lib.replaceStrings ["-unwrapped"] [""] sway.pname; + inherit (sway) version; + name = "${pname}-${version}"; + + paths = (optional withBaseWrapper baseWrapper) + ++ [ sway ]; + + strictDeps = false; + nativeBuildInputs = [ makeWrapper ] + ++ (optional withGtkWrapper wrapGAppsHook); + + buildInputs = optionals withGtkWrapper [ gdk-pixbuf glib gtk3 ]; + + # We want to run wrapProgram manually + dontWrapGApps = true; + + postBuild = '' + ${optionalString withGtkWrapper "gappsWrapperArgsHook"} + + wrapProgram $out/bin/${sway.meta.mainProgram} \ + ${optionalString withGtkWrapper ''"''${gappsWrapperArgs[@]}"''} \ + ${optionalString (extraOptions != []) "${concatMapStrings (x: " --add-flags " + x) extraOptions}"} + ''; + + passthru = { + inherit (sway.passthru) tests; + providedSessions = [ sway.meta.mainProgram ]; + }; + + inherit (sway) meta; +} diff --git a/nixpkgs/pkgs/by-name/sw/swaybg/package.nix b/nixpkgs/pkgs/by-name/sw/swaybg/package.nix new file mode 100644 index 000000000000..aa5d12cdfc4f --- /dev/null +++ b/nixpkgs/pkgs/by-name/sw/swaybg/package.nix @@ -0,0 +1,40 @@ +{ lib, stdenv, fetchFromGitHub +, meson, ninja, pkg-config, scdoc +, wayland, wayland-protocols, cairo, gdk-pixbuf +, wayland-scanner +}: + +stdenv.mkDerivation rec { + pname = "swaybg"; + version = "1.2.0"; + + src = fetchFromGitHub { + owner = "swaywm"; + repo = "swaybg"; + rev = "v${version}"; + hash = "sha256-Qk5iGALlSVSzgBJzYzyLdLHhj/Zq1R4nFseACBmIBuA="; + }; + + strictDeps = true; + depsBuildBuild = [ pkg-config ]; + nativeBuildInputs = [ meson ninja pkg-config scdoc wayland-scanner ]; + buildInputs = [ wayland wayland-protocols cairo gdk-pixbuf ]; + + mesonFlags = [ + "-Dgdk-pixbuf=enabled" "-Dman-pages=enabled" + ]; + + meta = with lib; { + description = "Wallpaper tool for Wayland compositors"; + inherit (src.meta) homepage; + longDescription = '' + A wallpaper utility for Wayland compositors, that is compatible with any + Wayland compositor which implements the following Wayland protocols: + wlr-layer-shell, xdg-output, and xdg-shell. + ''; + license = licenses.mit; + mainProgram = "swaybg"; + maintainers = with maintainers; [ primeos ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/by-name/sw/swaycons/package.nix b/nixpkgs/pkgs/by-name/sw/swaycons/package.nix new file mode 100644 index 000000000000..c990a2bb5186 --- /dev/null +++ b/nixpkgs/pkgs/by-name/sw/swaycons/package.nix @@ -0,0 +1,26 @@ +{ lib +, fetchFromGitHub +, rustPlatform +}: + +rustPlatform.buildRustPackage rec { + pname = "swaycons"; + version = "unstable-2023-01-05"; + + src = fetchFromGitHub { + owner = "ActuallyAllie"; + repo = "swaycons"; + rev = "e863599fb56177fc9747d60db661be2d7c2d290b"; + hash = "sha256-zkCpZ3TehFKNePtSyFaEk+MA4mi1+la9yFjRPFy+eq8="; + }; + + cargoSha256 = "sha256-GcoRx52dwL/ehJ1Xg6xQHVzPIKXWqBrG7IjzxRjfgqA="; + + meta = with lib; { + description = "Window Icons in Sway with Nerd Fonts!"; + homepage = "https://github.com/ActuallyAllie/swaycons"; + license = licenses.asl20; + platforms = [ "x86_64-linux" ]; + maintainers = with maintainers; [ aacebedo ]; + }; +} diff --git a/nixpkgs/pkgs/by-name/sw/swayest-workstyle/package.nix b/nixpkgs/pkgs/by-name/sw/swayest-workstyle/package.nix new file mode 100644 index 000000000000..2867db53f371 --- /dev/null +++ b/nixpkgs/pkgs/by-name/sw/swayest-workstyle/package.nix @@ -0,0 +1,29 @@ +{ lib +, rustPlatform +, fetchFromGitHub +}: + +rustPlatform.buildRustPackage rec { + pname = "swayest-workstyle"; + version = "1.3.5"; + + src = fetchFromGitHub { + owner = "Lyr-7D1h"; + repo = "swayest_workstyle"; + rev = version; + sha256 = "sha256-Dk6rAiz7PXUfyy9fWMtSVRjaWWl66n38gTNyWKqeqkU="; + }; + + cargoHash = "sha256-sLQPq3tyWq1TxxeFyg05qBt+KGI/vO0jLU7wJLiqcYA="; + + doCheck = false; # No tests + + meta = with lib; { + description = "Map sway workspace names to icons defined depending on the windows inside of the workspace"; + homepage = "https://github.com/Lyr-7D1h/swayest_workstyle"; + license = licenses.mit; + platforms = platforms.linux; + maintainers = with maintainers; [ miangraham ]; + mainProgram = "sworkstyle"; + }; +} diff --git a/nixpkgs/pkgs/by-name/sw/swayfx-unwrapped/package.nix b/nixpkgs/pkgs/by-name/sw/swayfx-unwrapped/package.nix new file mode 100644 index 000000000000..b49496f1383d --- /dev/null +++ b/nixpkgs/pkgs/by-name/sw/swayfx-unwrapped/package.nix @@ -0,0 +1,60 @@ +{ + lib, + fetchFromGitHub, + sway-unwrapped, + stdenv, + systemd, + # Used by the NixOS module: + isNixOS ? false, + enableXWayland ? true, + systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd, + trayEnabled ? systemdSupport, +}: + +(sway-unwrapped.override { + inherit + isNixOS + enableXWayland + systemdSupport + trayEnabled + ; +}).overrideAttrs (oldAttrs: rec { + pname = "swayfx-unwrapped"; + version = "0.3.2"; + + src = fetchFromGitHub { + owner = "WillPower3309"; + repo = "swayfx"; + rev = version; + sha256 = "sha256-Gwewb0yDVhEBrefSSGDf1hLtpWcntzifPCPJQhqLqI0="; + }; + + # This patch was backported into SwayFX + # remove when next release is rebased on Sway 1.9 + patches = + let + removePatches = [ + "LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM.patch" + ]; + in + builtins.filter + (patch: !builtins.elem (patch.name or null) removePatches) + (oldAttrs.patches or [ ]); + + meta = with lib; { + description = "Sway, but with eye candy!"; + homepage = "https://github.com/WillPower3309/swayfx"; + license = licenses.mit; + maintainers = with maintainers; [ eclairevoyant ricarch97 ]; + platforms = platforms.linux; + mainProgram = "sway"; + + longDescription = '' + Fork of Sway, an incredible and one of the most well established Wayland + compositors, and a drop-in replacement for the i3 window manager for X11. + SwayFX adds extra options and effects to the original Sway, such as rounded corners, + shadows and inactive window dimming to bring back some of the Picom X11 + compositor functionality, which was commonly used with the i3 window manager. + ''; + }; +}) diff --git a/nixpkgs/pkgs/by-name/sw/swayfx/package.nix b/nixpkgs/pkgs/by-name/sw/swayfx/package.nix new file mode 100644 index 000000000000..9583f9b7a710 --- /dev/null +++ b/nixpkgs/pkgs/by-name/sw/swayfx/package.nix @@ -0,0 +1,26 @@ +{ + lib, + swayfx-unwrapped, + sway, + # Used by the NixOS module: + withBaseWrapper ? true, + extraSessionCommands ? "", + withGtkWrapper ? false, + extraOptions ? [ ], # E.g.: [ "--verbose" ] + isNixOS ? false, + enableXWayland ? true, + dbusSupport ? true, +}: + +sway.override { + inherit + withBaseWrapper + extraSessionCommands + withGtkWrapper + extraOptions + isNixOS + enableXWayland + dbusSupport + ; + sway-unwrapped = swayfx-unwrapped; +} diff --git a/nixpkgs/pkgs/by-name/sw/swayidle/package.nix b/nixpkgs/pkgs/by-name/sw/swayidle/package.nix new file mode 100644 index 000000000000..0ee08dc7ca1d --- /dev/null +++ b/nixpkgs/pkgs/by-name/sw/swayidle/package.nix @@ -0,0 +1,42 @@ +{ lib, stdenv, fetchFromGitHub +, meson, ninja, pkg-config, scdoc, wayland-scanner +, wayland, wayland-protocols, runtimeShell +, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd +}: + +stdenv.mkDerivation rec { + pname = "swayidle"; + version = "1.8.0"; + + src = fetchFromGitHub { + owner = "swaywm"; + repo = "swayidle"; + rev = version; + hash = "sha256-/U6Y9H5ZqIJph3TZVcwr9+Qfd6NZNYComXuC1D9uGHg="; + }; + + strictDeps = true; + nativeBuildInputs = [ meson ninja pkg-config scdoc wayland-scanner ]; + buildInputs = [ wayland wayland-protocols ] + ++ lib.optionals systemdSupport [ systemd ]; + + mesonFlags = [ "-Dman-pages=enabled" "-Dlogind=${if systemdSupport then "enabled" else "disabled"}" ]; + + postPatch = '' + substituteInPlace main.c \ + --replace '"sh"' '"${runtimeShell}"' + ''; + + meta = with lib; { + description = "Idle management daemon for Wayland"; + inherit (src.meta) homepage; + longDescription = '' + Sway's idle management daemon. It is compatible with any Wayland + compositor which implements the KDE idle protocol. + ''; + license = licenses.mit; + mainProgram = "swayidle"; + maintainers = with maintainers; [ primeos ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/by-name/sw/swaylock-effects/package.nix b/nixpkgs/pkgs/by-name/sw/swaylock-effects/package.nix new file mode 100644 index 000000000000..c5dbf3766f06 --- /dev/null +++ b/nixpkgs/pkgs/by-name/sw/swaylock-effects/package.nix @@ -0,0 +1,53 @@ +{ lib +, stdenv +, fetchFromGitHub +, meson +, ninja +, pkg-config +, scdoc +, wayland +, wayland-protocols +, wayland-scanner +, libxkbcommon +, cairo +, gdk-pixbuf +, pam +}: + +stdenv.mkDerivation rec { + pname = "swaylock-effects"; + version = "1.7.0.0"; + + src = fetchFromGitHub { + owner = "jirutka"; + repo = "swaylock-effects"; + rev = "v${version}"; + sha256 = "sha256-cuFM+cbUmGfI1EZu7zOsQUj4rA4Uc4nUXcvIfttf9zE="; + }; + + postPatch = '' + sed -iE "s/version: '1\.3',/version: '${version}',/" meson.build + ''; + + strictDeps = true; + nativeBuildInputs = [ meson ninja pkg-config scdoc wayland-scanner]; + buildInputs = [ wayland wayland-protocols libxkbcommon cairo gdk-pixbuf pam ]; + + mesonFlags = [ + "-Dpam=enabled" + "-Dgdk-pixbuf=enabled" + "-Dman-pages=enabled" + ]; + + meta = with lib; { + description = "Screen locker for Wayland"; + longDescription = '' + Swaylock, with fancy effects + ''; + mainProgram = "swaylock"; + inherit (src.meta) homepage; + license = licenses.mit; + platforms = platforms.linux; + maintainers = with maintainers; [ gnxlxnxx ]; + }; +} diff --git a/nixpkgs/pkgs/by-name/sw/swaylock-fancy/package.nix b/nixpkgs/pkgs/by-name/sw/swaylock-fancy/package.nix new file mode 100644 index 000000000000..83d56def4dcc --- /dev/null +++ b/nixpkgs/pkgs/by-name/sw/swaylock-fancy/package.nix @@ -0,0 +1,67 @@ +{ lib +, stdenv +, fetchFromGitHub +, coreutils +, grim +, gawk +, jq +, swaylock +, imagemagick +, getopt +, fontconfig +, wmctrl +, makeWrapper +, bash +}: + +let + depsPath = lib.makeBinPath [ + coreutils + grim + gawk + jq + swaylock + imagemagick + getopt + fontconfig + wmctrl + ]; + mainProgram = "swaylock-fancy"; +in + +stdenv.mkDerivation { + pname = "swaylock-fancy"; + version = "unstable-2023-11-21"; + + src = fetchFromGitHub { + owner = "Big-B"; + repo = "swaylock-fancy"; + rev = "ff37ae3c6d0f100f81ff64fdb9d422c37de2f4f6"; + hash = "sha256-oS4YCbZOIrMP4QSM5eHWzTn18k3w2OnJ2k+64x/DnuM="; + }; + + postPatch = '' + substituteInPlace ${mainProgram} \ + --replace "/usr/share" "$out/share" + ''; + + strictDeps = true; + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ bash ]; + + makeFlags = [ "PREFIX=${placeholder "out"}" ]; + + postInstall = '' + wrapProgram $out/bin/${mainProgram} \ + --prefix PATH : "${depsPath}" + ''; + + meta = with lib; { + description = "This is an swaylock bash script that takes a screenshot of the desktop, blurs the background and adds a lock icon and text"; + homepage = "https://github.com/Big-B/swaylock-fancy"; + license = licenses.mit; + platforms = platforms.linux; + maintainers = with maintainers; [ frogamic ]; + inherit mainProgram; + }; +} diff --git a/nixpkgs/pkgs/by-name/sw/swaylock/package.nix b/nixpkgs/pkgs/by-name/sw/swaylock/package.nix new file mode 100644 index 000000000000..0b438df13d28 --- /dev/null +++ b/nixpkgs/pkgs/by-name/sw/swaylock/package.nix @@ -0,0 +1,39 @@ +{ lib, stdenv, fetchFromGitHub, fetchpatch +, meson, ninja, pkg-config, scdoc, wayland-scanner +, wayland, wayland-protocols, libxkbcommon, cairo, gdk-pixbuf, pam +}: + +stdenv.mkDerivation rec { + pname = "swaylock"; + version = "1.7.2"; + + src = fetchFromGitHub { + owner = "swaywm"; + repo = "swaylock"; + rev = "v${version}"; + hash = "sha256-ZsOLDqmkyhel8QAezdVZ51utruJrBZWqaZ7NzimXWQ4="; + }; + + strictDeps = true; + depsBuildBuild = [ pkg-config ]; + nativeBuildInputs = [ meson ninja pkg-config scdoc wayland-scanner ]; + buildInputs = [ wayland wayland-protocols libxkbcommon cairo gdk-pixbuf pam ]; + + mesonFlags = [ + "-Dpam=enabled" "-Dgdk-pixbuf=enabled" "-Dman-pages=enabled" + ]; + + meta = with lib; { + description = "Screen locker for Wayland"; + longDescription = '' + swaylock is a screen locking utility for Wayland compositors. + Important note: If you don't use the Sway module (programs.sway.enable) + you need to set "security.pam.services.swaylock = {};" manually. + ''; + inherit (src.meta) homepage; + mainProgram = "swaylock"; + license = licenses.mit; + platforms = platforms.linux; + maintainers = with maintainers; [ primeos ]; + }; +} diff --git a/nixpkgs/pkgs/by-name/sw/swayosd/package.nix b/nixpkgs/pkgs/by-name/sw/swayosd/package.nix new file mode 100644 index 000000000000..d3bd68ea1e4e --- /dev/null +++ b/nixpkgs/pkgs/by-name/sw/swayosd/package.nix @@ -0,0 +1,71 @@ +{ lib +, rustPlatform +, fetchFromGitHub +, pkg-config +, wrapGAppsHook +, cargo +, coreutils +, gtk-layer-shell +, libevdev +, libinput +, libpulseaudio +, meson +, ninja +, rustc +, stdenv +, udev +}: + +stdenv.mkDerivation rec { + pname = "swayosd"; + version = "unstable-2023-09-26"; + + src = fetchFromGitHub { + owner = "ErikReider"; + repo = "SwayOSD"; + rev = "1c7d2f5b3ee262f25bdd3c899eadf17efb656d26"; + hash = "sha256-Y22O6Ktya/WIhidnoyxnZu5YvXWNmSS6vecDU8zDD34="; + }; + + cargoDeps = rustPlatform.fetchCargoTarball { + inherit src; + name = "${pname}-${version}"; + hash = "sha256-tqbMlygX+n14oR1t+0ngjiSG2mHUk/NbiWHk4yEAb2o="; + }; + + nativeBuildInputs = [ + wrapGAppsHook + pkg-config + meson + rustc + cargo + ninja + rustPlatform.cargoSetupHook + ]; + + buildInputs = [ + gtk-layer-shell + libevdev + libinput + libpulseaudio + udev + ]; + + patches = [ + ./swayosd_systemd_paths.patch + ]; + + postPatch = '' + substituteInPlace data/udev/99-swayosd.rules \ + --replace /bin/chgrp ${coreutils}/bin/chgrp \ + --replace /bin/chmod ${coreutils}/bin/chmod + ''; + + meta = with lib; { + description = "A GTK based on screen display for keyboard shortcuts"; + homepage = "https://github.com/ErikReider/SwayOSD"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ aleksana barab-i ]; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/by-name/sw/swayosd/swayosd_systemd_paths.patch b/nixpkgs/pkgs/by-name/sw/swayosd/swayosd_systemd_paths.patch new file mode 100644 index 000000000000..35d335df5794 --- /dev/null +++ b/nixpkgs/pkgs/by-name/sw/swayosd/swayosd_systemd_paths.patch @@ -0,0 +1,17 @@ +diff --git a/data/meson.build b/data/meson.build +index fc687a5..68decdf 100644 +--- a/data/meson.build ++++ b/data/meson.build +@@ -41,11 +42,7 @@ configure_file( + + # Systemd service unit + systemd = dependency('systemd', required: false) +-if systemd.found() +- systemd_service_install_dir = systemd.get_variable(pkgconfig :'systemdsystemunitdir') +-else +- systemd_service_install_dir = join_paths(libdir, 'systemd', 'system') +-endif ++systemd_service_install_dir = join_paths(libdir, 'systemd', 'system') + + configure_file( + configuration: conf_data, diff --git a/nixpkgs/pkgs/by-name/sw/swayws/package.nix b/nixpkgs/pkgs/by-name/sw/swayws/package.nix new file mode 100644 index 000000000000..999581153ac9 --- /dev/null +++ b/nixpkgs/pkgs/by-name/sw/swayws/package.nix @@ -0,0 +1,29 @@ +{ lib, fetchFromGitLab, rustPlatform }: + +rustPlatform.buildRustPackage rec { + pname = "swayws"; + version = "1.2.0"; + + src = fetchFromGitLab { + owner = "w0lff"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-f0kXy7/31imgHHqKPmW9K+QrLqroaPaXwlJkzOoezRU="; + }; + + cargoSha256 = "sha256-VYT6wV59fraAoJgR/i6GlO8s7LUoehGtxPAggEL1eLo="; + # Required patch until upstream fixes https://gitlab.com/w0lff/swayws/-/issues/1 + cargoPatches = [ + ./ws-update-Cargo-lock.patch + ]; + + # swayws does not have any tests + doCheck = false; + + meta = with lib; { + description = "A sway workspace tool which allows easy moving of workspaces to and from outputs"; + homepage = "https://gitlab.com/w0lff/swayws"; + license = licenses.mit; + maintainers = [ maintainers.atila ]; + }; +} diff --git a/nixpkgs/pkgs/by-name/sw/swayws/ws-update-Cargo-lock.patch b/nixpkgs/pkgs/by-name/sw/swayws/ws-update-Cargo-lock.patch new file mode 100644 index 000000000000..e1d7614e8bfa --- /dev/null +++ b/nixpkgs/pkgs/by-name/sw/swayws/ws-update-Cargo-lock.patch @@ -0,0 +1,13 @@ +diff --git a/Cargo.lock b/Cargo.lock +index f01f824..e00d079 100644 +--- a/Cargo.lock ++++ b/Cargo.lock +@@ -328,7 +328,7 @@ dependencies = [ + + [[package]] + name = "swayws" +-version = "1.1.1" ++version = "1.2.0" + dependencies = [ + "clap", + "env_logger", diff --git a/nixpkgs/pkgs/by-name/sw/swaywsr/package.nix b/nixpkgs/pkgs/by-name/sw/swaywsr/package.nix new file mode 100644 index 000000000000..23a82bd2df08 --- /dev/null +++ b/nixpkgs/pkgs/by-name/sw/swaywsr/package.nix @@ -0,0 +1,33 @@ +{ lib, fetchFromGitHub, rustPlatform, libxcb, python3 }: + +rustPlatform.buildRustPackage rec { + pname = "swaywsr"; + version = "1.1.1"; + + src = fetchFromGitHub { + owner = "pedroscaff"; + repo = pname; + rev = "0276b43824af5c40085248c1275feaa372c412a5"; + sha256 = "sha256-KCMsn9uevmmjHkP4zwfaWSUI10JgT3M91iqmXI9Cv2Y="; + }; + + cargoSha256 = "sha256-j/9p28ezy8m5NXReOmG1oryWd+GcY/fNW6i7OrEvjSc="; + + nativeBuildInputs = [ python3 ]; + buildInputs = [ libxcb ]; + + # has not tests + doCheck = false; + + meta = with lib; { + description = "Automatically change sway workspace names based on their contents"; + longDescription = '' + Automatically sets the workspace names to match the windows on the workspace. + The chosen name for a workspace is a composite of the app_id or WM_CLASS X11 + window property for each window in a workspace. + ''; + homepage = "https://github.com/pedroscaff/swaywsr"; + license = licenses.mit; + maintainers = [ maintainers.sebbadk ]; + }; +} |