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

[WIP] Add: dunst service #11167

Closed
wants to merge 11 commits into from

Conversation

matthiasbeyer
Copy link
Contributor

Service defintion for dunst.

Somehow I cannot build my system with this (nixos-rebuild build -I nixpkgs=... gives me error: The optionservices.dunst' defined in /nix/store/.../dunst.nix' does not exist).

Maybe someone can investigate?

Tests will follow...

@matthiasbeyer
Copy link
Contributor Author

Tests added. They do not really test the dunst service by now, but as you can see the dunstrc is not found. I do not know why.

'';
};

dmenu = mkOption {
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the use case for configuring this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not even sure why there is such an option. I only "ported" the configuration file to a nix expression without thinking too much about the settings.

@bendlas
Copy link
Contributor

bendlas commented Dec 7, 2015

I've tried using this on top of the current nixos-unstable channel: https://github.com/bendlas/nixpkgs/tree/dunst-service-fail

I get failures in documentation generation

building path(s) ‘/nix/store/zlq97dfabijy4ms5k27wrdacy5gcbag1-nixos-manual’
options-db.xml:7978: namespace error : Failed to parse QName 'http:'
<http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
      ^
options-db.xml:7978: parser error : error parsing attribute name
<http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
      ^
options-db.xml:7978: parser error : attributes construct error
<http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
      ^
options-db.xml:7978: parser error : Couldn't find end of Start Tag http: line 7978
<http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
      ^
options-db.xml:7978: namespace error : Failed to parse QName 'http:'
<http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
      ^
options-db.xml:7978: parser error : error parsing attribute name
<http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
      ^
options-db.xml:7978: parser error : attributes construct error
<http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
      ^
options-db.xml:7978: parser error : Couldn't find end of Start Tag http: line 7978
<http://developer.gnome.org/pango/stable/PangoMarkupFormat.html>.
      ^
man-configuration.xml:34: element include: XInclude error : could not load options-db.xml, and no fallback was found
./man-pages.xml:8: element refmiscinfo: Relax-NG validity error : Invalid sequence in interleave
./man-pages.xml:34: element include: Relax-NG validity error : Element refsection has extra content: include
./man-pages.xml:29: element refsection: Relax-NG validity error : Element refentry has extra content: refsection
./man-pages.xml:3: element reference: Relax-NG validity error : Element reference failed to validate content
./man-pages.xml fails to validate
manual.xml:39: element include: XInclude error : could not load options-db.xml, and no fallback was found
builder for ‘/nix/store/wnl9sr61cvzayjvs4rdzlj315rk3lcaa-nixos-manpages.drv’ failed with exit code 3
manual.xml:39: element include: Relax-NG validity error : Did not expect element include there
manual.xml:39: element include: Relax-NG validity error : Expecting element example, got include
manual.xml:39: element include: Relax-NG validity error : Expecting element bridgehead, got include
manual.xml:39: element include: Relax-NG validity error : Expecting element annotation, got include
manual.xml:39: element include: Relax-NG validity error : Element appendix failed to validate content
manual.xml fails to validate
builder for ‘/nix/store/pj7n5zzhfnkm4sqwqn9rkmcx40hl0h15-nixos-manual.drv’ failed with exit code 3

@matthiasbeyer
Copy link
Contributor Author

@bendlas : Afaik, this is not yet merged, right? Anyhow, how is the trace you provided related to what I've done in this PR? And how to reproduce?

I will work on this asap, though atm I have not that much time.

@bendlas
Copy link
Contributor

bendlas commented Dec 7, 2015

@matthiasbeyer I included your commits in my system, because a) I use dunst and b) I wanted to help you test. When I saw those failures, I bisected them back to your commits. For your convenience (and reference), I linked the current unstable channel branch + your 2 commits in my comment. The current unstable builds fine.
I saw the failures by trying to nixos-rebuild with those commits applied, but I assume that you could reproduce by just building the nixos-manual with nix-build (I don't know the command for that offhand)

@bendlas
Copy link
Contributor

bendlas commented Dec 7, 2015

You can build just the manual from the nixpkgs source root with: nix-build nixos -A config.system.build.manual.manual
The failure is reproducable by this

@zimbatm
Copy link
Member

zimbatm commented Apr 9, 2016

What's the status of this PR ?

@matthiasbeyer
Copy link
Contributor Author

@zimbatm I will have a closer look on what's missing tomorrow. I will then either close this PR unmerged or push it to be ready, though I cannot promise anything here!

@matthiasbeyer
Copy link
Contributor Author

Wah, took me a bit longer than 1 days, I'm sorry. I have no longer any interest in this, feel free to reuse commits.

@matthiasbeyer
Copy link
Contributor Author

I'm interested again. I rebased to latest master and will now start working on this, but based on unstable, so I'm able to test it in a VM.

@matthiasbeyer
Copy link
Contributor Author

So here we go.

The failure @bendlas reported was indeed caused by this PR, it was the descriptions where the markup was wrong. I simply removed the descriptions (they should be added later, as soon as this is working).


What's working by now: dunst gets started by systemd. Anyways, systemctl status dunst says that the service is dead (killed by SIGSEGV) but notify-send hello still works.

dunst does not find the configuration file written via the config, though.

For people testing this: Put this in your configuration.nix:

  services.dunst = {
    enable = true;

    global = {
      transparency = 50;
      padding = 18;
      horizontalPadding = 18;
    };
    frame = {
      width = 8;
      color = ''#FF0000'';
    };
  };

Dunst should then put the notifications on the right side of the screen and they should be styled rather ugly. The default config shows the notifications on the left side in light blue (when sending notify-send hello for example).


Here is help wanted ... I don't know why dunst does not find the configuration file and I really do not know why systemd reports it crashed when it is actually running.

@zimbatm
Copy link
Member

zimbatm commented Jun 24, 2016

Is dunst forking itself by any chance? That would explain why maybe the parent would segfault but the child is still active.

@matthiasbeyer
Copy link
Contributor Author

@zimbatm Dunst seems to be forking, yes. But I also set the Type = "forking" for the systemd options...

@zimbatm
Copy link
Member

zimbatm commented Jun 24, 2016

If you can avoid the fork it generally is a good idea. Maybe there is a command-line option for that.

@matthiasbeyer
Copy link
Contributor Author

nope, there is not, sadly.

@zimbatm
Copy link
Member

zimbatm commented Jun 24, 2016

Weird, I just ran dunst from the command-line and it's running as foreground process.

@matthiasbeyer
Copy link
Contributor Author

Yeah, it is really weird ... maybe you (or someone else who knows how services on nixos work) can find the problem... but I'm at my wits end.


serviceConfig = {
ExecStart = "${pkgs.dunst}/bin/dunst -config ${dunstConf} ";
Type = "forking";
Copy link
Member

Choose a reason for hiding this comment

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

Did you try just removing this line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had it without this line before. Didn't help, though.

@joachifm
Copy link
Contributor

Is this still being worked on?

@matthiasbeyer
Copy link
Contributor Author

@joachifm I'm still waiting for review here and suggestions what could fix the problem.

@joachifm
Copy link
Contributor

Okay, but this is a lot of code that could be replaced simply by adding dunst & to your xinitrc ...

@joachifm joachifm mentioned this pull request Oct 3, 2016
7 tasks
@langston-barrett
Copy link
Contributor

Looks like upstream has a pretty strange systemd service which is the basis for this AUR package. Could that hold the key to dunst not dying?

@@ -270,6 +270,7 @@
toxvpn = 247;
squeezelite = 248;
turnserver = 249;
dunst = 250;
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't look like these are ever used in the configuration, am I missing something?

@joachifm
Copy link
Contributor

joachifm commented Oct 3, 2016

@siddharthist that is not a systemd service file. I'm dubious that the aur package actually does anything helpful. See https://dbus.freedesktop.org/doc/dbus-specification.html#message-bus-starting-services for details.

@joachifm
Copy link
Contributor

joachifm commented Oct 3, 2016

That said, using a dbus service instead of a systemd service might make sense anyhow.

@langston-barrett
Copy link
Contributor

@joachifm I've tried a DBus service type, and that gets it to not crash! See #19183. Will add more documentation on the fields tomorrow and hopefully get it mergeable.

@Mic92
Copy link
Member

Mic92 commented Oct 6, 2016

I would favor the new pull request (#19183)

@Mic92 Mic92 closed this Oct 6, 2016
@matthiasbeyer matthiasbeyer deleted the add-dunst-service branch October 6, 2016 07:57
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

8 participants