1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-21 21:21:06 +00:00
nixpkgs/nixos
obadz 3d16af70bf nixos/stage-1: add mechanism which lustrates all impurities from / (#17784)
lustrate /ˈlʌstreɪt/ verb.
  purify by expiatory sacrifice, ceremonial washing, or some other
  ritual action.

- sudo touch /etc/NIXOS_LUSTRATE
  ⇒ on next reboot, during stage 1, everything but /nix and /boot
  is moved to /old-root
- echo "etc/passwd" | sudo tee -a /etc/NIXOS_LUSTRATE
  ⇒ on next reboot, during stage 1, everything but /nix and /boot
  is moved to /old-root; except /etc/passwd is copied back.

Useful for installing NixOS in place on another distro. For instance:

$ nix-env -iE '_: with import <nixpkgs/nixos> { configuration = {}; }; with config.system.build; [ nixos-generate-config manual.manpages ]'
$ sudo mkdir /etc/nixos
$ sudo `which nixos-generate-config`

… edit the configuration files in /etc/nixos using man configuration.nix
  if needed

  maybe add: users.extraUsers.root.initialHashedPassword = "" ?

… Build the entire NixOS system and link it to the system profile:
$ nix-env -p /nix/var/nix/profiles/system -f '<nixpkgs/nixos>' -A system --set

… If you were using a single user install:
$ sudo chown -R 0.0 /nix

… NixOS is about to take over
$ sudo touch /etc/NIXOS
$ sudo touch /etc/NIXOS_LUSTRATE

… Let's keep the configuration files we just created
$ echo etc/nixos | sudo tee -a /etc/NIXOS_LUSTRATE

$ sudo mv -v /boot /boot.bak &&
  sudo /nix/var/nix/profiles/system/bin/switch-to-configuration boot
$ sudo reboot

… NixOS boots, Stage 1 moves all the old distro stuff in /old-root.
2016-08-22 01:15:13 +01:00
..
doc/manual Deprecate --install-grub in favor of --install-bootloader for nixos-rebuild. 2016-08-16 07:51:58 -04:00
lib nixos/lib/make-disk-image: refactor to use nixos-install 2016-08-16 15:31:16 +01:00
maintainers Add AMIs in ap-northeast-2 and ap-south-1 2016-07-12 17:26:25 +02:00
modules nixos/stage-1: add mechanism which lustrates all impurities from / (#17784) 2016-08-22 01:15:13 +01:00
tests nixos/tests/ecryptfs: placate some commands causing many builds failure 2016-08-16 02:47:08 +01:00
COPYING
default.nix nix: Add a "dev" output 2016-04-18 21:13:18 +02:00
README
release-combined.nix nixos tests: add hibernation test to blockers 2016-08-21 17:34:00 +03:00
release-small.nix release-small: drop mysql51, removed in 975d33e6 2016-08-13 09:46:42 +02:00
release.nix netboot: prepare for https://github.com/NixOS/nixos-channel-scripts/issues/6 2016-08-16 17:27:11 +02:00

*** NixOS ***

NixOS is a Linux distribution based on the purely functional package
management system Nix.  More information can be found at
http://nixos.org/nixos and in the manual in doc/manual.