From f76a22ea0bc15d0bd05624ed89f87bb9f55fbaa4 Mon Sep 17 00:00:00 2001 From: nils Date: Mon, 13 Jan 2025 01:09:14 +0100 Subject: [PATCH] Added initial post and graphical sections for gentoo --- .../graphical-session/login-manager.md | 0 .../graphical-session/session-manager.md | 21 +++++++++++ .../graphical-session/window-manager.md | 12 +++++++ .../post-install/ccache.md | 35 +++++++++++++++++++ .../post-install/drivers.md | 5 +++ .../post-install/initsystem.md | 0 .../gentoo-desktop-setup/post-install/swap.md | 0 .../post-install/users.md | 32 +++++++++++++++++ docs/gentoo-desktop-setup/users.md | 0 mkdocs.yml | 8 +++++ 10 files changed, 113 insertions(+) create mode 100644 docs/gentoo-desktop-setup/graphical-session/login-manager.md create mode 100644 docs/gentoo-desktop-setup/graphical-session/session-manager.md create mode 100644 docs/gentoo-desktop-setup/graphical-session/window-manager.md create mode 100644 docs/gentoo-desktop-setup/post-install/ccache.md create mode 100644 docs/gentoo-desktop-setup/post-install/drivers.md create mode 100644 docs/gentoo-desktop-setup/post-install/initsystem.md create mode 100644 docs/gentoo-desktop-setup/post-install/swap.md create mode 100644 docs/gentoo-desktop-setup/post-install/users.md create mode 100644 docs/gentoo-desktop-setup/users.md diff --git a/docs/gentoo-desktop-setup/graphical-session/login-manager.md b/docs/gentoo-desktop-setup/graphical-session/login-manager.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/gentoo-desktop-setup/graphical-session/session-manager.md b/docs/gentoo-desktop-setup/graphical-session/session-manager.md new file mode 100644 index 0000000..dc4e3d4 --- /dev/null +++ b/docs/gentoo-desktop-setup/graphical-session/session-manager.md @@ -0,0 +1,21 @@ +Session management is necessary for tracking and giving rights to certain users. For a functional setup install both `elogind` and `turnstile` and enable their corresponding services. + +``` shell-session +root@host:~# emerge -av elogind turnstile +root@host:~# rc-update add elogind boot +root@host:~# rc-update add turnstiled dbus +``` + +Then configure `pam` to allow them to track the user: + +``` shell title="/etc/pam.d/system-login" +... +session optional pam_elogind.so +session optional pam_turnstile.so +``` + +When a user logs in it should now be able to start a graphical session. This should be done with: + +``` shell-session +user@host:~$ dbus-run-session -- +``` diff --git a/docs/gentoo-desktop-setup/graphical-session/window-manager.md b/docs/gentoo-desktop-setup/graphical-session/window-manager.md new file mode 100644 index 0000000..4c51560 --- /dev/null +++ b/docs/gentoo-desktop-setup/graphical-session/window-manager.md @@ -0,0 +1,12 @@ +River is a wayland tiling window manager which is configured only using its `riverctl` interface. It is rather minimal but still remains functional. River is coded using Zig but this is by default masked on Gentoo so first unmask them: + +``` title="/etc/portage/package.accept_keywords/zig" +dev-lang/zig ~amd64 +app-eselect/eselect-zig ~amd64 +``` + +Then emerge `river` like normal. + +``` shell-session +root@host:~# emerge -av river +``` diff --git a/docs/gentoo-desktop-setup/post-install/ccache.md b/docs/gentoo-desktop-setup/post-install/ccache.md new file mode 100644 index 0000000..520291b --- /dev/null +++ b/docs/gentoo-desktop-setup/post-install/ccache.md @@ -0,0 +1,35 @@ +`ccache` is a program which save compiling cache speeding up recompile's of big software. First install it: + +``` +root@host:~# emerge -av dev-util/ccache +``` + +And create a configuration file for `ccache`. + +``` title="/etc/ccache.conf" +cache_dir = /var/cache/ccache + +max_size = 20G +umask = 002 +hash_dir = false +compiler_check = %compiler% -dumpversion + +compression = true +compression_level = 1 +``` + +Configure `portage` to allow `ccache` for specified packages: + +``` title="/etc/portage/env/enable-ccache.conf" +FEATURES="ccache" +CCACHE_DIR="/var/cache/ccache" +``` + +Then for every package with which you want to use `ccache` add them: + +``` title="/etc/portage/package.env/ccache" +sys-kernel/gentoo-kernel enable-ccache.conf +sys-kernel/firefox enable-ccache.conf +... +``` + diff --git a/docs/gentoo-desktop-setup/post-install/drivers.md b/docs/gentoo-desktop-setup/post-install/drivers.md new file mode 100644 index 0000000..39042b8 --- /dev/null +++ b/docs/gentoo-desktop-setup/post-install/drivers.md @@ -0,0 +1,5 @@ +Video drivers are necessary for a graphical session to function. In Gentoo it is as simple as specifying what video card the system uses using USE flags: + +``` title="/etc/portage/package.use/00video" +*/* VIDEO_CARDS: -* +``` diff --git a/docs/gentoo-desktop-setup/post-install/initsystem.md b/docs/gentoo-desktop-setup/post-install/initsystem.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/gentoo-desktop-setup/post-install/swap.md b/docs/gentoo-desktop-setup/post-install/swap.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/gentoo-desktop-setup/post-install/users.md b/docs/gentoo-desktop-setup/post-install/users.md new file mode 100644 index 0000000..ac7cff5 --- /dev/null +++ b/docs/gentoo-desktop-setup/post-install/users.md @@ -0,0 +1,32 @@ +Adding a user to the system is essential for actually using it as a desktop. It is pretty straight forward: + +``` shell-session +root@host:~# useradd -m -G plugdev,pipewire -s /bin/bash +root@host:~# passwd +... +passwd: password updated successfully +``` + +> The `pipewire` group will not exist yet until the corresponding package is installed. + +The `wheel` group should ideally only be assigned to one singular admin account. The users in the group are allowed to use the `doas` command to gain root privileges. This is necessary for installing packages and changing system files but not for a normal user. + +## Doas + +Installing and configuring `doas` should be done like so. + +``` title="/etc/portage/package.use/doas" +app-admin/doas persist +``` + +> This USE flag is necessary when typing the user's password every few seconds gets to annoying. + +``` shell-session +root@host:~# emerge -av doas +``` + +``` title="/etc/doas.conf" +permit persist :wheel as root +``` + +Now users who are in the `wheel` group are allowed to use the `doas` command to gain root privileges. diff --git a/docs/gentoo-desktop-setup/users.md b/docs/gentoo-desktop-setup/users.md new file mode 100644 index 0000000..e69de29 diff --git a/mkdocs.yml b/mkdocs.yml index c00c22a..46be78e 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -96,6 +96,14 @@ nav: - gentoo-desktop-setup/index.md - 'Provisioning': gentoo-desktop-setup/provisioning.md - 'Installation': gentoo-desktop-setup/installation.md + - 'Post installation': + - 'Firmware and drivers': gentoo-desktop-setup/post-install/drivers.md + - 'Swap': gentoo-desktop-setup/post-install/swap.md + - 'Users': gentoo-desktop-setup/post-install/users.md + - 'Graphical session': + - 'Session manager': gentoo-desktop-setup/graphical-session/session-manager.md + - 'Login manager': gentoo-desktop-setup/graphical-session/login-manager.md + - 'Window manager': gentoo-desktop-setup/graphical-session/window-manager.md - 'Void-desktop setup': - void-desktop-setup/index.md