I have a non-nixos linux distro running which I want to setup NFS or SSHFS on via nix files for reproducibility as I know I will have to do this again and I hate docker with its YAML files and setup process. I am familiar with configuration.nix and know that on NixOS systems such a setup would leverage NixOS modules, HM and/or flakes. Since I am on a non NixOS sys and want to avoid installing HM would the only way to install and configure SSHFS and NFS in nix be to use a nix flake ( with an overlay configuring settings into a package output to be used with nix run or nix build)
Or is there some other approach that I am missing?
Ideally I want to just install the package manager available for Linux distros and get to work, extra tools like Home Manager and such. Maybe a flake at most.
Flake or not, your issue will always remain using the NixOS modules to generate the configuration files and systemd units and how to integrate them into your third party Linux.
You could probably build a NixOS system configuration that will contain these (e.g. through a flake) and then instead of activating this config like you normally would on NixOS, you copy or otherwise make these systemd units and config files available to your system. Not sure if there is any tooling support for the last step since it is pretty heavily dependent on the Linux system you are running on.
If containers or VMs are an option, that would of course open up a lot of possibilities using NixOS tools as well.
After some thought I was considering setting up a container using NixOS and using nix run to run the image or simply building a NixOS container image with NFS setup using nix build and running. Does this seem like an idiomatic way to do things within the nix ecosystem?
Now the question is, do I build a nixos container with docker or use nix to build a OCI image that runs the configured application?