Skip to content

Conversation

@trueNAHO
Copy link
Member

@trueNAHO trueNAHO commented Jul 9, 2025

commit d9ed64e692940886678ebb8d7e839c42d332961b
Author: NAHO <[email protected]>
Date:   2025-07-30 12:10:25 +0200

    sxiv/testbed: remove trailing Bash semicolon

    Fixes: 8b898ca041a3 ("sxiv: avoid downloading custom file in testbed (#1641)")

 modules/sxiv/testbeds/sxiv.nix | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit 34217434704711819d78f8feef038d71075b758c
Author: NAHO <[email protected]>
Date:   2025-07-09 18:38:21 +0200

    stylix/testbed/modules/application: add examples to boolean options

 stylix/testbed/modules/application.nix | 2 ++
 1 file changed, 2 insertions(+)

commit b6022cb3a5aeba3d00433fa42bb0fff08a3cd1a7
Author: NAHO <[email protected]>
Date:   2025-07-09 18:38:59 +0200

    stylix/testbed/modules/application: match mkEnableOption's description

 stylix/testbed/modules/application.nix | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit e458b09827b2f989860196428f4d0ccb83ae5705
Author: NAHO <[email protected]>
Date:   2025-08-26 20:57:25 +0200

    doc/src/testbeds: mention stylix.testbed.ui.command.useTerminal default

    Co-authored-by: awwpotato <[email protected]>

 doc/src/testbeds.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit 47ad279bd90c37d0198d7677cd7ccd1aef299b51
Author: NAHO <[email protected]>
Date:   2025-07-09 18:39:58 +0200

    stylix/testbed/modules/application: wrap documentation to 80 characters

 stylix/testbed/modules/application.nix | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

commit e1b7fdedc2653aa199648b2a6f08298e94ae6caa
Author: NAHO <[email protected]>
Date:   2025-07-29 16:04:48 +0200

    stylix/testbed/modules/application: allow re-running test code

    Allow re-running test code via deskop items and stylix-testbed-${name}
    CLIs.

 stylix/testbed/modules/application.nix | 94 ++++++++++++++++++++++------------
 1 file changed, 60 insertions(+), 34 deletions(-)

commit 72931352f091caa0c946cb59f24f871d231380e0
Author: NAHO <[email protected]>
Date:   2025-07-29 16:23:57 +0200

    stylix/testbed/modules/application: conveniently install dependencies

 stylix/testbed/modules/application.nix | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

