Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stylix: add testbeds for desktop environments #320

Merged
merged 12 commits into from
Apr 18, 2024
Merged

Conversation

danth
Copy link
Owner

@danth danth commented Apr 1, 2024

First stage of #319.

This allows a NixOS configuration to be defined for any target by creating a file named testbed.nix in the target directory.

For each testbed.nix, we generate two virtual machines:

  • One with a light theme, currently Catppuccin Latte
  • One with a dark theme, currently Catppuccin Macchiato

TODOs for this PR:

  • Finalise naming. Currently the machines are referred to as "checks", following the name of the standard flake output for test packages.

@danth danth mentioned this pull request Apr 1, 2024
5 tasks
@danth
Copy link
Owner Author

danth commented Apr 3, 2024

Testbed

A testbed is a platform for conducting rigorous, transparent, and replicable testing of scientific theories, computing tools, and new technologies.

@danth danth marked this pull request as ready for review April 3, 2024 15:43
@danth danth changed the title Virtual machines stylix: add testbeds Apr 3, 2024
@danth danth changed the title stylix: add testbeds stylix: add testbeds for desktop environments Apr 3, 2024
Copy link
Collaborator

@trueNAHO trueNAHO left a comment

Choose a reason for hiding this comment

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

Great job!

Should we add a central testbed package that runs all other testbed-${testbed.name}-${stylix.polarity} packages? This would avoid a complicated nix flake show | <PARSING> | nix run command and the following boilerplate test script:

nix run .#testbed-gnome-dark
nix run .#testbed-gnome-light
nix run .#testbed-kde-dark
nix run .#testbed-kde-light

The pkgs.buildEnv function allows merging the outputs of a list of derivations.

For reference, I have used pkgs.buildEnv for a similar use case at: https://github.com/trueNAHO/asciidoctor.nix/blob/8ed50e9bdeaede79753ff7656d82fbc12cddc191/flake.nix#L124-L127.

Alternatively, we could simply add the testbed-${testbed.name}-${stylix.polarity} packages to the checks output. This approach might be better than the nix run approach.

stylix/testbed.nix Show resolved Hide resolved
stylix/testbed.nix Outdated Show resolved Hide resolved
stylix/testbed.nix Show resolved Hide resolved
stylix/testbed.nix Outdated Show resolved Hide resolved
stylix/testbed.nix Show resolved Hide resolved
flake.nix Show resolved Hide resolved
stylix/testbed.nix Outdated Show resolved Hide resolved
stylix/testbed.nix Show resolved Hide resolved
stylix/testbed.nix Show resolved Hide resolved
stylix/testbed.nix Outdated Show resolved Hide resolved
@danth danth marked this pull request as draft April 4, 2024 22:02
@danth
Copy link
Owner Author

danth commented Apr 4, 2024

This depends on #330 since it uses a file name with a space

@danth danth force-pushed the virtual-machines branch from 3f5c311 to f4429a6 Compare April 11, 2024 15:02
@danth danth marked this pull request as ready for review April 11, 2024 15:02
@danth
Copy link
Owner Author

danth commented Apr 11, 2024

Alternatively, we could simply add the testbed-${testbed.name}-${stylix.polarity} packages to the checks output. This approach might be better than the nix run approach.

These are meant for manual testing, since they open a virtual machine where you can mess around with the application and check the styling. Hence it's important to be able to run an individual testbed as easily as possible.

Using the checks output, to run a testbed you would have to type nix run .#checks.x86_64-linux.testbed-gnome-light, rather than simply nix run .#testbed-gnome-light when they are under packages.

(The testbeds are also built on GitHub Actions, but this is only to pick up on obvious build failures. It's still necessary to do a manual check to see whether anything changed visually.)

Should we add a central testbed package that runs all other testbed-${testbed.name}-${stylix.polarity} packages? This would avoid a complicated nix flake show | | nix run command

As mentioned above, running these opens a virtual machine, so it doesn't make sense to run a large number at once like that.

@trueNAHO
Copy link
Collaborator

trueNAHO commented Apr 11, 2024

These are meant for manual testing, since they open a virtual machine where you can mess around with the application and check the styling. Hence it's important to be able to run an individual testbed as easily as possible.

Should we add a central testbed package that runs all other testbed-${testbed.name}-${stylix.polarity} packages? This would avoid a complicated nix flake show | | nix run command

As mentioned above, running these opens a virtual machine, so it doesn't make sense to run a large number at once like that.

I discovered enableParallelBuilding today: NixOS/nixpkgs#142338. Do you think we could incorporate this here to speed up the execution time of testing? Considering they are meant for manual testing, parallelizing them would not be good.

stylix/testbed.nix Outdated Show resolved Hide resolved
@danth danth requested a review from trueNAHO April 17, 2024 08:45
@danth danth merged commit b36fb34 into master Apr 18, 2024
9 checks passed
@danth danth deleted the virtual-machines branch April 18, 2024 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants