Configure non-NixOS system from home-manager

Hey you all,

I am pretty much depressed, I have to once again abandon NixOS, there is no way for me to work on radare2.

Nevertheless, I don’t want to get rid of Nix, I simply love it, and therefore I wonder: is it possible to configure my system, that is not NixOS, by using just standalone home manager?

I’ve seen this. And I have absolutely no idea how would I go about installing home manager as a root and configure it by this home-etc.nix file. Can anyone please help me with that?

I’m totally lost right now so any answer would be a rescue and highly appreciated.

Have you considered distrobox?

I would not recommend doing that.

If you really want to, you can just follow the standalone installation instructions as root, and then just add that gist to the imports of your root user’s home.nix.

After that you just use environment.etc in your home-manager config as if you were on NixOS.

I still think something like distrobox, nix-ld or a VM on NixOS, would be way more appropriate. Or of course solving the underlying problem that prevents you working on that project.

1 Like

GitHub - numtide/system-manager: Manage system config using nix on any distro may be of interest.

3 Likes

Yea, I am afraid that radare2 is one of the 0,001% of the projects that you simply can’t develop on NixOS. It’s a cli disassembler, so the way thinks are linked together really matters, especially while running tests.

It gets all the binary files and tests them against a standard Linux distro dynamic linking. Even though I managed to patchelf all those bins when going into the devshell, the tests are still failing because linked dynamic libraries names are different or there are more symbols in a binary than there should be.

After thinking about it for a while, I agree. Home manager is not the best way to go here as the name suggest :laughing:

Nevertheless, thanks for the explanation

Ohh, So there is something like nix-darwin for any Linux distro, good to know, would definitely consider that. But it should be renamed to nix-ubuntu as it is the only really supported distro here rn besides NixOS :laughing:

I thought that you were one of the contributors here but it was my brain’s lag and I was looking at the nix-darwin repo xd. Nevertheless, Huge respect :saluting_face:

nix-ld and distrobox should solve those problems.

1 Like

Oh, really? I’ve heard about nix-ld, never used it but seems like its really useful. I will try my best at setting this up, I will not give up NixOS that quickly

1 Like

nix-darwin is for MacOS. Darwin refers to Apple operating systems.

Yeea, I know, I meant by this that there is any Linux distro alternative to that, sorry, It could be misleading xd

No, it works on any systemd-based distro.

1 Like

Okey, nix-ld is simply insane, I used it and still have some tests failing but at least its consistent, and it is somehow normal for radare2 to have failing tests, so thanks a lot, problem solved :smiley:

2 Likes

Wouldn’t an FHS dev shell also work and be more idiomatic than nix-ld?
It looks like this would remove the requirement of globally installing libraries, possibly polluting other projects.

Nix-ld can be configured with a shell.nix too, so there’s no inherent need for global pollution.

fhs sandboxes can be quite tricky to configure, and not everything likes being in a cgroup that messes with paths, especially tests, so these days I’d suggest nix-ld most of the time, unless you have reasons to use cgroups beyond issues with dynamic linking on NixOS.

2 Likes

Yea, totally agree. Especially due to the fact that, for instance, radare2 needs sudo permission on installation and in FHSEnv it seems like it is impossible to achieve.