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

xss-lock: improve locker options passing #61311

Merged
merged 3 commits into from May 12, 2019

Conversation

turboMaCk
Copy link
Member

@turboMaCk turboMaCk commented May 11, 2019

Noob alert: This is my first PR to nixpkgs.

Motivation for this change

Currently, command line arguments can't be passed in locker easily without workarounds.

# Doesn't work
programs.xss-lock.lockerCommand = "${pkgs.xlockmore}/bin/xlock -mode ant";

This is because xss-lock doesn't recognize these are locker arguments.

# Works but seems hacky
programs.xss-lock.lockerCommand = "-- ${pkgs.xlockmore}/bin/xlock -mode ant";
Things done

In short:

  • allow locker options without hacks
  • add extraOptions

Locker is now separated by --. Because of this one can no longer abuse locker option to pass arguments to xss-lock and therefore new option extraOptions was added to pass options to xss-lock

This is a breaking change for configurations which used workaround described

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nix-review --run "nix-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)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@turboMaCk
Copy link
Member Author

cc @Ma27 who is listed maintainer of the xss-lock package.

- allow locker options without hacks
- add extraOptions
@Ma27
Copy link
Member

Ma27 commented May 11, 2019

@GrahamcOfBorg test xss-lock

@Ma27
Copy link
Member

Ma27 commented May 11, 2019

Bt win case another maintainer sees this: I'd like to add a simple testcase for the example provided above before merging this, but I'm slightly busy with other stuff now, so it would be great if you could be patient until I've pushed that :)

@turboMaCk
Copy link
Member Author

I really appreciate how responsive (and fast) you were. There's no need to rush this imo. Better right than right now.

Also, let me know if I should change or do something extra here. I'm interested in learning how to work with nixpkgs so I can contribute more in the future.

Ma27 added 2 commits May 12, 2019 03:20
* Don't use `literalExample`, raw Nix values can directly be specified
  as an option example which provides support for highlighting in the
  manual as well.

* Escape shell args for `extraOptions`: I.e. the `-n` option might be
  problematic as a longer notification command might be misinterpreted.
@Ma27
Copy link
Member

Ma27 commented May 12, 2019

@GrahamcOfBorg test xss-lock

@Ma27 Ma27 merged commit fa2c6dc into NixOS:master May 12, 2019
@Ma27
Copy link
Member

Ma27 commented May 12, 2019

@turboMaCk thanks!

@turboMaCk turboMaCk deleted the xss-lock-locker-options branch May 12, 2019 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants