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

Solving #30396 #35896

Merged
merged 1 commit into from Apr 16, 2018
Merged

Solving #30396 #35896

merged 1 commit into from Apr 16, 2018

Conversation

wucke13
Copy link
Contributor

@wucke13 wucke13 commented Feb 27, 2018

Motivation for this change

#30396
DR:
When setting services.emacs.enable = true;, a custom shell script to start emacsclient, namely emacseditor is build. This PR adds the generation of .desktop to /share/applications/, so that emacseditor can be run from an ordinary GUI program launcher.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-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 nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@romildo
Copy link
Contributor

romildo commented Feb 27, 2018

A desktop file for starting emacsclient is of interest not only when using the NiXOS emacs service, but when using emacs in general, as there are other ways of starting it. I think it would be better the desktop file installed by the emacs package itself.

@wucke13
Copy link
Contributor Author

wucke13 commented Feb 27, 2018

This particular .desktop file runs emacseditor, which is a little shellscript to start emacsclient. emacseditor is only generated when services.emacs is enabled. How would you like to deal with this?

@romildo
Copy link
Contributor

romildo commented Feb 27, 2018

So this desktop file as it is belongs to the NiXOS emacs service, as you have proposed.

My suggestion is to merge your PR now.

Later on the emacseditor script (which just starts emacsclient) and the corresponding desktop file can be moved to the emacs package, where it can be useful to more people.

@romildo
Copy link
Contributor

romildo commented Feb 27, 2018

Maybe you could also use the helper function makeDesktopItem to write the desktop file.

@romildo
Copy link
Contributor

romildo commented Feb 27, 2018

Probably /share/applications/emacsclient.desktop is not the appropriate path for the desktop file. Maybe ${config.system.path}/share/applications/emacsclient.desktop is preferable.

@wucke13
Copy link
Contributor Author

wucke13 commented Mar 2, 2018

Where is the difference between /share/applications/emacsclient.desktop and ${config.system.path}/share/applications/emacsclient.desktop?

Edit: I made the changes. There is no way to specify the out path of makeDesktopItem, but makeDesktopItem puts its .desktop file to $out/share/applications/. Now I'm even more interested in ${config.system.path}

@romildo
Copy link
Contributor

romildo commented Mar 2, 2018

On my NixOS system ${config.system.path}/share/applications/emacsclient.desktop is /run/current-system/sw/share/applications/emacsclient.desktop.

@wucke13
Copy link
Contributor Author

wucke13 commented Mar 3, 2018

/share/applications/emacsclient.desktop as destination of the writeTextFile causes the file to be linked to /run/current-system/sw/share/applications/emacsclient.desktop. So I still don't see the difference. what am i missing?
What's still needed to be done to merge?

@wucke13
Copy link
Contributor Author

wucke13 commented Apr 11, 2018

What is the current matter on this?

@adisbladis adisbladis merged commit 247c97b into NixOS:master Apr 16, 2018
jian-lin added a commit to linj-fork/nixpkgs that referenced this pull request Jan 20, 2024
This custom emacsclient desktop file was added[1] to Nixpkgs when
the upstream did not provide one.

Since an emacsclient desktop file is provided[2] by the upstream now,
we should remove our custom one from Nixpkgs to reduce maintenance
burden[3].

Fixes NixOS#245533

[1]: NixOS#35896
[2]: https://git.savannah.gnu.org/cgit/emacs.git/commit/etc/emacsclient.desktop?id=1a845a672dc73c8e98e6cb9bb734616e168e60ba
[3]: https://git.savannah.gnu.org/cgit/emacs.git/commit/etc/emacsclient.desktop?id=1500e4b4329d4d3d0141263230d74e1b314373b1
github-actions bot pushed a commit that referenced this pull request Jan 20, 2024
This custom emacsclient desktop file was added[1] to Nixpkgs when
the upstream did not provide one.

Since an emacsclient desktop file is provided[2] by the upstream now,
we should remove our custom one from Nixpkgs to reduce maintenance
burden[3].

Fixes #245533

[1]: #35896
[2]: https://git.savannah.gnu.org/cgit/emacs.git/commit/etc/emacsclient.desktop?id=1a845a672dc73c8e98e6cb9bb734616e168e60ba
[3]: https://git.savannah.gnu.org/cgit/emacs.git/commit/etc/emacsclient.desktop?id=1500e4b4329d4d3d0141263230d74e1b314373b1

(cherry picked from commit 20f07b4)
mkg20001 pushed a commit to mkg20001/nixpkgs that referenced this pull request Jan 21, 2024
This custom emacsclient desktop file was added[1] to Nixpkgs when
the upstream did not provide one.

Since an emacsclient desktop file is provided[2] by the upstream now,
we should remove our custom one from Nixpkgs to reduce maintenance
burden[3].

Fixes NixOS#245533

[1]: NixOS#35896
[2]: https://git.savannah.gnu.org/cgit/emacs.git/commit/etc/emacsclient.desktop?id=1a845a672dc73c8e98e6cb9bb734616e168e60ba
[3]: https://git.savannah.gnu.org/cgit/emacs.git/commit/etc/emacsclient.desktop?id=1500e4b4329d4d3d0141263230d74e1b314373b1
peterhoeg pushed a commit to peterhoeg/nixpkgs that referenced this pull request Jan 22, 2024
This custom emacsclient desktop file was added[1] to Nixpkgs when
the upstream did not provide one.

Since an emacsclient desktop file is provided[2] by the upstream now,
we should remove our custom one from Nixpkgs to reduce maintenance
burden[3].

Fixes NixOS#245533

[1]: NixOS#35896
[2]: https://git.savannah.gnu.org/cgit/emacs.git/commit/etc/emacsclient.desktop?id=1a845a672dc73c8e98e6cb9bb734616e168e60ba
[3]: https://git.savannah.gnu.org/cgit/emacs.git/commit/etc/emacsclient.desktop?id=1500e4b4329d4d3d0141263230d74e1b314373b1
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

5 participants