commit be30a1a880852632f5db88a0808077b724565b58
Author: NAHO <[email protected]>
Date:   2025-07-30 11:49:44 +0200

    treewide: simplify and standardize testbeds

    Simplify and standardize testbeds by replacing
    config.stylix.testbed.ui.application declarations with
    config.stylix.testbed.ui.command, and replacing

        stylix.testbed.ui.command = {
          packages = [ package ];
          text = package.meta.mainProgram;
        };

    with

        stylix.testbed.ui.command.packages = [ package ];

    by trivially deducing config.stylix.testbed.ui.command.text from
    config.stylix.testbed.ui.command.packages.

    Leverage the default programs."<PACKAGE>".package value to simplify

        let
          package = pkgs."<PACKAGE>";
        in
        {
          stylix.testbed.ui.command.packages = [ package ];

          home-manager.sharedModules = lib.singleton {
            programs."<PACKAGE>" = {
              inherit package;
              enable = true;
            };
          };
        }

    to

        {
          stylix.testbed.ui.command.text = "<PACKAGE_META_MAIN_PROGRAM>";

          home-manager.sharedModules = lib.singleton {
            programs."<PACKAGE>".enable = true;
          };
        }

    Minor stylistic changes are made to standardize testbed declarations.

 doc/src/testbeds.md                                |  9 ++--
 modules/alacritty/testbeds/alacritty.nix           | 15 ++----
 modules/ashell/testbeds/ashell.nix                 |  2 +-
 modules/bat/testbeds/bat.nix                       | 15 +++---
 modules/blender/testbeds/blender.nix               | 10 +---
 modules/bspwm/testbeds/bspwm.nix                   |  7 +--
 modules/btop/testbeds/btop.nix                     |  4 +-
 modules/cava/testbeds/cava-rainbow.nix             |  6 +--
 modules/cava/testbeds/cava.nix                     |  6 +--
 modules/cavalier/testbeds/cavalier.nix             | 13 +----
 modules/chromium/testbeds/chromium.nix             | 14 ++----
 modules/discord/testbeds/vencord.nix               | 26 +++-------
 modules/discord/testbeds/vesktop.nix               | 15 ++----
 modules/emacs/testbeds/emacs.nix                   |  7 +--
 modules/eog/testbeds/eog.nix                       |  4 +-
 modules/firefox/testbeds/firefox.nix               | 30 +++++-------
 modules/foliate/testbeds/foliate.nix               | 15 ++----
 modules/foot/testbeds/foot.nix                     | 15 ++----
 modules/fuzzel/testbeds/fuzzel.nix                 |  2 +-
 modules/fzf/testbeds/fzf.nix                       |  4 +-
 modules/gedit/testbeds/gedit.nix                   |  6 ++-
 modules/ghostty/testbeds/ghostty.nix               | 15 ++----
 modules/glance/testbeds/glance-hm.nix              | 19 +++-----
 modules/glance/testbeds/glance-nixos.nix           | 19 +++-----
 .../testbeds/gnome-text-editor.nix                 |  6 ++-
 modules/halloy/testbeds/halloy.nix                 | 22 +++------
 modules/hyprland/testbeds/hyprland.nix             |  7 +--
 modules/hyprpanel/testbeds/hyprpanel.nix           |  1 +
 modules/kde/testbeds/kde.nix                       | 13 +++--
 modules/kitty/testbeds/kitty.nix                   | 15 ++----
 modules/lazygit/testbeds/lazygit.nix               |  7 +--
 modules/micro/testbeds/micro.nix                   |  4 +-
 modules/mpv/testbeds/mpv-modernz.nix               |  9 +---
 modules/mpv/testbeds/mpv-uosc.nix                  |  9 +---
 modules/mpv/testbeds/mpv.nix                       | 15 ++----
 modules/ncspot/testbeds/ncspot.nix                 |  5 +-
 modules/neovim/testbeds/neovide.nix                |  7 +--
 modules/neovim/testbeds/vim.nix                    |  4 +-
 modules/obsidian/testbeds/obsidian.nix             | 21 +++-----
 modules/opencode/testbeds/opencode.nix             |  4 +-
 modules/qutebrowser/testbeds/qutebrowser.nix       | 15 ++----
 modules/rio/testbeds/rio.nix                       | 15 ++----
 modules/spicetify/testbeds/spicetify.nix           | 22 ++-------
 modules/starship/testbeds/starship.nix             | 11 ++---
 modules/sxiv/testbeds/sxiv.nix                     | 24 ++++-----
 modules/tmux/testbeds/tmux.nix                     |  5 +-
 modules/vicinae/testbeds/vicinae.nix               |  2 +-
 modules/waybar/testbeds/waybar.nix                 |  5 +-
 modules/wayprompt/testbeds/wayprompt.nix           |  7 +--
 modules/wezterm/testbeds/wezterm.nix               | 15 ++----
 modules/wofi/testbeds/wofi.nix                     | 13 ++---
 modules/yazi/testbeds/yazi.nix                     | 19 ++------
 modules/zathura/testbeds/zathura.nix               | 15 ++----
 modules/zed/testbeds/zed.nix                       |  6 +--
 modules/zen-browser/testbeds/zen-browser.nix       |  2 +
 stylix/testbed/modules/application.nix             | 57 ++++++++--------------
 56 files changed, 209 insertions(+), 451 deletions(-)

commit 85a5792c0528dd1bdb5169fe094435c253a4b54a
Author: NAHO <[email protected]>
Date:   2025-07-30 12:39:19 +0200

    treewide: rename stylix.testbed.ui.command.{useTerminal => terminal}

    Simplify the testbed interface by renaming
    stylix.testbed.ui.command.useTerminal to
    stylix.testbed.ui.command.terminal.

 doc/src/testbeds.md                           |  4 ++--
 modules/bat/testbeds/bat.nix                  |  2 +-
 modules/btop/testbeds/btop.nix                |  2 +-
 modules/cava/testbeds/cava-rainbow.nix        |  2 +-
 modules/cava/testbeds/cava.nix                |  2 +-
 modules/fish/testbeds/fish-hm.nix             |  2 +-
 modules/fish/testbeds/fish-nixos.nix          |  2 +-
 modules/fzf/testbeds/fzf.nix                  |  2 +-
 modules/gdu/testbeds/gdu.nix                  |  2 +-
 modules/helix/testbeds/helix.nix              |  2 +-
 modules/lazygit/testbeds/lazygit.nix          |  2 +-
 modules/micro/testbeds/micro.nix              |  2 +-
 modules/ncspot/testbeds/ncspot.nix            |  2 +-
 modules/neovim/testbeds/neovim.nix            |  2 +-
 modules/neovim/testbeds/nixvim-integrated.nix |  2 +-
 modules/neovim/testbeds/nixvim-standalone.nix |  2 +-
 modules/neovim/testbeds/nvf.nix               |  2 +-
 modules/neovim/testbeds/vim.nix               |  2 +-
 modules/nushell/testbeds/nushell.nix          |  2 +-
 modules/opencode/testbeds/opencode.nix        |  2 +-
 modules/starship/testbeds/starship.nix        |  2 +-
 modules/tmux/testbeds/tmux.nix                |  2 +-
 modules/zellij/testbeds/zellij.nix            |  2 +-
 stylix/testbed/modules/application.nix        | 19 +++++++++----------
 24 files changed, 33 insertions(+), 34 deletions(-)

