-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
nixos/openvpn: path now requires conversion to a string #97438
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
Conversation
Following changes in NixOS#91092 the `path` attribute is now a list instead of being a string. This resulted resulted in the following evaluation error: "cannot coerce a list to a string, at [...]/nixos/modules/services/networking/openvpn.nix:16:18" so we now need to convert it to the right type ourselves. Closes NixOS#97360.
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've tested this change with a existing openvpn config and everything seems to be working again ...
Would a kind soul give me instruction on how to apply this patch and test it locally too? - I'm still very new to nixos :D |
@nathandao The simplest way would be to rebuild your system directly from this branch (which is based on nixos-unstable with my commit added on top). You can do that with:
Slightly more involved would require that you have a local nixpkgs checkout on your machine. You could then create a new branch that uses the exact nixpkgs revision you want to use, checkout this PR locally, cherry-pick the change to your branch and rebuild with:
|
Thanks @pbogdan! Rebuilt my system based on the branch and it works! : ) |
Needs backport to 20.09 |
Backported in 159760a |
@@ -11,7 +11,8 @@
makeOpenVPNJob = cfg: name:
let
- path = makeBinPath (getAttr "openvpn-${name}" config.systemd.services).path;
+ packages = (getAttr "openvpn-${name}" config.systemd.services).path;
+ path = "${makeBinPath packages}:${makeSearchPathOutput "bin" "sbin" packages}";
upScript = ''
#! /bin/sh |
It's a nixpkgs convention, enforced by the standard |
I copied that snippet from the systemd module, so I assumed that /sbin was included for a reason, but if the binaries are always copied over then it shouldn't matter anyways. |
Following changes in #91092 the
path
attribute is now a listinstead of being a string. This resulted resulted in the following evaluation error:
"cannot coerce a list to a string, at [...]/nixos/modules/services/networking/openvpn.nix:16:18"
so we now need to convert it to the right type ourselves.
Closes #97360.
NOTE: I only verified that this fixes the evaluation and that the resulting path looks OK in nix repl.
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)