Ultraschall / ultraschall-nix

nix package development
MIT License
1 stars 0 forks source link

[ENHANCEMENT] Separate software packaging from modifying the user home #2

Open britter opened 10 months ago

britter commented 10 months ago

Is your feature request related to a problem? Please describe.

It's great that this project provides support for installing Ultraschall via Nix. However, it looks like it mixes the packaging of the software with installing Ultraschall into the user's home directory. In particular these lines break with the convention of putting things into the nix store and linking them to the target location. The result of that is that when removing the Ultaschall module from a nix system configuration or rolling back to a previous generation, stale folders will be left in the user's home directory.

Describe the solution you'd like I think an idiomatic solution would look like the following:

Describe alternatives you've considered

Additional context

fernsehmuell commented 9 months ago

Thanks for the input. I changed a lot in this feature branch: https://github.com/Ultraschall/ultraschall-nix/tree/feature/configfile37c3editon but it is still work in progress. I linked all static binaries to the nix-store. The lua scripts will be a copy, because they should be editable by design. When everything is working i plan to put it into nixpkgs. Maybe a nixos-module, but i see no benefit for that at the moment.

britter commented 9 months ago

Hey @fernsehmuell! Thank you for the answer. I've been working on this myself in my nix-configuration repository: https://github.com/britter/nix-configuration/compare/main...bene/ultraschall. My approach is a little bit different though. From what I can see you're using the ultraschall installer to get all the binaries? What I've done is trying to package all required components using nix starting with studio-link. Unfortunately studio-link seems to use quite outdated third party libraries (libre, librem, baresip) and also patches them. For that reason I had to rewirte these modules instead of using them from nixpkgs. I'm at the point where I'm able to build the studio-link reaper plugin (overlay-vst) and am working now on the onair plugin (overlay-onair-lv2).

Regarding installation: I still believe this should be done by home-manager and it should be linked from the nix store into the user home. The reason for this is that there is tooling for NixOS that will break the Ultraschall installation if it copies stuff into the user home, such as Impermance. Regarding editable lua files: that would need to be modeled in the home-manager module for ultraschall.

Regarding submitting this to nixpkgs: I was thinking about contributing what I've done in terms of packaging studio-link and also Ultraschall soundboard, as soon as I get to it. This is a prerequisite for creating a home-manager module on top of it.

I don't see how a NixOS Module would help with any of this as these modules are supposed to configure system wide things like systemd units, an ultraschall clearly needs to be installed on a per-user basis (hence my proposal to go with home-manager).

Anyway, let's keep each others in the loop about this! I will let you know once I get everything working on my end.

fernsehmuell commented 8 months ago

Nice, i am not a fan of building stuff at two places, and normally we update Ultraschall not very often. We have no time and energy to support too many unknowns like different libs etc. That’s why there is one blob of files and one pinned version of reaper. I know that this is not the nixos way. But let’s talk about that in the near future.