Skip to content

bucklespring: init at 2021-01-21 #110454

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

Merged
merged 1 commit into from
May 3, 2021
Merged

bucklespring: init at 2021-01-21 #110454

merged 1 commit into from
May 3, 2021

Conversation

evils
Copy link
Member

@evils evils commented Jan 22, 2021

Motivation for this change

clickety clack keyboard's cool

Things done

packaged a tool to produce buckling spring keyboard sounds on keyboard events
added as 2 attributes as it can be built for X11 or to use libinput, with the default being X11 as that's more common
with libinput it works on wayland and even bare terminals, but requires the user running it to be in the input group (this is noted in the longDescription)
this should maybe be set up via programs.bucklespring.enable but i got stuck on getting that to work a few too many times for something this silly

used the latest master commit because the latest release is 4 years old and several features have been added since

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
    • 185854608 for bucklespring-x11
    • 187148680 for bucklespring-libinput
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Sorry, something went wrong.

, libX11
}:

with lib;
Copy link
Member

Choose a reason for hiding this comment

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

Please do not use with lib over the entire scope.

Copy link
Member Author

Choose a reason for hiding this comment

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

i'm not going to add lib. in front of every optionals, that's ugly

but using it at meta is redundant xD

Copy link
Member

Choose a reason for hiding this comment

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

That's how we usually do it in nixpkgs and using with lib over the entire file is way uglier than repeating lib a few times.

Copy link
Member

Choose a reason for hiding this comment

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

with should always be used over the smallest scope possible and not over everything.

Copy link
Member Author

Choose a reason for hiding this comment

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

changed to inherit optionals from lib
but did reintroduce with lib; at meta

@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Jan 22, 2021
@evils evils requested a review from SuperSandro2000 April 24, 2021 23:05
Comment on lines 17 to 18
with lib;

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
with lib;

Comment on lines +33 to +37
++ optionals (legacy) [ libXtst libX11 ]
++ optionals (!legacy) [ libinput ];

makeFlags = optionals (!legacy) [ "libinput=1" ];
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
++ optionals (legacy) [ libXtst libX11 ]
++ optionals (!legacy) [ libinput ];
makeFlags = optionals (!legacy) [ "libinput=1" ];
++ lib.optionals (legacy) [ libXtst libX11 ]
++ lib.optionals (!legacy) [ libinput ];
makeFlags = lib.optionals (!legacy) [ "libinput=1" ];

Copy link
Member Author

Choose a reason for hiding this comment

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

no

, libX11
}:

with lib;
Copy link
Member

Choose a reason for hiding this comment

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

with should always be used over the smallest scope possible and not over everything.

@evils
Copy link
Member Author

evils commented Apr 26, 2021

added a meta.platforms entry, set to unix as the commit i'm using supposedly adds macos support (though that's just a build change that shouldn't affect us, it should mean it works)

@ofborg ofborg bot added 10.rebuild-darwin: 1-10 and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin labels Apr 26, 2021
Comment on lines +17 to +19
let
inherit (lib) optionals;
in
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
let
inherit (lib) optionals;
in

@evils evils force-pushed the bucklespring branch 2 times, most recently from d94a61e to e2e95db Compare May 3, 2021 10:16
@lukegb
Copy link
Contributor

lukegb commented May 3, 2021

Mind fixing up the commit message and PR title to match? Then I think this is good to go.

@evils
Copy link
Member Author

evils commented May 3, 2021

Mind fixing up the commit message and PR title to match? Then I think this is good to go.

right, done

@lukegb lukegb merged commit 7c67967 into NixOS:master May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants