Systemd neuron - Neuron

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Sergiu

I'm trying to wrap neuron rib -w in a systemd file to always watch for changes in my zettelkasten directory however I'm greeted with a failed systemd service everytime . The error below:
Jun 24 21:36:29 workstation neuron[29684]: neuron: HOME: getHomeDirectory:getEnv: does not exist (no environment variable)

Sergiu

I'm not really sure why, since $HOME is set fine.
Systemd file:
[Unit]
Description=make Neuron watch for changes and regenerate static files in .neuron/output

[Service]
ExecStart=/home/sergiu/.nix-profile/bin/neuron rib -w

[Install]
WantedBy=multi-user.target

Sergiu

/home/sergiu/.nix-profile/bin/neuron rib -w runs fine when alone in terminal

Sergiu

Can anyone give some pointers?

Nadrieril

It doesn't look like that unit is running under your user. You should add a User = sergiu line somewhere. Then if it still doesn't find HOME, I'd hardcode the path: neuron rib -w -d /home/path/to/zettelkasten

Sergiu

Nadrieril said:

It doesn't look like that unit is running under your user. You should add a User = sergiu line somewhere. Then if it still doesn't find HOME, I'd hardcode the path: neuron rib -w -d /home/path/to/zettelkasten

Thanks a lot, that did it!

Sridhar Ratnakumar

Would be cool to document systemd use via home-manager (nix) in the docs.

Nadrieril

https://github.com/srid/neuron/pull/249

GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.