#254·niri

systemctl import-environment without specifying desired variables is deprecated

Author: jokeyrhymeCreated Mar 12, 2024Updated Sep 15, 2026
Labelsarea:session

Howdie, thanks so much for sharing this project! <3

I noticed a deprecation message pop up briefly during niri's launch, and I tracked it down to this: https://github.com/systemd/systemd/pull/18137

And we call systemctl --user import-environment without specific variable names here: https://github.com/YaLTeR/niri/blob/40cec34aa4a7f99ab12b30cba1a0ee83a706a413/resources/niri-session#L24

The thing is, I'm not sure when this will stop working on the systemctl side, seeing as it's been deprecated for years

And I'm not even sure what I'd recommend going forward

  • do we drop the line completely? this might break existing user scripts, however, these values will still end up in the environment variables for the niri process itself (and thus every child process it launches), just not in the user service manager
  • do we provide a list of variables that users are likely to want (e.g. PATH)? that seems like a game of whack-a-mole

Another aspect of the current behaviour is that variables from the virtual console environment end up in my user service manager environment, like TERM=linux and PWD which are often unhelpful/confusing once I'm in a GUI desktop environment (but I can probably find workarounds for my own stuff)

Anyhow, this has probably not been super helpful, but I thought I'd log it, just in case anyone else notices the deprecation message :)