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

nixos/kdeconnect: Added programs.kdeconnect option #63899

Merged
merged 1 commit into from Jun 26, 2021

Conversation

pasqui23
Copy link
Contributor

@pasqui23 pasqui23 commented Jun 28, 2019

Motivation for this change

KdeConnect requires to open TCP and UDP ports to work properly

Things done
  • 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.

@pasqui23 pasqui23 requested a review from infinisil as a code owner June 28, 2019 16:12
@pasqui23 pasqui23 changed the title Nixos/kdeconnect:Added programs.kdeconnect option nixos/kdeconnect:Added programs.kdeconnect option Jun 30, 2019
Copy link
Contributor

@matthiasbeyer matthiasbeyer left a comment

Choose a reason for hiding this comment

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

Diff looks good to me.

Copy link
Contributor

@bjornfor bjornfor left a comment

Choose a reason for hiding this comment

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

Please update commit message to "nixos: add programs.kdeconnect option" and add an "...openFirewall" boolean option that defaults to false.

default = pkgs.kdeconnect;
type = types.package;
description=''
The package providing the implementation for kdeconnect
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing period at end of sentence.

Copy link
Contributor

@bjornfor bjornfor left a comment

Choose a reason for hiding this comment

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

Please squash fixup commit. And this still applies: Please update commit message to "nixos: add programs.kdeconnect option" and add an "...openFirewall" boolean option that defaults to false.

@pasqui23
Copy link
Contributor Author

pasqui23 commented Sep 16, 2019 via email

@bjornfor
Copy link
Contributor

Kdeconnect won't work at all without those ports open,and it won't even give any error message

Right. But most nixos options don't automatically open the firewall, even though opening the firewall is the "correct" thing to do in many cases.

I guess this is a bit different than running a webserver, since that can be accessed via localhost, whereas for this program that doesn't make sense.

On the other hand, you're pretty likely to see the openFirewall option when you search for kdeconnect in nixos config options.

Let's get input from other community members.

Please fix git history so that it's ready to merge.

@infinisil
Copy link
Member

I guess another reason to not open ports by default is that users might be running other things on those ports already, which would then be open for anybody. An openFirewall option is like a warning sign to the user that ports are being opened, they should make sure those aren't used by something else already (the ports should ideally be mentioned in the description).

You could also add

{
  assertions = [{
    assertion = cfg.openFirewall;
    message = "You need to enable `programs.kdeconnect.openFirewall` to use KDEConnect, which opens ports ${portRange}.";
  }];
}

to make sure it's enabled.

@pasqui23
Copy link
Contributor Author

pasqui23 commented Nov 9, 2019

@infinisil I don't like that a module needs 2 flags set to true when any other module only requre 1,with maybe some other more specific configuration.
I have clarified that the module will open the given port

let
cfg = config.programs.kdeconnect;
in mkIf cfg.enable {
environment.systemPackages = [cfg.package];
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps also add gsconnect to systemPackages, if desktop is gnome 3?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe in a further commit

@stale
Copy link

stale bot commented Jun 26, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@stale stale bot added 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md and removed 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md labels Jun 26, 2020
@pasqui23
Copy link
Contributor Author

Still waiting on @infinisil 'S review

Copy link
Contributor

@oxalica oxalica left a comment

Choose a reason for hiding this comment

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

There are some format issues. You can run nix run nixpkgs.nixpkgs-fmt -c nixpkgs-fmt <path_to_nix_file> to fix most of them.

Also I agree the comment #63899 (review) that it's better to squash all commits and tweak commit message.

nixos/modules/programs/kdeconnect.nix Outdated Show resolved Hide resolved
nixos/modules/programs/kdeconnect.nix Outdated Show resolved Hide resolved
nixos/modules/programs/kdeconnect.nix Outdated Show resolved Hide resolved
nixos/modules/programs/kdeconnect.nix Outdated Show resolved Hide resolved
nixos/modules/programs/kdeconnect.nix Outdated Show resolved Hide resolved
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/331

@doronbehar
Copy link
Contributor

@pasqui23 you still have some typos mentioned in the reviews not fixed in current state of the PR.

@Kiwi Kiwi requested review from Kiwi and removed request for infinisil December 20, 2020 10:16
@Kiwi Kiwi requested a review from infinisil December 20, 2020 10:28
@Kiwi
Copy link
Member

Kiwi commented Dec 20, 2020

I didn't mean to remove @infinisil >.> I'll try and get around to making the changes sometime if it's still open later

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/465

@SuperSandro2000 SuperSandro2000 changed the title nixos/kdeconnect:Added programs.kdeconnect option nixos/kdeconnect: Added programs.kdeconnect option Feb 11, 2021
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/485

Copy link
Contributor

@doronbehar doronbehar left a comment

Choose a reason for hiding this comment

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

@pasqui23 could you please address @oxalica's review? The typos / formatting may not be super important for functionality but we'd like these kind of things to be consistent across Nixpkgs.

nixos/modules/programs/kdeconnect.nix Show resolved Hide resolved
options.programs.kdeconnect = {
enable = mkEnableOption ''
kdeconnect.Note that it will open the TCP and UDP port from
1714 to 1764 as they are needed for its correct working
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
1714 to 1764 as they are needed for its correct working
1714 to 1764 as they are needed for it to function properly.
You can use the <option>package</option> to use
<code>gnomeExtensions.gsconnect</code> as an alternative
implementation if you use Gnome.

Copy link
Contributor

@oxalica oxalica left a comment

Choose a reason for hiding this comment

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

LGTM. Not sure if gsconnect should go here.

nixos/modules/programs/kdeconnect.nix Outdated Show resolved Hide resolved
@infinisil
Copy link
Member

Does this have any integration with plasma? Should enabling plasma also enable this option?

@pasqui23
Copy link
Contributor Author

pasqui23 commented May 3, 2021

I don't think so, I'm using it on windows too and there is gsconnect for GNOME. This is mostly so it opens the right ports.

@infinisil
Copy link
Member

I guess this looks good after a squash

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/540

@pasqui23
Copy link
Contributor Author

pasqui23 commented Jun 9, 2021

@infinisil I've squashed all the commits in one. Are there any other blockers?

@doronbehar
Copy link
Contributor

Let's merge this old PR :).

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

9 participants