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
dunst service: init [wip, stalled] #19183
Conversation
This reverts commit 2c2437bd2432537f3b6da3749e35d0cbb130c326.
* user level service * modelled on redshift
@siddharthist, thanks for your PR! By analyzing the history of the files in this pull request, we identified @edolstra, @bjornfor and @offlinehacker to be potential reviewers. |
See also #11167 |
I might go ahead and steal commits (if that's alright, @matthiasbeyer) from #11167, looks like it's a more complete rendering of the config file. |
* add plain_text option * add a hint of documentation * remove unused uid, gid * make new service based on upstream, uses Type=dbus * don't require dmenu * add extraConfig option * add package option
I think this just needs documentation and a little more testing. Will get back on it tomorrow! |
Looks like while the notification server is running, it isn't respecting our configuration. When I run the service manually using the command in the unit file, it does respect the configuration. Any ideas @matthiasbeyer? BTW, I'm happy to grant you commit access to my fork if you'd like to work collaboratively on polishing this up. |
Ah, you already did this! Awesome! Feel free to reuse any of my commits or revert, remove or squash them as you like! |
No, I'm happy with either sending you commits to cherry-pick or (what's more likely) let you do the stuff (helping where I can, but my semester starts tomorrow and I'm not sure I can help that much anyways). |
description = "Extra configuration to append to the config file."; | ||
}; | ||
|
||
package = mkOption { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't used and also the override mechanism should be enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@groxxda It is used, check the ExecStart
. I modelled it after Redshift, where this is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, but you don't use it for environment.systemPackages
.
I still think this option is not necessary (same applies to redshift)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
environment.systemPackages = [ pkgs.dunst ]; | ||
systemd.user.services.dunst = { | ||
description = "Dunst: lightweight and customizable notification daemon"; | ||
wantedBy = [ "default.target" ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
graphical.target
seems like a better fit to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe default.target
is used for user services because there is no standard graphical.target
, unlike for system services. Havent' checked if we provide such a thing, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh your absolutely right. i didn't know this difference for user services. sorry for the trouble..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, this also makes it a little bit awkward to deal with user services for which a graphical target would make sense (i.e., what happens if user logs into console only).
Restart = "always"; | ||
RestartSec = 3; | ||
}; | ||
environment.DISPLAY = ":${toString ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought our x would already set this in the user env, but it may be DM specific
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@groxxda This was also modelled after some other services.
dunst = { config, pkgs, ... }: { | ||
services.xserver.enable = true; | ||
services.dunst.enable = true; | ||
environment.systemPackages = [ pkgs.libnotify ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the service itself work without libnotify?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but not the test (which uses notify-send
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay thanks for the explanation 👍
So what is the current status of this pr? I would be very much interested ;) |
@markus1189 I'm not working on it anymore since I wasn't able to solve the mentioned issues. |
I would be interested as well. Can someone sum up what we need to do to get this into the repository? |
@siddharthist can you squash everything into one commit at least for review? |
@Mic92 seems like @siddharthist does not have his nixpkgs repository anymore. I'm trying to investiate here. |
@Mic92 please have a look at the "add-dunst-service" branch in my nixpkgs fork. I squashed the commits from this PR and did some formatting of the source. I guess we can start with it, but I do not know how to test services, so it would be nice to get some help. |
@matthiasbeyer I left some notes. |
@Mic92 yes I added what you've suggested. How can I test whether the service performs correctly? ("test" as in "try out" rather than in "test script"). |
@Mic92 @matthiasbeyer I've been working considerably less on nixpkgs recently, my apologies for not getting back to you sooner. Essentially, I never got dunst starting reliably, and couldn't figure out what was wrong. You're obviously welcome to use anything I've done here if it's helpful. |
@matthiasbeyer I used to just check out the appropriate branch, and |
I guess this one is stalled 😢 |
|
||
config = mkIf cfg.enable { | ||
environment.systemPackages = [ pkgs.dunst ]; | ||
systemd.user.services.dunst = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious, is this systemd service actually used for you? If you are in an X session with a running dunst, and run
$ systemctl --user status dunst.service
does it show as active or inactive? I suspect it will show inactive since this is something I've been having difficulties with in Home Manager.
Closing this one. |
Motivation for this change
Dunst is a notification server, it should be run all the time 💬
I'm having some trouble getting this working. When I run the command listed in the unit file, it works just fine (with correct settings). However, when I start the unit, it immediately fails without any log output. Could someone with a bit more experience with user units take a look? [edit: this seems to have been fixed by adding
Type=dbus
]Bumped into #7326 while creating this... might have to get around to fixing that if I can.
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)