Changelog

v9: 85a5792

v8: 92ee46f

v7: 0042265

v6: a5a8c41

v5: b9e3c74

  • treewide: simplify and standardize testbeds
    • Remove stylix.testbed.ui.command.packages = [ pkgs.kitty ]; in /modules/kde/testbeds/plasma5.nix to avoid enabling GNOME.

v4: 2b4754f

  • treewide: simplify and standardize testbeds
    • Use local packages variable in throw.

v3: 303cef8

  • treewide: simplify and standardize testbeds
    • Add missing throw call.
    • Remove multiline = false; because we are throwing and no longer curating assertion errors.

v2: 1a8885e

  • treewide: simplify and standardize testbeds
    • Fix null access by inlining assertion and using local variables.

v1: 0a8661c

  • Rebase on top of commit 57d036d ("doc: commit_convention: overhaul and formalize unspoken rules (doc: commit_convention: overhaul and formalize unspoken rules #1717)").
  • Remove commit treewide: optionally apply lib.getExe to stylix.testbed.ui.command.gnome-text-editor in favor of the new commit treewide: simplify and standardize testbeds.
  • Add the following commits:
    • sxiv/testbed: remove trailing Bash semicolon
    • stylix/testbed/modules/application: allow re-running test code
    • stylix/testbed/modules/application: conveniently install dependencies
    • treewide: rename stylix.testbed.ui.command.{useTerminal => terminal}

v0: 1e3df8b


Notify Maintainers

@stylix-automation stylix-automation bot added the topic: testbed Testbed changes label Jul 9, 2025
@trueNAHO trueNAHO marked this pull request as draft July 12, 2025 16:16
@trueNAHO trueNAHO force-pushed the treewide-optionally-apply-lib-get-exe-to-stylix-testbed-ui-command-text branch from 1e3df8b to 0a8661c Compare July 30, 2025 10:49
@stylix-automation stylix-automation bot added topic: documentation Documentation additions or improvements topic: modules /modules/ subsystem topic: stylix /stylix/ subsystem labels Jul 30, 2025
@trueNAHO trueNAHO mentioned this pull request Jul 30, 2025
6 tasks
@trueNAHO trueNAHO marked this pull request as ready for review July 30, 2025 10:58
@trueNAHO trueNAHO changed the title treewide: optionally apply lib.getExe to stylix.testbed.ui.command.text treewide: allow re-running test code and simplify testbeds Jul 30, 2025
@trueNAHO trueNAHO force-pushed the treewide-optionally-apply-lib-get-exe-to-stylix-testbed-ui-command-text branch 6 times, most recently from b9e3c74 to a5a8c41 Compare July 31, 2025 14:14
@trueNAHO trueNAHO force-pushed the treewide-optionally-apply-lib-get-exe-to-stylix-testbed-ui-command-text branch from a5a8c41 to 0042265 Compare August 4, 2025 17:58
@trueNAHO trueNAHO requested a review from 0xda157 August 13, 2025 17:42
@trueNAHO
Copy link
Member Author

Important

This patchset should be git rebase master before being merged to avoid uncaught internal breaking changes.

Copy link
Contributor

@0xda157 0xda157 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally lgtm, just some small things

name = name';
};

name' = "stylix-testbed" + lib.optionalString (name != "") "-${name}";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer putting name' at the top of the let in because it's used by other things in the let in block

Copy link
Member Author

@trueNAHO trueNAHO Aug 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer putting name' at the top of the let in because it's used by other things in the let in block

The let application name' in order was already previously present.

Personally, I prefer uniformly sorting non-special constructs lexicographically to avoid ambiguous cases, while keeping the set of special constructs as small as possible.

For example, keeping the

      ╭-------a-------╮
      |               |
 ╭---aa---╮      ╭---ab---╮
 |        |      |        |
aaa      aab    aba      abb

