Open amarshall opened 3 days ago
@amarshall thanks for the report! I've looked a little into this so far and switch-to-configuration doesn't actually use that much of the unit file contents, which could be fine considering that systemd's DBus interface exposes almost all of their unit properties as DBus properties. However, since NixOS uses some custom unit properties (think X-StopIfChanged
), these aren't exposed as DBus properties. So instead I've gone the route of adding support for multi-line values in the INI parser used for switch-to-configuration-ng, with the eventual goal of upstreaming this support to that crate. This isn't going to be something that's immediately ready though, I should have a PR for review within the coming days. For now, I would recommend opting out of the switch-to-configuration-ng implementation with the following config until it's fixed:
{
system.switch.enableNg = false;
}
The problem with INI in general is that there is no standard. The systemd syntax, after all, “is inspired by XDG Desktop Entry Specification .desktop files, which are in turn inspired by Microsoft Windows .ini files”.
Describe the bug
See title. It also may fail to correctly parse comments within such blocks as well, but unsure.
Steps To Reproduce
Create a systemd unit in config e.g.
Fails with
Expected behavior
Per
man systemd.syntax
, this is valid syntax:The value of
ExecStart
should thus be parsed tofoo bar baz
(I may have gotten the spaces wrong there)Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Patch for failing example test case (may not be perfect):
Notify maintainers
@jmbaur
also @emilazy due to authoring https://github.com/NixOS/nixpkgs/pull/339727
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.I was running dry-activate to a config using nixpkgs @ 99dc8785f6a0adac95f5e2ab05cc2e1bf666d172
Add a :+1: reaction to issues you find important.