Skip to content

Commit 0e4db62

Browse files
Create Install.md
1 parent 163b7db commit 0e4db62

File tree

1 file changed

+187
-0
lines changed

1 file changed

+187
-0
lines changed

Guides/NixOS/Install.md

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
# NixOS Install
2+
3+
Minimal Install ISO
4+
5+
https://nixos.org/download/
6+
7+
Manual:
8+
9+
https://nixos.wiki/wiki/NixOS_Installation_Guide
10+
11+
```
12+
sudo -i
13+
14+
# setting up german keyboard layout
15+
loadkeys de
16+
```
17+
18+
## 1. Network
19+
20+
```
21+
iwconfig
22+
23+
# taking wlp3s0 as wifi interface
24+
25+
iwconfig wlp3s0 up
26+
27+
iwlist wlp3s0 scan | grep ESSID
28+
29+
# wpa supplicant
30+
31+
systemctl start wpa_supplicant
32+
33+
wpa_passphrase ESSID PASSPHRASE > /etc/wpa_supplicant.conf
34+
35+
wpa_supplicant -B -c /etc/wpa_supplicant.conf -i wlp3s0 &
36+
```
37+
38+
may still run in foreground, other TTY session (Ctrl+Alt+Fx)
39+
40+
test
41+
42+
```
43+
ping wikipedia.org
44+
```
45+
46+
## 2. Partitions
47+
48+
## fdisk
49+
50+
```
51+
lsblk
52+
53+
fdisk
54+
55+
# delete partitions
56+
57+
d # delete all of them
58+
59+
# new, EFI for boot
60+
n # start 2048, end +600M
61+
62+
# main
63+
n # start, end default
64+
65+
### change types
66+
67+
# Linux filesystem 20
68+
# EFI boot 1
69+
t
70+
```
71+
72+
## Filesystems
73+
74+
```
75+
lsblk
76+
```
77+
78+
### EFI BOOT
79+
80+
```
81+
mkfs.vfat -F32 /dev/DEVICE1
82+
83+
fatlabel /dev/DEVICE1 NIXBOOT
84+
```
85+
86+
### LUKS
87+
88+
serpent: best but not accelerated, intel processors accelerate AES encryption
89+
90+
```
91+
cryptsetup luksFormat -y -c aes-xts-plain64 -s 512 /dev/DEVICE2
92+
93+
# YES
94+
95+
cryptsetup luksOpen /dev/DEVICE2 luksdev
96+
```
97+
98+
### BTRFS
99+
100+
```
101+
mkfs.btrfs -L NIXROOT /dev/mapper/luksdev
102+
```
103+
104+
### Mount
105+
106+
```
107+
mkdir -p /mnt/boot
108+
109+
mount /dev/mapper/luksdev /mnt
110+
111+
mount /dev/DEVICE1 /mnt/boot
112+
113+
chmod -R 700 /mnt/boot
114+
```
115+
116+
### BTRFS Subvolumes
117+
118+
```
119+
btrfs subvolume create /mnt/root
120+
121+
btrfs subvolume create /mnt/usr
122+
123+
btrfs subvolume create /mnt/etc
124+
125+
btrfs subvolume create /mnt/var
126+
127+
btrfs subvolume create /mnt/var/tmp
128+
129+
chmod 1777 /mnt/var/tmp
130+
131+
btrfs subvolume create /mnt/snapshots
132+
133+
btrfs subvolume create /mnt/home
134+
135+
btrfs subvolume list /mnt
136+
```
137+
138+
### SWAP file
139+
140+
```
141+
dd if=/dev/zero of=/mnt/.swapfile bs=1024 count=4097152 # 4GB size
142+
chmod 600 /mnt/.swapfile
143+
mkswap /mnt/.swapfile
144+
swapon /mnt/.swapfile
145+
```
146+
147+
## 2. Config
148+
149+
Generate a default config
150+
```
151+
nixos-generate-config --root /mnt
152+
```
153+
154+
Edit the config and add the parts from "kde.nix".
155+
156+
```
157+
nano /mnt/etc/nixos/configuration.nix
158+
```
159+
160+
enable bluetooth
161+
162+
```
163+
nano /mnt/etc/nixos/hardware-configuration.nix
164+
```
165+
166+
## 3. Install
167+
168+
Make sure that you set a root password. If you are not asked one, repeat the `nixos-install` command
169+
170+
```
171+
cd /mnt
172+
nixos-install
173+
```
174+
175+
## 4. User Password
176+
177+
The user has no password. Exit to TTY2 (Ctrl+Alt+F2)
178+
179+
Login as root, you should know the root password
180+
181+
```
182+
passwd user
183+
```
184+
185+
## 5. Test the system
186+
187+
See what packages are missing, add them to the packages section

0 commit comments

Comments
 (0)