dependency tree declarations in DFS order (a aa aaa aab ab aba abb) without tooling (which is practically non-existent) is a lot more effort than simply lexicographically sorting them. Note that the recursive DFS order falls apart when dealing with general DAGs, as in aaa also depends on aba in the previous graph. Since most modern languages, including Nix, no longer require declaration before use, identifiers can be arbitrarily ordered within the same scope, in which case I prefer lexicographical sorting.

Special Nix constructs include imports options config declarations and conventional fetchFrom* { owner repo rev hash } argument sorting.

I am fine with moving name' to the top, but we can also just leave it as-is.

@stylix-automation stylix-automation bot added the status: merge conflict Merge conflict label Aug 24, 2025
@trueNAHO trueNAHO force-pushed the treewide-optionally-apply-lib-get-exe-to-stylix-testbed-ui-command-text branch from 0042265 to 92ee46f Compare August 26, 2025 21:17
@trueNAHO
Copy link
Member Author

trueNAHO commented Aug 27, 2025

The x86_64-linux Zathura testbeds keep failing because of https://nix-community.cachix.org:

warning: error: unable to download 'https://nix-community.cachix.org/nar/da62dc0e100a5907266d74df5a9482b5669c3e5456a1a3d087dfccc2d5107160.nar.zst': HTTP error 500

       response body:

       Cannot serve NAR; retrying in 317 ms
warning: error: unable to download 'https://nix-community.cachix.org/nar/da62dc0e100a5907266d74df5a9482b5669c3e5456a1a3d087dfccc2d5107160.nar.zst': HTTP error 500

       response body:

       Cannot serve NAR; retrying in 696 ms
warning: error: unable to download 'https://nix-community.cachix.org/nar/da62dc0e100a5907266d74df5a9482b5669c3e5456a1a3d087dfccc2d5107160.nar.zst': HTTP error 500

       response body:

       Cannot serve NAR; retrying in 1149 ms
warning: error: unable to download 'https://nix-community.cachix.org/nar/da62dc0e100a5907266d74df5a9482b5669c3e5456a1a3d087dfccc2d5107160.nar.zst': HTTP error 500

       response body:

       Cannot serve NAR; retrying in 2561 ms
error: unable to download 'https://nix-community.cachix.org/nar/da62dc0e100a5907266d74df5a9482b5669c3e5456a1a3d087dfccc2d5107160.nar.zst': HTTP error 500

       response body:

       Cannot serve NAR
error: some substitutes for the outputs of derivation '/nix/store/3lbvbpy2ssnl6lqf75azd44bjdwk4mzr-unit-home-manager-guest.service.drv' failed (usually happens due to networking issues); try '--fallback' to build derivation from source
error: Cannot build '/nix/store/3wihmnnzskqz66zcrvq3x12jsn331z44-system-units.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/5v8njjnbdlbz3pk5w1lpv8lzxg684mv0-system-units
error: Cannot build '/nix/store/a2i53hywsh4xmnnr7lzmy3rnkh498rxz-etc.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/x2vir5n7z0ggpc0yqc20g7kcn7cb6fr1-etc
error: Cannot build '/nix/store/s13q6f84awyz43wl776b0f7xml04p7yj-nixos-system-testbed-zathura-cursorless-25.11.20250706.1fd8bad.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/bm1k1k4zmmcbkz4azwa4kzf2933nz62l-nixos-system-testbed-zathura-cursorless-25.11.20250706.1fd8bad
error: Cannot build '/nix/store/3f47lxyz1bc7676lsq8034rwa686hd53-closure-info.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/l7915d3mbpxyv5lw78h3rsknzn1h94jz-closure-info
error: Cannot build '/nix/store/0va3ql2njy4kahjf9cyzw04mhc5xyrgg-run-nixos-vm.drv'.
       Reason: 2 dependencies failed.
       Output paths:
         /nix/store/vlpsw7jrrjy0i61fnbas1spknmhx1g8q-run-nixos-vm
error: Cannot build '/nix/store/af3hrb4aqqirmk0mqbz94wnwp6s2zycn-nixos-vm.drv'.
       Reason: 2 dependencies failed.
       Output paths:
         /nix/store/dmk19zdm33iqnhixk0hqiw11hzhzqp58-nixos-vm
error: Cannot build '/nix/store/fxvxjv1m47qyir8j4b0x1mmpqml4sx24-testbed-zathura-cursorless.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/hhxzfcvpdb6yz5cm7jlrbddnr6pa5iy6-testbed-zathura-cursorless
WARNING:nix_fast_build:build testbed:zathura:cursorless exited with 1
ERROR:nix_fast_build:BUILD: 322 successes, 3 failures
ERROR:nix_fast_build:Failed attributes: .#checks.x86_64-linux.testbed:zathura:dark .#checks.x86_64-linux.testbed:zathura:imageless .#checks.x86_64-linux.testbed:zathura:cursorless

