This is my humble flakes-only collection of all and everything needed to set up and maintain all my nixified devices.
neon
) set up with ephemeral root directory using impermanence and btrfsargon
(Oracle Cloud Compute Instance)krypton
(private server)neon
(private laptop)xenon
(Raspberry Pi 3B+)bwpm-FP2CYXKY2V
gamer
on WSL2 with Ubuntu 20.04 (windows dual boot for games and stuff)R2026
pixel7a
See flake.nix for more information like system
.
If any of these systems need to be reinstalled, you can run:
nix run \
--extra-experimental-features "nix-command flakes" \
github:Gerschtli/nix-config#setup
# Install nix via Determinate Nix Installer https://determinate.systems/posts/determinate-nix-installer
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
echo "trusted-users = $USER" | sudo tee -a /etc/nix/nix.conf
sudo launchctl stop org.nixos.nix-daemon
sudo launchctl start org.nixos.nix-daemon
# see and execute files/scripts/darwin-setup.sh
nix run github:Gerschtli/nix-config#setup
nix build ".#installer-image"
configuration.nix
:
{
users.users.root.password = "nixos";
users.users.tobias = {
password = "nixos";
isNormalUser = true;
extraGroups = [ "wheel" ];
};
}
nix build ".#rpi-image"
dd
) result/sd-image/*.img
to sd-cardFirmware of Raspberry Pi needs to be updated manually on a regular basis with the following steps:
nix build ".#rpi-firmware"
/dev/disk/by-label/FIRMWARE
result/*
to firmware partition (ensure that old ones are deleted)# update and install system packages
sudo apt update
sudo apt upgrade
sudo apt install zsh
# install nix setup
sh <(curl -L https://nixos.org/nix/install) --no-channel-add --no-modify-profile
. ~/.nix-profile/etc/profile.d/nix.sh
nix run \
--extra-experimental-features "nix-command flakes" \
github:Gerschtli/nix-config#setup
# download and install UbuntuMono from nerdfonts.com
# set login shell
chsh -s /bin/zsh
# configure inotify watcher
echo "fs.inotify.max_user_watches = 524288" | sudo tee /etc/sysctl.d/local.conf
# set default shell (needed if using home-manager to setup xsession)
sudo ln -snf bash /bin/sh
Create final boot volume
Create bootstrap instance
Create "VM.Standard.A1.Flex"
ssh into instance with ubuntu
user
Login as root
Set ssh public key in /root/.ssh/authorized_keys
and run nixos-infect:
cat /home/ubuntu/.ssh/authorized_keys > /root/.ssh/authorized_keys
curl https://raw.githubusercontent.com/elitak/nixos-infect/master/nixos-infect | NIX_CHANNEL=nixos-22.05 bash -x
ssh into instance with root
user
Add the following to /etc/nixos/configuration.nix
:
{
boot.loader.grub.efiSupport = true;
boot.loader.grub.device = "nodev";
services.openiscsi.enable = true;
services.openiscsi.name = "x";
}
Activate with nixos-rebuild switch
Copy and run ISCSI mount commands from Oracle Cloud WebUI
Partion mounted boot volume
Install NixOS like described in NixOS manual with following options:
{
services.openssh.enable = true;
services.openssh.settings.PermitRootLogin = "yes";
users.users.root.password = "nixos";
users.users.tobias = {
password = "nixos";
isNormalUser = true;
extraGroups = [ "wheel" ];
};
}
Copy and run ISCSI unmount commands from Oracle Cloud WebUI
Detach volume in Oracle Cloud WebUI
Create final instance
tobias
user and passwordNote: This is all needed to be able to partition the volume to have more than 100MB available in /boot
. The boot
volume of the bootstrap instance can be reused at any time.