From d52fa533483703c219d445c9626d8d0fb5bf29c1 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 18 Mar 2024 16:33:41 +0300 Subject: [PATCH 1/4] treewide: start transitioning to nixpkgs package structure --- .../{ => applications/misc}/ani-cli/README.md | 0 .../misc}/ani-cli/default.nix | 0 .../misc}/cloneit/default.nix | 0 .../misc}/mov-cli/default.nix | 0 pkgs/{ => applications/misc}/rat/default.nix | 0 .../misc}/rofi-calc-wayland/default.nix | 0 .../misc}/rofi-emoji-wayland/default.nix | 0 .../networking}/headscale-ui/default.nix | 0 .../networking}/reposilite-bin/default.nix | 0 .../social}/mastodon-bird-ui/default.nix | 0 .../0001-fullscreen-transparency.patch | 111 ++++++++++++++++++ .../foot-transparent/default.nix | 26 ++++ pkgs/default.nix | 66 +---------- .../gnome/gnome-control-center/default.nix | 13 ++ pkgs/tools/nix/alejandra-no-ads/default.nix | 4 + pkgs/top-level.nix | 33 ++++++ 16 files changed, 190 insertions(+), 63 deletions(-) rename pkgs/{ => applications/misc}/ani-cli/README.md (100%) rename pkgs/{ => applications/misc}/ani-cli/default.nix (100%) rename pkgs/{ => applications/misc}/cloneit/default.nix (100%) rename pkgs/{ => applications/misc}/mov-cli/default.nix (100%) rename pkgs/{ => applications/misc}/rat/default.nix (100%) rename pkgs/{ => applications/misc}/rofi-calc-wayland/default.nix (100%) rename pkgs/{ => applications/misc}/rofi-emoji-wayland/default.nix (100%) rename pkgs/{ => applications/networking}/headscale-ui/default.nix (100%) rename pkgs/{ => applications/networking}/reposilite-bin/default.nix (100%) rename pkgs/{ => applications/social}/mastodon-bird-ui/default.nix (100%) create mode 100644 pkgs/applications/terminal-emulators/foot-transparent/0001-fullscreen-transparency.patch create mode 100644 pkgs/applications/terminal-emulators/foot-transparent/default.nix create mode 100644 pkgs/desktops/gnome/gnome-control-center/default.nix create mode 100644 pkgs/tools/nix/alejandra-no-ads/default.nix create mode 100644 pkgs/top-level.nix diff --git a/pkgs/ani-cli/README.md b/pkgs/applications/misc/ani-cli/README.md similarity index 100% rename from pkgs/ani-cli/README.md rename to pkgs/applications/misc/ani-cli/README.md diff --git a/pkgs/ani-cli/default.nix b/pkgs/applications/misc/ani-cli/default.nix similarity index 100% rename from pkgs/ani-cli/default.nix rename to pkgs/applications/misc/ani-cli/default.nix diff --git a/pkgs/cloneit/default.nix b/pkgs/applications/misc/cloneit/default.nix similarity index 100% rename from pkgs/cloneit/default.nix rename to pkgs/applications/misc/cloneit/default.nix diff --git a/pkgs/mov-cli/default.nix b/pkgs/applications/misc/mov-cli/default.nix similarity index 100% rename from pkgs/mov-cli/default.nix rename to pkgs/applications/misc/mov-cli/default.nix diff --git a/pkgs/rat/default.nix b/pkgs/applications/misc/rat/default.nix similarity index 100% rename from pkgs/rat/default.nix rename to pkgs/applications/misc/rat/default.nix diff --git a/pkgs/rofi-calc-wayland/default.nix b/pkgs/applications/misc/rofi-calc-wayland/default.nix similarity index 100% rename from pkgs/rofi-calc-wayland/default.nix rename to pkgs/applications/misc/rofi-calc-wayland/default.nix diff --git a/pkgs/rofi-emoji-wayland/default.nix b/pkgs/applications/misc/rofi-emoji-wayland/default.nix similarity index 100% rename from pkgs/rofi-emoji-wayland/default.nix rename to pkgs/applications/misc/rofi-emoji-wayland/default.nix diff --git a/pkgs/headscale-ui/default.nix b/pkgs/applications/networking/headscale-ui/default.nix similarity index 100% rename from pkgs/headscale-ui/default.nix rename to pkgs/applications/networking/headscale-ui/default.nix diff --git a/pkgs/reposilite-bin/default.nix b/pkgs/applications/networking/reposilite-bin/default.nix similarity index 100% rename from pkgs/reposilite-bin/default.nix rename to pkgs/applications/networking/reposilite-bin/default.nix diff --git a/pkgs/mastodon-bird-ui/default.nix b/pkgs/applications/social/mastodon-bird-ui/default.nix similarity index 100% rename from pkgs/mastodon-bird-ui/default.nix rename to pkgs/applications/social/mastodon-bird-ui/default.nix diff --git a/pkgs/applications/terminal-emulators/foot-transparent/0001-fullscreen-transparency.patch b/pkgs/applications/terminal-emulators/foot-transparent/0001-fullscreen-transparency.patch new file mode 100644 index 0000000..de94429 --- /dev/null +++ b/pkgs/applications/terminal-emulators/foot-transparent/0001-fullscreen-transparency.patch @@ -0,0 +1,111 @@ +diff --git a/CHANGELOG.md b/CHANGELOG.md +index 9ceab4d5..146e7992 100644 +--- a/CHANGELOG.md ++++ b/CHANGELOG.md +@@ -334,7 +334,8 @@ + instead of the one least recently. + * Starlight theme (the default theme) updated to [V4][starlight-v4] + * Background transparency (alpha) is now disabled in fullscreened +- windows ([#1416][1416]). ++ windows ([#1416][1416]) by default but can be enabled with ++ `fullscreen_alpha`. + * Foot server systemd units now use the standard + graphical-session.target ([#1281][1281]). + * If `$XDG_RUNTIME_DIR/foot-$WAYLAND_DISPLAY.sock` does not exist, +diff --git a/meson.build b/meson.build +index 719352bc..eb38c0f8 100644 +--- a/meson.build ++++ b/meson.build +@@ -73,6 +73,9 @@ add_project_arguments( + (get_option('b_pgo') == 'use' + ? ['-DFOOT_PGO_ENABLED=1'] + : []) + ++ (get_option('fullscreen_alpha') ++ ? ['-DFOOT_FULLSCREEN_ALPHA_ENABLED=1'] ++ : []) + + cc.get_supported_arguments( + ['-pedantic', + '-fstrict-aliasing', +@@ -374,6 +377,7 @@ summary( + 'Documentation': scdoc.found(), + 'Themes': get_option('themes'), + 'IME': get_option('ime'), ++ 'Fullscreen alpha': get_option('fullscreen_alpha'), + 'Grapheme clustering': utf8proc.found(), + 'utmp backend': utmp_backend, + 'utmp helper default path': utmp_default_helper_path, +diff --git a/meson_options.txt b/meson_options.txt +index ab7a07be..7919431e 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -7,6 +7,9 @@ option('themes', type: 'boolean', value: true, + option('ime', type: 'boolean', value: true, + description: 'IME (Input Method Editor) support') + ++option('fullscreen_alpha', type: 'boolean', value: false, ++ description: 'Enables transparency on fullscreen windows') ++ + option('grapheme-clustering', type: 'feature', + description: 'Enables grapheme clustering using libutf8proc. Requires fcft with harfbuzz support to be useful.') + +diff --git a/render.c b/render.c +index 91472027..847984a9 100644 +--- a/render.c ++++ b/render.c +@@ -525,6 +525,13 @@ render_cell(struct terminal *term, pixman_image_t *pix, pixman_region32_t *damag + } + + else if (cell->attrs.bg_src == COLOR_DEFAULT) { ++#if defined(FOOT_FULLSCREEN_ALPHA_ENABLED) && FOOT_FULLSCREEN_ALPHA_ENABLED ++ /* ++ * Note: I don't care about the stupid ass Wayland ++ * protocol I want transparent fullscreen windows. ++ */ ++ alpha = term->colors.alpha; ++#else + if (term->window->is_fullscreen) { + /* + * Note: disable transparency when fullscreened. +@@ -562,6 +569,7 @@ render_cell(struct terminal *term, pixman_image_t *pix, pixman_region32_t *damag + } else { + alpha = term->colors.alpha; + } ++#endif + } + } + +@@ -900,6 +908,10 @@ render_margin(struct terminal *term, struct buffer *buf, + const int bmargin = term->height - term->margins.bottom; + const int line_count = end_line - start_line; + ++#if defined(FOOT_FULLSCREEN_ALPHA_ENABLED) && FOOT_FULLSCREEN_ALPHA_ENABLED ++ uint32_t _bg = !term->reverse ? term->colors.bg : term->colors.fg; ++ pixman_color_t bg = color_hex_to_pixman_with_alpha(_bg, term->colors.alpha); ++#else + const uint32_t _bg = !term->reverse ? term->colors.bg : term->colors.fg; + uint16_t alpha = term->colors.alpha; + +@@ -909,6 +921,7 @@ render_margin(struct terminal *term, struct buffer *buf, + } + + pixman_color_t bg = color_hex_to_pixman_with_alpha(_bg, alpha); ++#endif + + pixman_image_fill_rectangles( + PIXMAN_OP_SRC, buf->pix[0], &bg, 4, +@@ -2817,8 +2830,14 @@ grid_render(struct terminal *term) + xassert(term->height > 0); + + struct buffer_chain *chain = term->render.chains.grid; ++ ++#if defined(FOOT_FULLSCREEN_ALPHA_ENABLED) && FOOT_FULLSCREEN_ALPHA_ENABLED ++ bool use_alpha = term->colors.alpha != 0xffff; ++#else + bool use_alpha = !term->window->is_fullscreen && + term->colors.alpha != 0xffff; ++#endif ++ + struct buffer *buf = shm_get_buffer( + chain, term->width, term->height, use_alpha); + + diff --git a/pkgs/applications/terminal-emulators/foot-transparent/default.nix b/pkgs/applications/terminal-emulators/foot-transparent/default.nix new file mode 100644 index 0000000..9d37a9d --- /dev/null +++ b/pkgs/applications/terminal-emulators/foot-transparent/default.nix @@ -0,0 +1,26 @@ +{ + lib, + fetchFromGitea, + foot, + ... +}: +foot.overrideAttrs (prev: let + version = "2024-03-14-unstable"; +in { + inherit version; + src = fetchFromGitea { + domain = "codeberg.org"; + owner = "dnkl"; + repo = "foot"; + rev = "dd3bb13d97b405495465357f7b7b17c9f2bba3c2"; + hash = "sha256-Pp3/cNELRYmTOQrJgHX6c+t0QkxEjoly0TLMKVj3H0E="; + }; + + patches = (prev.patches or []) ++ [./0001-fullscreen-transparency.patch]; + mesonFlags = (prev.mesonFlags or []) ++ ["-Dfullscreen_alpha=true"]; + + meta = { + mainProgram = "foot"; + maintainers = with lib.maintainers; [NotAShelf]; + }; +}) diff --git a/pkgs/default.nix b/pkgs/default.nix index 77b133c..eeffa67 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -15,71 +15,11 @@ }; packages = let - inherit (pkgs) callPackage fetchFromGitea foot alejandra; pins = import ../npins; + inherit (pkgs) callPackage; mkPackage = path: {__functor = self: self.override;} // (callPackage path {inherit pins;}); - in { - /* - packages that follow npins entries - they can be updated via npins - */ - ani-cli = mkPackage ./ani-cli; - rat = mkPackage ./rat; - rofi-calc-wayland = mkPackage ./rofi-calc-wayland; - rofi-emoji-wayland = mkPackage ./rofi-emoji-wayland; - - /* - static packages - need manual intervention with each update - */ - mov-cli = callPackage ./mov-cli {}; - cloneit = callPackage ./cloneit {}; - headscale-ui = callPackage ./headscale-ui {}; - mastodon-bird-ui = callPackage ./mastodon-bird-ui {}; - reposilite-bin = callPackage ./reposilite-bin { - javaJdk = pkgs.openjdk_headless; - }; - - /* - patched packages - patches packages take a package from nixpkgs and patch it to suit my own needs - */ - foot-transparent = foot.overrideAttrs (prev: let - version = "2024-03-14-unstable"; - in { - inherit version; - src = fetchFromGitea { - domain = "codeberg.org"; - owner = "dnkl"; - repo = "foot"; - rev = "dd3bb13d97b405495465357f7b7b17c9f2bba3c2"; - hash = "sha256-Pp3/cNELRYmTOQrJgHX6c+t0QkxEjoly0TLMKVj3H0E="; - }; - - patches = (prev.patches or []) ++ [../patches/0001-foot-transparent.patch]; - mesonFlags = (prev.mesonFlags or []) ++ ["-Dfullscreen_alpha=true"]; - - meta.mainProgram = "foot"; - }); - - alejandra-no-ads = alejandra.overrideAttrs (prev: { - patches = (prev.patches or []) ++ [../patches/0003-alejandra-remove-ads.patch]; - }); - - # override gnome-control-center to trick it into thinking we're running gnome - # - # - gccn-wrapped = pkgs.gnome.gnome-control-center.overrideAttrs (prev: { - # gnome-control-center does not start without XDG_CURRENT_DESKTOP=gnome - preFixup = - '' - gappsWrapperArgs+=( - --set XDG_CURRENT_DESKTOP "gnome" - ); - '' - + prev.preFixup; - }); - }; + in + import ./top-level.nix {inherit pkgs callPackage mkPackage;}; }; } diff --git a/pkgs/desktops/gnome/gnome-control-center/default.nix b/pkgs/desktops/gnome/gnome-control-center/default.nix new file mode 100644 index 0000000..aed0450 --- /dev/null +++ b/pkgs/desktops/gnome/gnome-control-center/default.nix @@ -0,0 +1,13 @@ +{gnome-control-center, ...}: +gnome-control-center.overrideAttrs (prev: let + gwrapperArgs = '' + # gnome-control-center does not start without XDG_CURRENT_DESKTOP=gnome + gappsWrapperArgs+=( + --set XDG_CURRENT_DESKTOP "gnome" + ); + ''; +in { + pname = "gnome-control-center-wrapped"; + preFixup = + (prev.preFixup or "") + gwrapperArgs; +}) diff --git a/pkgs/tools/nix/alejandra-no-ads/default.nix b/pkgs/tools/nix/alejandra-no-ads/default.nix new file mode 100644 index 0000000..d9c7c1c --- /dev/null +++ b/pkgs/tools/nix/alejandra-no-ads/default.nix @@ -0,0 +1,4 @@ +{alejandra, ...}: +alejandra.overrideAttrs (prev: { + patches = (prev.patches or []) ++ [../patches/0003-alejandra-remove-ads.patch]; +}) diff --git a/pkgs/top-level.nix b/pkgs/top-level.nix new file mode 100644 index 0000000..08dc68d --- /dev/null +++ b/pkgs/top-level.nix @@ -0,0 +1,33 @@ +{ + pkgs, + mkPackage, + callPackage, + ... +}: { + /* + packages that follow npins entries + they can be updated via npins + */ + ani-cli = mkPackage ./applications/misc/ani-cli; + rat = mkPackage ./applications/misc/rat; + rofi-calc-wayland = mkPackage ./applications/misc/rofi-calc-wayland; + rofi-emoji-wayland = mkPackage ./applications/misc/rofi-emoji-wayland; + + /* + static packages + need manual intervention with each update + */ + mov-cli = callPackage ./applications/misc/mov-cli {}; + cloneit = callPackage ./applications/misc/cloneit {}; + mastodon-bird-ui = callPackage ./applications/social/mastodon-bird-ui {}; + headscale-ui = callPackage ./applications/networking/headscale-ui {}; + reposilite-bin = callPackage ./applications/networking/reposilite-bin { + javaJdk = pkgs.openjdk_headless; + }; + + # patched packages + # those packages usually follow nixpkgs, so they need neither pinning + # nor manual intervention + foot-transparent = callPackage ./applications/terminal-emulators/foot-transparent {}; + alejandra-no-ads = callPackage ./tools/nix/alejandra-no-ads {}; +} From 557e694c0eb48bd90fc81544b9520eaa606d6cff Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 18 Mar 2024 16:55:45 +0300 Subject: [PATCH 2/4] pkgs: init mpvScripts under applications/video --- .../video/mpv/scripts/save-history/default.nix | 16 ++++++++++++++++ .../mpv/scripts/save-history/save-history.lua | 12 ++++++++++++ pkgs/top-level.nix | 15 ++++++--------- 3 files changed, 34 insertions(+), 9 deletions(-) create mode 100644 pkgs/applications/video/mpv/scripts/save-history/default.nix create mode 100644 pkgs/applications/video/mpv/scripts/save-history/save-history.lua diff --git a/pkgs/applications/video/mpv/scripts/save-history/default.nix b/pkgs/applications/video/mpv/scripts/save-history/default.nix new file mode 100644 index 0000000..56fe2bc --- /dev/null +++ b/pkgs/applications/video/mpv/scripts/save-history/default.nix @@ -0,0 +1,16 @@ +{ + lib, + mpvScripts, +}: +mpvScripts.buildLua { + pname = "save-history"; + version = "unstable-2024-03-18"; + + src = builtins.filterSource (path: type: type != "directory" || (!lib.hasSuffix path ".nix")) ./.; + + meta = { + description = "Save history of played files"; + homepage = "https://github.com/notashelf/nyxpkgs"; + maintainers = [lib.maintainers.NotAShelf]; + }; +} diff --git a/pkgs/applications/video/mpv/scripts/save-history/save-history.lua b/pkgs/applications/video/mpv/scripts/save-history/save-history.lua new file mode 100644 index 0000000..0ab9842 --- /dev/null +++ b/pkgs/applications/video/mpv/scripts/save-history/save-history.lua @@ -0,0 +1,12 @@ +local HISTFILE = (os.getenv('XDG_DATA_HOME') or os.getenv('HOME')) .. '/mpv/history.log'; + +mp.register_event('file-loaded', function() + local title, fp; + + title = mp.get_property('media-title'); + title = (title == mp.get_property('filename') and "" or (' (%s)'):format(title)); + + fp = io.open(HISTFILE, 'a+'); + fp:write(('[%s] %s%s\n'):format(os.date('%Y-%m-%d %X'), mp.get_property('path'), title)); + fp:close(); +end) diff --git a/pkgs/top-level.nix b/pkgs/top-level.nix index 08dc68d..a977e4d 100644 --- a/pkgs/top-level.nix +++ b/pkgs/top-level.nix @@ -4,21 +4,18 @@ callPackage, ... }: { - /* - packages that follow npins entries - they can be updated via npins - */ + # packages that follow npins entries + # they can be updated via npins ani-cli = mkPackage ./applications/misc/ani-cli; rat = mkPackage ./applications/misc/rat; rofi-calc-wayland = mkPackage ./applications/misc/rofi-calc-wayland; rofi-emoji-wayland = mkPackage ./applications/misc/rofi-emoji-wayland; - /* - static packages - need manual intervention with each update - */ - mov-cli = callPackage ./applications/misc/mov-cli {}; + # static packages + # need manual intervention with each update cloneit = callPackage ./applications/misc/cloneit {}; + mov-cli = callPackage ./applications/misc/mov-cli {}; + mpv-history = callPackage ./applications/video/mpv/scripts/save-history {}; mastodon-bird-ui = callPackage ./applications/social/mastodon-bird-ui {}; headscale-ui = callPackage ./applications/networking/headscale-ui {}; reposilite-bin = callPackage ./applications/networking/reposilite-bin { From 96e2530eafb48882bd9facfd67d88664ae1f220c Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 18 Mar 2024 17:03:40 +0300 Subject: [PATCH 3/4] treewide: move patches to their respective categories --- patches/0001-foot-transparent.patch | 110 ------------------ .../patches/0001-patch-plugin-dir.patch | 1 + .../rofi-calc-wayland/default.nix | 2 +- .../rofi-emoji-wayland/default.nix | 2 +- .../nix/alejandra-no-ads/0001-no-ads.patch | 1 + pkgs/tools/nix/alejandra-no-ads/default.nix | 2 +- pkgs/top-level.nix | 4 +- 7 files changed, 7 insertions(+), 115 deletions(-) delete mode 100644 patches/0001-foot-transparent.patch rename patches/0002-patch-plugin-dir.patch => pkgs/applications/misc/rofi-plugins/patches/0001-patch-plugin-dir.patch (99%) rename pkgs/applications/misc/{ => rofi-plugins}/rofi-calc-wayland/default.nix (95%) rename pkgs/applications/misc/{ => rofi-plugins}/rofi-emoji-wayland/default.nix (96%) rename patches/0003-alejandra-remove-ads.patch => pkgs/tools/nix/alejandra-no-ads/0001-no-ads.patch (99%) diff --git a/patches/0001-foot-transparent.patch b/patches/0001-foot-transparent.patch deleted file mode 100644 index d17c652..0000000 --- a/patches/0001-foot-transparent.patch +++ /dev/null @@ -1,110 +0,0 @@ -diff --git a/CHANGELOG.md b/CHANGELOG.md -index 9ceab4d5..146e7992 100644 ---- a/CHANGELOG.md -+++ b/CHANGELOG.md -@@ -334,7 +334,8 @@ - instead of the one least recently. - * Starlight theme (the default theme) updated to [V4][starlight-v4] - * Background transparency (alpha) is now disabled in fullscreened -- windows ([#1416][1416]). -+ windows ([#1416][1416]) by default but can be enabled with -+ `fullscreen_alpha`. - * Foot server systemd units now use the standard - graphical-session.target ([#1281][1281]). - * If `$XDG_RUNTIME_DIR/foot-$WAYLAND_DISPLAY.sock` does not exist, -diff --git a/meson.build b/meson.build -index 719352bc..eb38c0f8 100644 ---- a/meson.build -+++ b/meson.build -@@ -73,6 +73,9 @@ add_project_arguments( - (get_option('b_pgo') == 'use' - ? ['-DFOOT_PGO_ENABLED=1'] - : []) + -+ (get_option('fullscreen_alpha') -+ ? ['-DFOOT_FULLSCREEN_ALPHA_ENABLED=1'] -+ : []) + - cc.get_supported_arguments( - ['-pedantic', - '-fstrict-aliasing', -@@ -374,6 +377,7 @@ summary( - 'Documentation': scdoc.found(), - 'Themes': get_option('themes'), - 'IME': get_option('ime'), -+ 'Fullscreen alpha': get_option('fullscreen_alpha'), - 'Grapheme clustering': utf8proc.found(), - 'utmp backend': utmp_backend, - 'utmp helper default path': utmp_default_helper_path, -diff --git a/meson_options.txt b/meson_options.txt -index ab7a07be..7919431e 100644 ---- a/meson_options.txt -+++ b/meson_options.txt -@@ -7,6 +7,9 @@ option('themes', type: 'boolean', value: true, - option('ime', type: 'boolean', value: true, - description: 'IME (Input Method Editor) support') - -+option('fullscreen_alpha', type: 'boolean', value: false, -+ description: 'Enables transparency on fullscreen windows') -+ - option('grapheme-clustering', type: 'feature', - description: 'Enables grapheme clustering using libutf8proc. Requires fcft with harfbuzz support to be useful.') - -diff --git a/render.c b/render.c -index 91472027..847984a9 100644 ---- a/render.c -+++ b/render.c -@@ -525,6 +525,13 @@ render_cell(struct terminal *term, pixman_image_t *pix, pixman_region32_t *damag - } - - else if (cell->attrs.bg_src == COLOR_DEFAULT) { -+#if defined(FOOT_FULLSCREEN_ALPHA_ENABLED) && FOOT_FULLSCREEN_ALPHA_ENABLED -+ /* -+ * Note: I don't care about the stupid ass Wayland -+ * protocol I want transparent fullscreen windows. -+ */ -+ alpha = term->colors.alpha; -+#else - if (term->window->is_fullscreen) { - /* - * Note: disable transparency when fullscreened. -@@ -562,6 +569,7 @@ render_cell(struct terminal *term, pixman_image_t *pix, pixman_region32_t *damag - } else { - alpha = term->colors.alpha; - } -+#endif - } - } - -@@ -900,6 +908,10 @@ render_margin(struct terminal *term, struct buffer *buf, - const int bmargin = term->height - term->margins.bottom; - const int line_count = end_line - start_line; - -+#if defined(FOOT_FULLSCREEN_ALPHA_ENABLED) && FOOT_FULLSCREEN_ALPHA_ENABLED -+ uint32_t _bg = !term->reverse ? term->colors.bg : term->colors.fg; -+ pixman_color_t bg = color_hex_to_pixman_with_alpha(_bg, term->colors.alpha); -+#else - const uint32_t _bg = !term->reverse ? term->colors.bg : term->colors.fg; - uint16_t alpha = term->colors.alpha; - -@@ -909,6 +921,7 @@ render_margin(struct terminal *term, struct buffer *buf, - } - - pixman_color_t bg = color_hex_to_pixman_with_alpha(_bg, alpha); -+#endif - - pixman_image_fill_rectangles( - PIXMAN_OP_SRC, buf->pix[0], &bg, 4, -@@ -2817,8 +2830,14 @@ grid_render(struct terminal *term) - xassert(term->height > 0); - - struct buffer_chain *chain = term->render.chains.grid; -+ -+#if defined(FOOT_FULLSCREEN_ALPHA_ENABLED) && FOOT_FULLSCREEN_ALPHA_ENABLED -+ bool use_alpha = term->colors.alpha != 0xffff; -+#else - bool use_alpha = !term->window->is_fullscreen && - term->colors.alpha != 0xffff; -+#endif -+ - struct buffer *buf = shm_get_buffer( - chain, term->width, term->height, use_alpha); - diff --git a/patches/0002-patch-plugin-dir.patch b/pkgs/applications/misc/rofi-plugins/patches/0001-patch-plugin-dir.patch similarity index 99% rename from patches/0002-patch-plugin-dir.patch rename to pkgs/applications/misc/rofi-plugins/patches/0001-patch-plugin-dir.patch index eedd7a5..17ff666 100644 --- a/patches/0002-patch-plugin-dir.patch +++ b/pkgs/applications/misc/rofi-plugins/patches/0001-patch-plugin-dir.patch @@ -23,3 +23,4 @@ index 50edb74..639ee86 100644 -- 2.25.1 + diff --git a/pkgs/applications/misc/rofi-calc-wayland/default.nix b/pkgs/applications/misc/rofi-plugins/rofi-calc-wayland/default.nix similarity index 95% rename from pkgs/applications/misc/rofi-calc-wayland/default.nix rename to pkgs/applications/misc/rofi-plugins/rofi-calc-wayland/default.nix index ad884b7..06fd395 100644 --- a/pkgs/applications/misc/rofi-calc-wayland/default.nix +++ b/pkgs/applications/misc/rofi-plugins/rofi-calc-wayland/default.nix @@ -40,7 +40,7 @@ in ]; patches = [ - ../../patches/0002-patch-plugin-dir.patch + ../patches/0001-patch-plugin-dir.patch ]; postPatch = '' diff --git a/pkgs/applications/misc/rofi-emoji-wayland/default.nix b/pkgs/applications/misc/rofi-plugins/rofi-emoji-wayland/default.nix similarity index 96% rename from pkgs/applications/misc/rofi-emoji-wayland/default.nix rename to pkgs/applications/misc/rofi-plugins/rofi-emoji-wayland/default.nix index ccc7dcc..445687a 100644 --- a/pkgs/applications/misc/rofi-emoji-wayland/default.nix +++ b/pkgs/applications/misc/rofi-plugins/rofi-emoji-wayland/default.nix @@ -42,7 +42,7 @@ in ]; patches = [ - ../../patches/0002-patch-plugin-dir.patch + ../patches/0001-patch-plugin-dir.patch ]; postPatch = '' diff --git a/patches/0003-alejandra-remove-ads.patch b/pkgs/tools/nix/alejandra-no-ads/0001-no-ads.patch similarity index 99% rename from patches/0003-alejandra-remove-ads.patch rename to pkgs/tools/nix/alejandra-no-ads/0001-no-ads.patch index eccee96..76704fd 100644 --- a/patches/0003-alejandra-remove-ads.patch +++ b/pkgs/tools/nix/alejandra-no-ads/0001-no-ads.patch @@ -41,3 +41,4 @@ index fd49ce8..258f656 100644 mod find; mod verbosity; + diff --git a/pkgs/tools/nix/alejandra-no-ads/default.nix b/pkgs/tools/nix/alejandra-no-ads/default.nix index d9c7c1c..7148a4b 100644 --- a/pkgs/tools/nix/alejandra-no-ads/default.nix +++ b/pkgs/tools/nix/alejandra-no-ads/default.nix @@ -1,4 +1,4 @@ {alejandra, ...}: alejandra.overrideAttrs (prev: { - patches = (prev.patches or []) ++ [../patches/0003-alejandra-remove-ads.patch]; + patches = (prev.patches or []) ++ [./0001-no-ads.patch]; }) diff --git a/pkgs/top-level.nix b/pkgs/top-level.nix index a977e4d..c1e000c 100644 --- a/pkgs/top-level.nix +++ b/pkgs/top-level.nix @@ -8,8 +8,8 @@ # they can be updated via npins ani-cli = mkPackage ./applications/misc/ani-cli; rat = mkPackage ./applications/misc/rat; - rofi-calc-wayland = mkPackage ./applications/misc/rofi-calc-wayland; - rofi-emoji-wayland = mkPackage ./applications/misc/rofi-emoji-wayland; + rofi-calc-wayland = mkPackage ./applications/misc/rofi-plugins/rofi-calc-wayland; + rofi-emoji-wayland = mkPackage ./applications/misc/rofi-plugins/rofi-emoji-wayland; # static packages # need manual intervention with each update From 9ada0db4702b8b815aa002d561ce9b3d77dfa487 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 18 Mar 2024 17:09:22 +0300 Subject: [PATCH 4/4] CI: add missing packages to build matrix --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c9abbf6..af4fee3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,16 +12,16 @@ jobs: strategy: matrix: package: - - foot-transparent + - alejandra-no-ads + - ani-cli - cloneit + - foot-transparent - mov-cli - rat - - ani-cli - rofi-calc-wayland - rofi-emoji-wayland - headscale-ui - mastodon-bird-ui - - mastodon-bird-ui uses: ./.github/workflows/nix.yml with: