3 ms·
nix-env isn't meaningfully an escape hatch, since you can still only use it with stuff that's packaged in Nix's peculiar way. Here's an overview of the escape
by pxc 5y ago
nix-env isn't meaningfully an escape hatch, since you can still only use it with stuff that's packaged in Nix's peculiar way.
Here's an overview of the escape hatches that are currently around in NixOS for package management, meaning you can use them to avoid packaging something natively for Nix, or to run pre-built software for other distros or targeting multiple distros:
• flatpak — use flatpak to install stuff just like you would on any other distro: https://nixos.org/manual/nixos/stable/index.html#module-services-flatpak https://nixos.org/manual/nixos/stable/index.html#module-serv...
• FHS user environments — create a usermode chroot that puts Nix packages where naive `./configure; make; make install` programs will expect to see their dependencies
• steam-run — run whatever in the pre-built FHSUserEnv that Nixpkgs uses for Steam: https://nixos.org/manual/nixpkgs/stable/#sec-steam-run https://nixos.org/manual/nixpkgs/stable/#sec-steam-run
• AppImage — launch an AppImage using `appimage-run` or create a quick and dirty Nix package that wrapps an existing AppImage: https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-appimageTools https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-appimageTo...
• Docker — you can run stuff with Docker if ya want: https://search.nixos.org/options?channel=unstable&show=virtualisation.docker.enable&from=0&size=50&sort=relevance&query=docker.enable https://search.nixos.org/options?channel=unstable&show=virtu...
NixOS also includes little escape hatches on the configuration side for every service. Basically every module also has an ‘extraConfig’ type of option, which lets you append to the config file that NixOS generates for the service in its original/raw format.
Otherwise, you're generally looking at setting up a chroot environment. I can think of some ways that NixOS could be a little more generous with escape hatches, but I don't think there's much developer interest in the community.
- mason55 5y ago> Basically every module also has an ‘extraConfig’ type of option This is actually changing so that the additional config can be merged/validated even if it can't be typed https://github.com/NixOS/rfcs/blob/master/rfcs/0042-config-option.md https://github.com/NixOS/rfcs/blob/master/rfcs/0042-config-o...
- pxc 5y agoThis is pretty exciting! In this case, users will retain an 'escape hatch' in the sense that they'll be free to descend from whatever higher-level configuration options a module author wants to offer (which could set multiple settings, or generate settings based on other settings) and use all the configuration primitives offered by the underlying software being configured. We just won't have to manage it as a big, dumb string anymore. :D I suppose this could still be annoying for someone who really just wants to copy/paste, though.