Skip to content
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

NixOS (Linux) Mesh Agent #5802

Open
ww4 opened this issue Feb 14, 2024 · 7 comments
Open

NixOS (Linux) Mesh Agent #5802

ww4 opened this issue Feb 14, 2024 · 7 comments

Comments

@ww4
Copy link

ww4 commented Feb 14, 2024

NixOS is gaining in popularity among Linux users, due to being an immutable / declarative style OS. There are thousands of packages available for it, including the MeshCentral server. However the Mesh Agent is not available.

The standard method of installation for Linux agents appears to be downloading a bash script and running it. This is not my preferred way to install software on Linux, and absolutely won't work on NixOS, as all packages are installed by Nix from a config file.

How do you go about adding Mesh Agent support for various Linux distributions? If someone can explain the codebase a little, I would be willing to take a stab at this.

@si458
Copy link
Collaborator

si458 commented Feb 14, 2024

You can just download the binary file directly from the web ui, then run meshagent -install for it to install OR meshagent -run to run it in the forground instead of the background
Does this help?

Edit. I've never heard of nixos isn't it just an x64 bit platform?
Edit2. Can't fully remember if those are the command line options but u can run meshagent -help to get the options

@tomsik-radek
Copy link

I talked about immutable Linux in #5384, about SteamOS. The issue was that you can't write the systemd service into /etc/systemd/system/. Sadly it wouldn't stay connected.

@tomsik-radek
Copy link

You can just download the binary file directly from the web ui, then run meshagent -install for it to install OR meshagent -run to run it in the forground instead of the background Does this help?

Edit. I've never heard of nixos isn't it just an x64 bit platform? Edit2. Can't fully remember if those are the command line options but u can run meshagent -help to get the options

It's an immutable distro, sort of like Fedora Silverblue or SteamOS3

@ww4
Copy link
Author

ww4 commented Feb 26, 2024

you can't write the systemd service into /etc/systemd/system/

NixOS usually handles this with symlinks. Lots of binaries get packaged this way for Nix, there are over 80,000 packages in the repo. https://search.nixos.org/packages. Someone just has to take an interest and dive in.

I'm working on this myself but it's a steep learning curve. So far I have gotten the installer to launch, but it complains about not running as sudo (it is running as sudo). I'll keep digging in as I have the time.

@buckybytes
Copy link
Contributor

It looks like NixOS knows this is going to be a common issue for users.

https://nixos.wiki/wiki/Extend_NixOS

Shows how to extend the system with additional software, and how to upload your package to the repo.

@Kuuchuu
Copy link

Kuuchuu commented Mar 24, 2024

Until a native NixOS solution is created, I've put together a workaround using Docker. Desktop tab does not work, but Terminal and Files work good, so perfectly fine for a headless NixOS install: https://github.com/Kuuchuu/meshagent-docker

@jficz
Copy link

jficz commented Sep 19, 2024

NixOS is essentially a source-based distro which doesn't follow FHS. This is highly problematic when pre-built binaries must be run as those are usually built with a lot of assumptions about the OS which are not true for immutable distros and much less for NixOS. The proper solution for NixOS is to build the agent from source properly using nix tooling. Is it possible to build the agent from MeshCentral sources?

Another possibility, though less preferred, would be to ship a completely statically built binary which makes zero assumptions about the system. I'm sure NixOSers would be happy with a simplified agent that just runs and doesn't try to do any kind of system configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants