Ubuntu 22.04 migration

Posted on April 9, 2023 | linux yak shaving

Finally I found the gap at work to move my work laptop to ubuntu 22.04.

  • I started with the ubuntu server iso instead of the desktop iso to keep unwanted features out. I had the laptop on ethernet as I was not sure if the wireless driver would be part of the iso.
  • I went with Plasma Desktop/KDE as the window manager instead of my usual xmonad. Webex Teams is to blame.
  • Using Nixpkgs + home-manager along with dotfiles made it very easy to get the user space programs back.

Detours #

sddm #

I installed nixpkgs in daemon mode. This creates a bunch of build users. I was looking for a way to hide the users in SDDM login screen. None of the options in the SDDM config file seemed to take effect. Starting the sddm greeter in test mode seemed to use the configuration correctly.

> sddm-greeter --test-mode

Reading the source did not help much either. Eventually I stumbled upon the solution that sddm configuration files need to be files and not symbolic links to files. I could not figure this out from the source but this restriction makes sense for a component that controls the login screen.

The other irritation was sddm starting with a on-screen keyboard by default. I had to configure the InputMethod option to disable it.

[Users]
HideShells=/sbin/nologin
MaximumUid=20000
MinimumUid=1000

[X11]
EnableHiDPI=true
MinimumVT=7

[General]

# Input method module
InputMethod=

home-manager #

The change in configuration file location and format since 2021 led to a bit of head scratching. The config file location changed from ~/.config/nixpkgs/home.nix to ~/.config/home-manager/home.nix. I also had a mismatch between the nixpkgs channel and the home-manager channel. nixpkgs channel was set to master and I had to use the corresponding home-manager channel. Once the channels matched, the package installation was smooth.

Nix #

I am experimenting using Nix for installing fonts as well. This requires running fc-cache with the installation path as argument.

> nix-env -iA nixpkgs.jetbrains-mono
> fc-cache -v $HOME/.nix-profile/share/fonts/

dmesg #

dmesg not being accessible to normal user was surprise coming from 18.04. Apparently the change was introduced in ubuntu 20.10. I had to set kernel.dmesg_restrict = 0 in /etc/sysctl.d/10-kernel-hardening.conf to allow non-root users access to dmesg.

https://unix.stackexchange.com/questions/390184/dmesg-read-kernel-buffer-failed-permission-denied#390187