Giter Site home page Giter Site logo

nixos-install-scripts's Introduction

nixos-install-scripts

A collection of one-shot scripts to install NixOS on various server hosters and other hardware.

They are designed to get NixOS onto your machine with minimal effort, usually requiring only a single command and waiting a few minutes.

See the hosters directory for available hosters.

Usage

Each script contains instructions at the top.

You must slighly modify the script, most importantly, to put your login credentials (SSH key) into it.

nixos-install-scripts's People

Contributors

asymmetric avatar bitonic avatar fabaff avatar happysalada avatar nh2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nixos-install-scripts's Issues

hetzner: Tighter regex match for INTERFACE_DEVICE_PATH

I found a case on a Hetzner SX134 server with an addiitonal 10 G network interface that in

INTERFACE_DEVICE_PATH=$(udevadm info -e | grep -Po "(?<=^P: )(.*${RESCUE_INTERFACE})")

we need

-INTERFACE_DEVICE_PATH=$(udevadm info -e | grep -Po "(?<=^P: )(.*${RESCUE_INTERFACE})")
+INTERFACE_DEVICE_PATH=$(udevadm info -e | grep -Po "(?<=^P: )(.*${RESCUE_INTERFACE})$")

Otherwise we can get two maches:

# udevadm info -e | grep -P "(?<=^P: )(.*eth1)"
P: /devices/pci0000:00/0000:00:01.1/0000:01:00.0/net/eth1
P: /devices/pci0000:00/0000:00:01.1/0000:01:00.0/net/eth1/ixgbe-mdio-0000:01:00.0

when in fact we want to match only the first line.

Few problems in the Hetzner dedicated AX41 zfs-uefi-nvme-nixos.sh script:

I've set it up and it's working now, just want to document some problems which came up here for other people:
(This Issue was written on 2023-03-09 (yyyy-mm-dd), might have changed if you're reading this).

  • You don't need Ubuntu installed, but the Rescue System
  • The Rescue System kernel is to new for installing zfs via get: you can use the "zfs" script provided by Hetzner to build it from source
    • just execute zfs in the rescue shell, if zfs isn't installed yet, it'll try to install it.
  • the NIX_PATH has to be set, I set it to the following just above the PATH="$PATH" NIX_PATH="$NIX_PATH" ... line and it just worked:
    • export NIX_PATH=${NIX_PATH:+$NIX_PATH:}$HOME/.nix-defexpr/channels

Dedicated Hetzner install script sometimes gets network interface name wrong (but altname right)

I've just used the Hetzner install script to install on a newly rented server. The network interface name is detected to be enp3s0. However once I reboot into nixos, that is only the altname:

[root@herc:~]# ip address
...
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
...
    altname enp3s0

While the altname works when manually configuring the network with the ip command, it seems to not work in configuration.nix. Once I rename enp4s0 to eno1 in configuration.nix things work at boot.

Dedicated Hetzner config hardcodes ipv4 prefix length

The script to install on dedicated Hetzner assumes a prefix length of 24, or in other words netmask 255.255.255.0:

.

However this is not the case for the server I just rented, where the netmask is 255.255.255.192 -- that is, prefix 26.

I fixed it manually, but we should either:

  1. Adjust the grep invocations to get that info too;
  2. Add a FIXME

I can easily do the latter, if you guys think it's appropriate.

Hetzner Cloud ipv6

after running the install script I am unable to receive any traffic over ipv6.
Is it possible to edit the install script to have the network interfaces correctly configured
or how would I configure them now to get them working?

Which issue is referenced is ovh-dedicated-wipe-and-install-nixos.sh?

ovh-dedicated-wipe-and-install-nixos.sh contains this comment:

# OVH has an issue where on newer kernels, it can take up to 20 minutes
# for the default gateway to not be 'linkdown' when booting. See #812.
# We observed that with the 4.15 kernels so far, including OVH's own
# Ubuntu 18.04.
# Our workaround so far is to use the 4.9 kernel.
boot.kernelPackages = pkgs.linuxPackages_4_9;

I was curious if this was fixed, but didn't see an issue number 812 in this repository. Where can I find this issue?

Thanks for this repo, it's a huge help! I was able to adapt the OVH install script to a different server type and got everything working.

parted 3.3 sets exit code 1 when "unable to inform the kernel of the change"

This is new in the current Hetzner rescue mode, aborting the script due to set -e:

root@rescue ~ # for diskletter in {a..b}; do parted --script --align optimal /dev/sd"$diskletter" -- mklabel gpt mkpart "BIOS-boot-partition-$diskletter" 1MiB 2MiB set 1 bios_grub on mkpart "OS-partition-$diskletter" 2MiB '100%'; done
Error: Partition(s) 2 on /dev/sda have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use.  As a result, the old partition(s) will remain in use.  You should reboot now before making further changes.
Error: Partition(s) 2 on /dev/sdb have been written, but we have been unable to inform the kernel of the change, probably because it/they are in use.  As a result, the old partition(s) will remain in use.  You should reboot now before making further changes.
root@rescue ~ # echo $?
1
root@rescue ~ # parted --version
parted (GNU parted) 3.3

It's likely this:

https://git.savannah.gnu.org/cgit/parted.git/tree/NEWS?h=v3.3#n249

parted now exits nonzero for certain failures already diagnosed as "Error".
For example, before this change, parted would exit successfully in spite of "Error: ...unrecognised disk label" and "Error:... both GPT primary and backup partition tables are corrupted".

We will have to disable set -e for that call, ideally grepping that the error is only the but we have been unable to inform the kernel of the change one.

Hetzner installation failing (zfs-uefi-nvme-nixos.sh script)

Hey 👋 , I'm trying to install NixOS on my dedicated Hetzner box. I was trying the other script but wasn't able to get uefi booting to work. I switched to using this script and had a few questions.

First, I have Ubuntu 20.10 installed on my dedicated server. The script fails on this line:

# Stop all mdadm arrays that the boot may have activated.
mdadm --stop --scan

with the following error:

+ mdadm --stop --scan
mdadm: Cannot get exclusive access to /dev/md2:Perhaps a running process, mounted filesystem or active volume group?
mdadm: Cannot get exclusive access to /dev/md1:Perhaps a running process, mounted filesystem or active volume group?
mdadm: Cannot get exclusive access to /dev/md0:Perhaps a running process, mounted filesystem or active volume group?

I understand those errors are due to the current Ubuntu installation using those drives. Output of lsblk:

NAME        MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
nvme0n1     259:0    0 953.9G  0 disk
├─nvme0n1p1 259:2    0   256M  0 part
├─nvme0n1p2 259:3    0     4G  0 part
│ └─md0       9:0    0     4G  0 raid1 [SWAP]
├─nvme0n1p3 259:4    0   512M  0 part
│ └─md1       9:1    0   511M  0 raid1 /boot
└─nvme0n1p4 259:5    0 949.1G  0 part
  └─md2       9:2    0   949G  0 raid1 /
nvme1n1     259:1    0 953.9G  0 disk
├─nvme1n1p1 259:6    0   256M  0 part  /boot/efi
├─nvme1n1p2 259:7    0     4G  0 part
│ └─md0       9:0    0     4G  0 raid1 [SWAP]
├─nvme1n1p3 259:8    0   512M  0 part
│ └─md1       9:1    0   511M  0 raid1 /boot
└─nvme1n1p4 259:9    0 949.1G  0 part
  └─md2       9:2    0   949G  0 raid1 /

Is there a step I'm missing? Should this script be running with the Hetzner machine booted in Ubuntu? cc @happysalada (thanks for contributing the script btw!)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.