aboutsummaryrefslogtreecommitdiff
path: root/nixos/os-installation.sh
blob: 9a78372e512581041cfd133b154e7e2f0bc452c8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Check the devices and it's partitions:
lsblk to check

# If under /dev/sdc and mounted:
sudo umount /dev/sdc1

# Put the OS image on the USB stick:
sudo dd if=nixos.iso of=/dev/sdc #


# Derived from https://www.maketecheasier.com/nixos-review/

# First, get an internet connection, either by using an ethernet cable or using =wpa_supplicant=:
# https://wiki.archlinux.org/index.php/WPA_supplicant
wpa_supplicant -B -i wlp2s0 -c <(wpa_passphrase SSID PASSPHRASE)

# Change keyboard to pt_BR layout:
loadkeys br-abnt2

# Format disk:
fdisk /dev/sda

# START Steps within fdisk
d # first, delete all partitions with `d`
o

n
p
1
ENTER
+4G
t
82

n
p
2
ENTER
ENTER

a
2

w
# END Steps within fdisk

mkswap -L swap /dev/sda1
swapon /dev/sda1
mkfs.ext4 -L nixos /dev/sda2
mount /dev/disk/by-label/nixos /mnt
nixos-generate-config --root /mnt

# START Edit NixOS configuration file
vi /mnt/etc/nixos/configuration.nix

# Uncomment:
boot.loader.grub.device = “/dev/sda”
enviroment.systemPackages = with pkgs; [
  wget
  vim
  firefox
  gitAndTools.gitFull
  gitAndTools.git-annex
  gitAndTools.gitRemoteGcrypt
  lsof
  gnupg
  gnupg1
]

# Add:
services = {
  xserver = {
    enable = true;
    desktopManager.gnome3.enable = true;
    displayManager.gdm.enable = true;
  };
};
# END

nixos-install

# OS will prompt for root UNIX password

reboot


C-M-<F1>
  useradd -m andreh
  passwd andreh
  # Setup UNIX password (for andreh)

  sudo vi /etc/sudoers
  # START Add the following line below the `root` line
    andreh      ALL=(ALL) ALL
  # END