dckc / madmode-blog

my tinkering notebook (blog)
https://www.madmode.com
0 stars 2 forks source link

how to enable nix services such as keybase / kbfs? #150

Open dckc opened 2 years ago

dckc commented 2 years ago

In order to clean up storage on a (headless / server) machine, I managed to boot nix from netboot.xyz (using a usb key). Yay!

Then I added https://github.com/dckc.keys as ~nixos/.ssh/authorized_keys so I could log in from my desktop.

Then I started syncthing going, then shut down the machine to move it to "the server room".

Oops. The syncthing config was on ram disk.

So I thought about using kbfs for persistent state.

But nix-shell -p keybase wasn't enough to get the service started. How exactly do I do that?

The accepted answer to How to run Keybase? was "we have services for this in NixOS." But that doesn't tell me what to type / do.

ajmcmiddlin commented 2 years ago

You can look at the nixos options page to search for things. If you search for the name of the service you're interested in, you'll hopefully find a services.<some-service>.enable entry. Setting that option in your configuration.nix for the machine you're using should be enough.

In the case of keybase and kbfs, you should add the following:

# Enables the keybase service.
services.keybase.enable = true;

# Enables the kbfs service.
services.kbfs.enable = true;

If they don't appear to be working, try checking their status, starting them manually, or rebooting the machine.

# Check kbfs service status
systemctl status kbfs

# Start the kbfs service manually
systemctl start kbfs