gabrielgio.me @ 6cd1a496951bc676744413b27cd00b4f2176d64c

  1---
  2title: "Alpine set up for daily driver"
  3date: 2022-12-10
  4tags: ['alpine', 'linux']
  5---
  6
  7## Disable secure boot
  8
  9First, always check for secure book. If it is enabled you won't be able to boot
 10your thumbdrive.
 11
 12## setup-alpine
 13On the official wiki[^1] there a more complete guide on how to setup, and will
 14probably be more accurate than this one, so always refer to that wiki first.
 15This is more a log of how I setup. 
 16
 17Once you boot your live installation run `setup-alpine` and follow the steps:
 18
 19* _Select keyboard layout_: **us**
 20
 21* _Select keyboard variant_: **us**
 22
 23* _Enter system hostname_: **gridx.local** [This is my choice, if you don't know
 24  what exactly is this go for the default **localhost**]
 25
 26* _Which one do you want to initialize?_: **wlan0** [I chose wlan0, since it is
 27  a laptop I don't have it connected to cable]
 28
 29* _Type the wireless network name to connect to_: **\<NAME\>**
 30
 31* _Type network key_: ******
 32
 33* _Ip address for wlan0_? **dhcp** [and for the following device I have chose
 34  none since I won't use them anyways]
 35
 36* _Do you want to do any manual network configuration_? **n** 
 37
 38* _Changing password for root_: ******
 39
 40* _Which timezone are you in?_ **Europe/Berlin**
 41
 42* _HTTP/FTP proxy URL?_ **none**
 43* _Which NTP client to run?_ chrony
 44* _Enter mirro number?_ **f** [I pick this one to speed up things a bit, default
 45  one is fine as well]
 46
 47* _Set an user?_ **\<NAME\>** [Since we aiming to be a desktop create your user here]
 48
 49* _Full name for user \<NAME\>:_ **\<FULLNAME\>**
 50* _Type password_: ******
 51
 52* _Enter ssh key or URL for \<NAME\>?_ **none** [this is a public key so you can
 53  ssh into this machine]
 54
 55* _Which ssh server?_ **openssh**
 56
 57* _Which disks would like to use?_ **\<DISK\>** [now you are going to set up the
 58  disk for installation]
 59
 60* _How would you like to use it?_ **crypt** [I like to use encrypted disks, I
 61  strongly advice for it, but in case you don't want, go for sys directly]
 62
 63* _How would you like to use it?_ **lvm**
 64
 65* _How would you like to use it?_ **sys** [more info[^2]]
 66
 67* _WARNING: Erase the above disks and continue?_ **y**
 68
 69* Enter passphrase for \<DISK\>: ******
 70
 71Once you have finish the step run `reboot`.
 72
 73## Desktop environment
 74
 75Now comes the "hard" part, where we need to configure the desktop. For me, I'm
 76going for i3wm with lightdm.
 77
 78To be able to install all the necessary packages we will need to enable the
 79community repository[^3]. To edit it I use vim
 80
 81```bash
 82apk add vim
 83# then
 84vim /etc/apk/repositories
 85```
 86and uncomment the `.../community`
 87
 88```bash
 89#/media/cdrom/apks
 90http://dl-cdn.alpinelinux.org/alpine/v3.16/main
 91http://dl-cdn.alpinelinux.org/alpine/v3.16/community
 92#http://dl-cdn.alpinelinux.org/alpine/edge/main
 93#http://dl-cdn.alpinelinux.org/alpine/edge/community
 94#http://dl-cdn.alpinelinux.org/alpine/edge/testing
 95```
 96
 97Then run  `apk update` and you will see the both repositories printed out.
 98
 99Now we will install the necessary drivers for `xorg` to run properly. Firs
100search for all  video drivers `apk search xf86-video*` and install whatever you
101have for you computer (in my case `apk add apk add xf86-video-amdgpu`)
102
103Add required mesa drivers:
104
105```bash
106apk add mesa-dri-gallium mesa-va-gallium mesa-egl
107```
108
109Alpine provides a command to install required packages for xorg 
110
111```bash
112setup-xorg-base
113```
114
115Now to set the `lightdm` and its required dbus setup:
116
117```bash
118apk add lightdm-gtk-greeter
119setup-devd udev
120rc-update add dbus boot
121rc-update add lightdm boot
122apk add terminus-font
123dbus-uuidgen > /var/lib/dbus/machine-id
124rc-update add dbus
125```
126
127Now for the i3wm:
128
129```bash
130apk add i3wm i3status xterm i3lock
131add user <NAME> input`
132add user <NAME> video`
133```
134
135## Extras 
136
137There is a list go command that I use that may be helpful:
138
139``` bash
140apk add perl bash fzf           # required for things to work
141apk add fish                    # shell
142apk add zathura-pdf-poppler     # pdf viewer
143apk add ranger                  # file explorer
144apk add alpine-sdk make git go  # some dev tooling
145apk add qutebrowser             # browser
146apk add keepassxc               # password manager
147apk add aerc                    # mail
148```
149
150## Wiki
151
152There is a more complete from the alpine wiki[^4], which will give more context
153to the commands.
154
155[^1]: https://wiki.alpinelinux.org/wiki/Installation#Questions_asked_by_setup-alpine
156[^2]: https://wiki.alpinelinux.org/wiki/Installation#The_general_course_of_action
157[^3]: https://wiki.alpinelinux.org/wiki/Repositories#Enabling_the_community_repository
158[^4]: https://wiki.alpinelinux.org/wiki/Setting_up_a_laptop