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

Impure nixos on other Linux distro #110105

Open
holymonson opened this issue Jan 20, 2021 · 8 comments
Open

Impure nixos on other Linux distro #110105

holymonson opened this issue Jan 20, 2021 · 8 comments

Comments

@holymonson
Copy link
Contributor

I'm using other Linux distro with nixpkgs, and want to switch to NixOS but not entirely. Compare current implements

  • nixpkgs, can only manage userspace packages, not system level services like plasma.
  • nixos, tyrannically controlling the whole OS and everything.
  • nixos with isContainer = true;, boot at stage-2, leave bootloader and mount untouched, but still mess /etc e.g. passwd.

I'm thinking we may split out a stage-3, between container and nixpkgs, to control services only. It should

  • leave hardware or filesystem related untouched.
  • live alone with other distro same as nixpkgs
  • only depends on host's systemd (and kernel)
  • don't mess /etc unless we explicitly make config in configuration.nix

This could benefit in

  • easier to switch to NixOS. Since new user to NixOS is usually an experienced Linux user who are already running their own Linux, it will take much time to deploy a new OS.
  • take advantage of other distro, at least in my view, archlinux's AUR provides more convenience than nixpkgs for many standalone or precompiled packages.
  • easier to deploy to SBS like raspberry pi because they may have specific well tuned system.

I have done some test but before pushing further, I want to ask maintainers' options or plans, in case it should be called off in advance.

@veprbl
Copy link
Member

veprbl commented Jan 20, 2021

Are you aware of https://github.com/nix-community/home-manager ?

@holymonson
Copy link
Contributor Author

Are you aware of https://github.com/nix-community/home-manager ?

Sadly home-manager is to control user specific (non global) packages, while here we still want nixos to control global packages, but just skip those fundamental skeleton to /etc.

@hmenke
Copy link
Member

hmenke commented Jan 20, 2021

@holymonson You can use home-manager to manage /etc, see https://gist.github.com/danbst/eb55f9363c0b9151d65271ae6c20f39b

Otherwise maybe something like https://github.com/svanderburg/nix-processmgmt might fit your needs?

@mjlbach
Copy link
Contributor

mjlbach commented Jan 21, 2021

I would agree it would be nice to have something like nix-darwin for FHS compliant linux systems. I often want to run GUI packages on Fedora (installed via nix, QT packages are especially troublesome) and frequently run into issues where wrappers/paths that are assumed on nixos are absent. Some of this is addressed by nixGL, but a lot of it isn't.

@holymonson
Copy link
Contributor Author

holymonson commented Jan 21, 2021

@hmenke It' not about managing /etc or processes, but staging nixos's operations. For example, here is a configuration

{ config, pkgs, ... }: {
  services.sshd.enable = true;
}

nixos will install openssh and register sshd to enable and start via systemd, this is exactly what I want, neither more nor less.

However, even for the simple configuration above, nixos will run some boot stage implicitly to provide a fundamental Linux, such as to manipulate passwd fstab resolv.conf ssl/certs, which are necessary for pure NixOS in bootstrap. But if we are already running on an impure Linux, those bootstrap stages are redundant and even harmful as they may likely damage to the base Linux.

So here we propose, to add an option to skip those bootstrap stages, let nixos could run on an already bootstraped and prepared Linux, like a bare container.

@holymonson
Copy link
Contributor Author

gentle ping @vcunat @danbst @adisbladis @zowoq @infinisil , since this may be sort of container-related.

@stale
Copy link

stale bot commented Jul 21, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 21, 2021
@hmenke
Copy link
Member

hmenke commented Apr 11, 2023

There is now https://github.com/numtide/system-manager but it's still in a very early stage.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Apr 11, 2023
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

5 participants