Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexandergrooff/nixos-config
https://github.com/alexandergrooff/nixos-config
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/alexandergrooff/nixos-config
- Owner: AlexanderGrooff
- Created: 2024-03-03T14:03:27.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-09-13T06:58:39.000Z (4 months ago)
- Last Synced: 2024-10-16T22:24:01.029Z (3 months ago)
- Language: Nix
- Size: 80.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NixOS configs
Setting up a machine from ISO:
```bash
export HOSTNAME_TO_INSTALL=blabla# GPT
parted /dev/sda -- mklabel gpt
parted /dev/sda -- mkpart root btrfs 512MB 100%
parted /dev/sda -- mkpart ESP fat32 1MB 512MB
parted /dev/sda -- set 2 esp on
mkfs.btrfs -L nixos /dev/sda1
mkfs.fat -F 32 -n boot /dev/sda2# MBR
parted /dev/sda -- mklabel msdos
parted /dev/sda -- mkpart primary 1MB 100%
mkfs.btrfs -L nixos /dev/sda1# All cases
mount /dev/disk/by-label/nixos /mnt
btrfs subvolume create /mnt/@{root,home,nix,log}
umount /mnt
mount -o subvol=@root /dev/disk/by-label/nixos /mnt# GPT
mkdir -p /mnt/boot
mount /dev/disk/by-label/boot /mnt/boot# All cases from here
mkdir -p /mnt/{etc,home,nix,var/log}
mount -o subvol=@home /dev/disk/by-label/nixos /mnt/home
mount -o subvol=@nix /dev/disk/by-label/nixos /mnt/nix
mount -o subvol=@log /dev/disk/by-label/nixos /mnt/var/log
nixos-generate-config --root /mntmv /mnt/etc/nixos{,.old}
nix-shell -p gitgit clone https://github.com/AlexanderGrooff/nixos-config.git /mnt/etc/nixos
exit# CHOOSE GPT/MBR
cp -ra /mnt/etc/nixos/hosts/templates/mbr /mnt/etc/nixos/hosts/$HOSTNAME_TO_INSTALL
sed -i "s/CHANGEME/$HOSTNAME_TO_INSTALL/g" /mnt/etc/nixos/hosts/$HOSTNAME_TO_INSTALL/hostname.nix
cp /mnt/etc/nixos.old/hardware-configuration.nix /mnt/etc/nixos/hosts/$HOSTNAME_TO_INSTALL/hardware-configuration.nix# Typically copy from vm2 and change hostname
vim /mnt/etc/nixos/flake.nixcd /mnt/etc/nixos
nix-shell -p gitgit add .
nixos-install --flake "/mnt/etc/nixos#$HOSTNAME_TO_INSTALL"
exitreboot
```