-- https://github.com/nix-community/stylix/actions/runs/17250732748/job/49003252327

Are we rate limiting the cache because all of the testbeds in this PR are new? Note that the aarch64-linux job succeeded on the second CI attempt.

Running just

nix build .#checks.x86_64-linux.testbed:zathura:{dark,imageless,cursorless}

locally also causes the same errors...

For reference, CI was still passing on v7.

CC: @danth

@stylix-automation stylix-automation bot removed the status: merge conflict Merge conflict label Sep 2, 2025
@stylix-automation stylix-automation bot added the status: merge conflict Merge conflict label Sep 24, 2025
Allow re-running test code via deskop items and stylix-testbed-${name}
CLIs.
Simplify and standardize testbeds by replacing
config.stylix.testbed.ui.application declarations with
config.stylix.testbed.ui.command, and replacing

    stylix.testbed.ui.command = {
      packages = [ package ];
      text = package.meta.mainProgram;
    };

with

    stylix.testbed.ui.command.packages = [ package ];

by trivially deducing config.stylix.testbed.ui.command.text from
config.stylix.testbed.ui.command.packages.

Leverage the default programs."<PACKAGE>".package value to simplify

    let
      package = pkgs."<PACKAGE>";
    in
    {
      stylix.testbed.ui.command.packages = [ package ];

      home-manager.sharedModules = lib.singleton {
        programs."<PACKAGE>" = {
          inherit package;
          enable = true;
        };
      };
    }

to

    {
      stylix.testbed.ui.command.text = "<PACKAGE_META_MAIN_PROGRAM>";

      home-manager.sharedModules = lib.singleton {
        programs."<PACKAGE>".enable = true;
      };
    }

Minor stylistic changes are made to standardize testbed declarations.
Simplify the testbed interface by renaming
stylix.testbed.ui.command.useTerminal to
stylix.testbed.ui.command.terminal.
@trueNAHO trueNAHO force-pushed the treewide-optionally-apply-lib-get-exe-to-stylix-testbed-ui-command-text branch from 92ee46f to 85a5792 Compare November 21, 2025 21:40
@trueNAHO trueNAHO requested a review from 0xda157 November 21, 2025 21:42
Copy link
Member Author

@trueNAHO trueNAHO Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ nix build .#testbed:obsidian:dark
error:
       [...]
       error: Package ‘obsidian-1.10.3’ in /nix/store/c9asdiqw1rf5qwdjz26f57hp68ppb8fc-source/pkgs/by-name/ob/obsidian/package.nix:18 has an unfree license (‘obsidian’), refusing to evaluate.

       a) To temporarily allow unfree packages, you can use an environment variable
          for a single invocation of the nix tools.

            $ export NIXPKGS_ALLOW_UNFREE=1

          Note: When using `nix shell`, `nix build`, `nix develop`, etc with a flake,
                then pass `--impure` in order to allow use of environment variables.

       b) For `nixos-rebuild` you can set
         { nixpkgs.config.allowUnfree = true; }
       in configuration.nix to override this.

       Alternatively you can configure a predicate to allow specific packages:
         { nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
             "obsidian"
           ];
         }

       c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
         { allowUnfree = true; }
       to ~/.config/nixpkgs/config.nix.

Why does setting programs.obsidian.package to its supposedly default value resolve the error:

diff --git a/modules/obsidian/testbeds/obsidian.nix b/modules/obsidian/testbeds/obsidian.nix
index d648e67a..c2bff776 100644
--- a/modules/obsidian/testbeds/obsidian.nix
+++ b/modules/obsidian/testbeds/obsidian.nix
@@ -1,4 +1,4 @@
-{ lib, ... }:
+{ lib, pkgs, ... }:
 {
   stylix.testbed.ui.command.text = "obsidian";

@@ -14,6 +14,7 @@

       programs.obsidian = {
         enable = true;
+        package = pkgs.obsidian;
         vaults.${vault}.enable = true;
       };
     };

Why does

nixpkgs.config.allowUnfreePredicate =
pkg: builtins.elem (lib.getName pkg) [ "obsidian" ];

seemingly have no impact, although it does for the following instances:

@stylix-automation stylix-automation bot removed the status: merge conflict Merge conflict label Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: documentation Documentation additions or improvements topic: modules /modules/ subsystem topic: stylix /stylix/ subsystem topic: testbed Testbed changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants