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

add nix flake #332

Closed
wants to merge 1 commit into from
Closed

add nix flake #332

wants to merge 1 commit into from

Conversation

rcambrj
Copy link

@rcambrj rcambrj commented Jan 3, 2025

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea. I'm using this change anyway, feel free to discuss in this pull request!

  • Follow the instructions in CONTRIBUTING. Most importantly, ensure the tests and linter pass by running bundle exec rspec and bundle exec rubocop. no ruby changes necessary so these tasks should still pass

  • Update code documentation if necessary. should I add a section to the readme for nixos?

related to: #323

In the above issue, @TroyMitchell911 reports:

/var/lib/gems/3.0.0/gems/fusuma-plugin-appmatcher-0.7.1/lib/fusuma/plugin/appmatcher/gnome.rb:111:in `gnome_shell_eval': unhandled exception
	from /var/lib/gems/3.0.0/gems/fusuma-plugin-appmatcher-0.7.1/lib/fusuma/plugin/appmatcher/gnome.rb:75:in `active_application'

This is the exact error that I was getting.

The fusuma package is already available in nixpkgs and I'm using it along with the home-manager service and the new gnome extension for which I made a pull request just moments ago.

The nixpkgs fusuma package is outdated (3.5.0 vs 3.7.0), but I updated this package to the latest version in a nixpkgs fork and it still suffers from that same unhandled exception. I'm not yet sure what it is that I've fixed by recreating the derivation directly in this repository, but it works now.

As with the appmatcher gnome extension, you can see an example of how I've implemented this:

https://github.com/rcambrj/dotfiles/blob/b3108d9ae608e2e20eacb318c541b03aa470bd40/flake.nix#L43
https://github.com/rcambrj/dotfiles/blob/b3108d9ae608e2e20eacb318c541b03aa470bd40/hosts/mango/graphical/touchpad.nix
https://github.com/rcambrj/dotfiles/blob/b3108d9ae608e2e20eacb318c541b03aa470bd40/modules/home/rcambrj-graphical/touchpad.nix

If you're against putting nix-specific stuff into this repository, that's understandable, I figured that I would at least share my findings. It may be better to determine what's wrong with the nixpkgs derivation and fix that instead, but at the same time, there's nothing wrong with providing flake.nix in the source repository (its even encouraged where frequent updates are required).

New requirements:

  • Gemfile.lock, as is best practice to commit to the repository and as required by the nix derivation. Generate by running bundle lock
  • gemset.nix, as required by the nix derivation, generate by running bundix

@iberianpig
Copy link
Owner

Firstly, I want to express my gratitude for opening the pull request and for your contributions.

related to: #323
In the above issue, @TroyMitchell911 reports:

/var/lib/gems/3.0.0/gems/fusuma-plugin-appmatcher-0.7.1/lib/fusuma/plugin/appmatcher/gnome.rb:111:in `gnome_shell_eval': unhandled exception
	from /var/lib/gems/3.0.0/gems/fusuma-plugin-appmatcher-0.7.1/lib/fusuma/plugin/appmatcher/gnome.rb:75:in `active_application'

This fusuma-plugin-appmatcher's error is due to appmatcher gnome-extension not being installed.

  • This is a problem that only works with Gnome versions below 41, so I believe that removing old lib/fusuma/plugin/appmatcher/gnome.rb or performing a version check would be a good solution.
  • It would be beneficial to display an error message prompting users, not just those using nix, to install the GnomeExtension.

As I am not a nix user, I currently have no intentions to include nix-specific configurations in this or other repositories. It would be preferable if handling through an external repository such as the nix home-manager could be considered.

As a side note:

  • We do not currently offer configurations for package managers like apt, yum, or brew.
  • The Gemfile within our repository is primarily geared towards developers and includes components not required at runtime, such as ActiveSupport; hence, this approach may not be suitable for all users.

@iberianpig
Copy link
Owner

Thank you once again for your understanding and for your valuable contributions.
If you have any further suggestions or questions, please feel free to reach out.

@iberianpig iberianpig closed this Jan 6, 2025
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