Created
April 10, 2022 04:54
-
-
Save fersilva16/961914fd3ead50724061c6afdb6a8c6c to your computer and use it in GitHub Desktop.
My NixOS setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo -i | |
loadkeys br-abnt2 | |
setfont ter-v18n | |
ifconfig | |
wpa_supplicant -B -i INTERFACE -c <(wpa_passphrase 'SSID' 'PASS') | |
curl google.com | |
parted /dev/nvme0n1 -- mklabel gpt | |
parted /dev/nvme0n1 -- mkpart ESP fat32 1MiB 1GiB | |
parted /dev/nvme0n1 -- mkpart primary 1GiB 100% | |
parted /dev/nvme0n1 -- set 1 esp on | |
mkfs.fat -F32 -n boot /dev/nvme0n1p1 | |
cryptsetup luksFormat /dev/nvme0n1p2 | |
cryptsetup open /dev/nvme0n1p2 lvm | |
pvcreate /dev/mapper/lvm | |
vgcreate vg /dev/mapper/lvm | |
lvcreate -l 100%FREE -n root vg | |
mkfs.btrfs -L root /dev/vg/root | |
mount /dev/vg/root /mnt | |
btrfs subvolume create /mnt/root | |
btrfs subvolume create /mnt/home | |
btrfs subvolume snapshot -r /mnt/root /mnt/root-blank | |
umount /mnt | |
mount -o subvol=root /dev/disk/by-label/root /mnt | |
mkdir /mnt/{boot,home} | |
mount /dev/disk/by-label/boot /mnt/boot | |
mount -o subvol=home /dev/disk/by-label/root /mnt/home | |
truncate -s 0 /mnt/swapfile | |
chattr +C /mnt/swapfile | |
btrfs property set /mnt/swapfile compression none | |
fallocate -l 18G /mnt/swapfile | |
chmod 600 /mnt/swapfile | |
mkswap /mnt/swapfile | |
swapon /mnt/swapfile | |
nix-shell -p nixUnstable | |
sudo nixos-install --root /mnt --flake github:fersilva16/nix-config#g3 --no-write-lock-file | |
nixos-enter | |
nix-shell -p nixUnstable git | |
nixos-install --root / |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment