All Projects β†’ jeaye β†’ Nixos In Place

jeaye / Nixos In Place

Licence: mit
Install NixOS on top of any existing Linux distribution without rebooting

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Nixos In Place

K8s Digitalocean Terraform
Deploy latest Kubernetes cluster on DigitalOcean using Terraform
Stars: ✭ 33 (-91.08%)
Mutual labels:  install, digitalocean
Oauth
πŸ”— OAuth 2.0 implementation for various providers in one place.
Stars: ✭ 336 (-9.19%)
Mutual labels:  digitalocean
Xshok Proxmox
proxmox post installation scripts
Stars: ✭ 260 (-29.73%)
Mutual labels:  install
Morph
NixOS deployment tool
Stars: ✭ 303 (-18.11%)
Mutual labels:  nixos
Cloudscraper
CloudScraper: Tool to enumerate targets in search of cloud resources. S3 Buckets, Azure Blobs, Digital Ocean Storage Space.
Stars: ✭ 276 (-25.41%)
Mutual labels:  digitalocean
Ansible Role Nodejs
Ansible Role - Node.js
Stars: ✭ 322 (-12.97%)
Mutual labels:  install
sail
Deploy WordPress to DigitalOcean with Sail
Stars: ✭ 111 (-70%)
Mutual labels:  digitalocean
Nixos Generators
Collection of image builders [[emailΒ protected]]
Stars: ✭ 355 (-4.05%)
Mutual labels:  nixos
Dotfiles
Sway acid dark
Stars: ✭ 330 (-10.81%)
Mutual labels:  nixos
Nix.dev
An opinionated guide for developers wanting to get things done with Nix.
Stars: ✭ 300 (-18.92%)
Mutual labels:  nixos
Pi Apps
Raspberry Pi App Store for Open Source Projects
Stars: ✭ 277 (-25.14%)
Mutual labels:  install
Dosxvpn
Easily deploy your own personal VPN server with DNS adblocking running on DigitalOcean
Stars: ✭ 284 (-23.24%)
Mutual labels:  digitalocean
Kubernetes Digitalocean Terraform
πŸ“‹ 🌊 🌎 Setup a simple Kubernetes cluster in Digital Ocean using Terraform
Stars: ✭ 324 (-12.43%)
Mutual labels:  digitalocean
Cloudbrute
Awesome cloud enumerator
Stars: ✭ 268 (-27.57%)
Mutual labels:  digitalocean
Ansible Role Apache
Ansible Role - Apache 2.x.
Stars: ✭ 341 (-7.84%)
Mutual labels:  install
ansible-role-ansible
Ansible Role - Ansible
Stars: ✭ 91 (-75.41%)
Mutual labels:  install
Terraform Provider Digitalocean
Terraform DigitalOcean provider
Stars: ✭ 296 (-20%)
Mutual labels:  digitalocean
Inletsctl
The fastest way to create self-hosted exit-servers
Stars: ✭ 314 (-15.14%)
Mutual labels:  digitalocean
Dotfiles
And I say hey, what's going on?
Stars: ✭ 348 (-5.95%)
Mutual labels:  nixos
Devos
NixOS Framework
Stars: ✭ 338 (-8.65%)
Mutual labels:  nixos

nixos-in-place

An all-in-one script for installing NixOS on top of any existing Linux system without using live media. When you reboot, you're in NixOS.

nixos-in-place is known to work on Ubuntu, Debian, CentOS, Fedora, Arch, and Slackware, including x86 and x86_64 variants, with and without LVM, including systems on Digital Ocean droplets and Hetzner Cloud!

How to do it

  1. BACKUP

  2. See the Platform-specifics for your distribution

  3. Run the following (see ./install -h for options)

    $ ./install
    
  4. STOP AND VERIFY, then hit y to confirm

  5. Grab some coffee while NixOS installs

  6. Hit y to reboot into NixOS! (root's password will be 'nixos')

  7. Go through the first section of /etc/nixos/nixos-in-place.nix and remove or change it as you see fit

What you get

A fresh install of NixOS, either minimal or graphical (your choice). Your old system and all your old files still exist and are setup to mount on /old-root. As far as the file system is concerned, NixOS is installed in /old-root/nixos and / is rebound before spinning up the system; everything else in /old-root is fair game to delete.

NixOS installs GRUB2 on top of your existing boot loader. If you'd like to boot into /old-root, you can; you just need to add the GRUB entry, from /old-root/boot/grub, manually in your Nix files.

Platform-specifics

Digital Ocean

DO makes some assumptions about static ips and networking, based on the droplet OS and version you choose. nixos-in-place will work best from a Debian 8 droplet.

To install on a DO droplet, follow the normal steps for your platform, but add the -d flag to ./install (see -h for more info). Once installed, if you clean up /old-root, you must keep /old-root/etc/network around; DO needs it!

The default configuration for NixOS disables SSH, so you'll need to use the DO console, once you've finished the installation, in order to setup which services you'd actually like.

I recommend installing from a tmux session, to avoid SSH timeouts and losing access to your install part-way through. Seriously, use tmux or screen.

Ubuntu 15.10

See LVM.

$ apt-get install -y squashfs-tools git

Debian 8.2

See LVM.

$ apt-get install -y squashfs-tools git

Arch

See tmpfs.

$ pacman -Sy wget squashfs-tools git

CentOS 7

See LVM.

$ yum -y install wget squashfs-tools git

Fedora 23

See LVM and tmpfs.

$ dnf -y install wget squashfs-tools git

Slackware 14.1 (and -current)

Both Slackware 14.1 and -currrent have a bug where /proc/self/mountinfo references a non-existent /dev/root. You'll need to manually create a link to your file system root for GRUB to install properly. Example: ln -s /dev/sda1 /dev/root. For the dependencies, you'll need to go through AUR; use sbopkg or something else.

$ sbopkg squashfs-tools

All platforms

It's recommended that you have 1GB of available RAM for unsquashing the NixOS live media. If you're on a machine with less RAM, such as a VPS with 512MB, you can quickly make a swap file for the install.

$ dd if=/dev/zero of=swap bs=1M count=1024
$ mkswap ./swap
$ chmod 600 ./swap
$ swapon ./swap

To remove it, after the install.

$ swapoff ./swap
$ rm -f ./swap

LVM

Systems may use LVM. In which case, you'll need to specify -g with the proper device for GRUB (likely /dev/sda). If your guessed GRUB device looks like /dev/mapper/xxx and not /dev/xxx then you're likely using LVM.

tmpfs

Systems may put /tmp onto its own tmpfs, so you may get a warning saying there may not be enough space. Double check on your own, with df -h, and feel free to continue.

How it works

In short:

  1. Install into /nixos
  2. Wipe out boot loader with GRUB
  3. Bind /nixos to /
  4. Bind the old / to /old-root

More descriptively, the provided install script will verify your system is sane, allow you to configure some options, and then pull down the latest ISO from NixOS. It them enters Stage 1.

Stage 1

Once we have the NixOS live CD ISO, we mount it locally and modify it. The modifications enable us to imbue the image with a chroot that runs Stage 2. Before we chroot, we bind in a number of the host's devices and files into the chroot environment to ensure that functionality like networking will work.

Stage 2

Once we're in the NixOS live CD chroot, we modify the NixOS configs to convey that it's not a typical setup. After that, we install to /nixos, which is bound to the host's /nixos. NixOS then installs GRUB and we're good to reboot into our new machine!

Testing

The testing suite can be run like so (requires vagrant):

$ ./test/run-all
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].