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
Add networkd notify #21593
Add networkd notify #21593
Conversation
Waiting for wavexx/networkd-notify#1 |
|
||
installPhase = '' | ||
mkdir -p $out/bin | ||
ls |
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.
leftover?
{ stdenv, pythonPackages, fetchFromGitHub }: | ||
|
||
pythonPackages.buildPythonPackage rec { | ||
name = "networkd-notify-${version}"; |
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.
Please use the following notation for unstable packages:
name = "networkd-notify-unstable-2016-05-17";
mkdir -p $out/bin | ||
ls | ||
cp networkd-notify $out/bin/ | ||
chmod +x $out/bin/networkd-notify |
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.
install -m755 networkd-notify $out/bin/networkd-notify
|
||
systemd.services.networkd-notify = { | ||
description = "networkd desktop notification"; | ||
wantedBy = [ "multi-user.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.
Does a system service running as root find a user dbus session? (I have not tried it out yet - but it surprises me).
How is the service supposed to work? There is no ExecStart
here. I think you probably want a user service here.
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 I don't know how to do it :-)
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.
You need to run it as a user service:
systemd.user.services.networkd-notify
vs systemd.services.networkd-notify
That also means multi-user.target
is not available. With systemd 232 soon entering master, that should instead be graphical-session.target
.
I also need some help with the package itself. I was told that "gi" (the dependency) is the "python Gobject-Introspection package", though I do not find it in nixpkgs (python-gobject2/3 does not work). Ideas? |
@@ -16,6 +16,7 @@ pythonPackages.buildPythonPackage rec { | |||
phases = [ "unpackPhase" "installPhase" ]; | |||
|
|||
installPhase = '' | |||
mkdir -p $out/bin/ | |||
install -m755 networkd-notify $out/bin/networkd-notify |
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.
you can also use "-D" for install instead of the "mkdir".
Done. I still don't know what the "python-gobject" thing should be ... so there's still a dependency missing here. |
9cdea90
to
1dabb15
Compare
Hm, maybe factor out just the package so that it can be merged? Or is the service also working by now? |
|
||
systemd.services.networkd-notify = { | ||
description = "networkd desktop notification"; | ||
wantedBy = [ "multi-user.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.
You need to run it as a user service:
systemd.user.services.networkd-notify
vs systemd.services.networkd-notify
That also means multi-user.target
is not available. With systemd 232 soon entering master, that should instead be graphical-session.target
.
propagatedBuildInputs = with pythonPackages; [ dbus-python ]; | ||
|
||
phases = [ "unpackPhase" "installPhase" ]; | ||
|
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.
Any reason not to run fixupPhase
to patch the interpreter?
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.
Upstream also has a number of hardcoded file names - we probably need to replace those /usr/bin/networkctl
and /usr/bin/iwconfig
.
sha256 = "006d8qmmk0jg0a3fbl2q934wmmhx9n7c156i34i9zgzapdhhacq6"; | ||
}; | ||
|
||
propagatedBuildInputs = with pythonPackages; [ dbus-python ]; |
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.
Upstream mentions other dependencies:
The following software is currently required for networkd-notify:
Python (3.x or 2.7)
PyGObject/PyGI (python-gi)
Python D-Bus (python-dbus)
wireless-tools
Stalled. |
Motivation for this change
I want to have this... so I started to implement a package for it.
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/
)This is one of the first services I write, so please tell me what to improve etc. It is not tested yet, though (as I do not know how to).