Linux (Arch/EndeavourOS) on the ThinkPad X1 Nano Gen 1

@alice.bsky.sh

Intro

I'm obsessed with small and light computers. I'm also a happy Mac user for about a decade and a half now, and I badly wish Apple would make a new 12" MacBook with an M3 chip. That's not likely to happen, so I found a fairly cheap (Β£390; battery at 83%) ThinkPad X1 Nano Gen 1, which is a true featherweight at 907 g/1.99 lbs.

Quick specs: i5-1130G7, 16 GB RAM, 13" 2160x1350 screen, 512 GB SSD (upgradeable M.2 2242).

It's a pretty okay laptop. The screen is bright (450 nits), the keyboard has a shorter travel than most modern ThinkPad keyboards, and this is good. The trackpad is surprisingly decent for a non-Mac under Linux (really bad on Windows). The speakers are terrible. It also gets hot but the fans are fairly quiet. Performance is better than expected, getting 1910 (Single-Core) and 6288 (Multi-Core) under Geekbench 6 when set to Performance, though it should be noted it gets throttled after a while. Will it replace my 14" M1 Pro MBP as my primary laptop? No, but it's useful for all kinds of other things.

It's been a while since I tried any sort of desktop Linux. Since I'm trans I was only allowed to install either Arch or NixOS. I don't have the Nix kind of gender dysphoria so Arch it was.

This post is partly a note to self, but others may benefit from it as well.

Getting started

I'm a Debian girl. If I can, I use that where possible. I've briefly used Arch when playing around with the Steam Deck but that was about that. I naively thought I'd get a simple Live CD for Arch to install but quickly learned Arch is for ricers. Off I went to find some batteries included and settled on EndeavourOS (EOS).

(I also installed Windows 11 on the laptop; that may be for another post)

An aside: Ventoy

The easiest way to play around with different ISOs in 2024 is Ventoy, which is up there on the list of delightful technologies next to Tailscale and a few others. It installs itself into a UEFI partition on a flash drive; afterwards you can simply copy arbitrary ISOs on it, no need to mess around with anything else. It's so pleasant to use, it has nice defaults such as automatically disabling the Secure Boot requirements for Windows 11 and other tweaks.

Anywho, after booting off the EOS Live CDβ€”let's reflect for a moment we're still calling them Live CDsβ€”I set the scaling to 150% and installed it. I used XFS for the main partition, as one should, I read a blog about this that I can't find right now. I installed KDE as my main DE as it's the only one that has any sort of half-decent fractional scaling support and this laptop definitely needs that.

Interlude: dual booting

The best way to dual boot it with Windows 11 is to install that first; when installing, make a larger UEFI boot volume and leave free space for Linux at the end of the partition table. If you did everything right (which I didn't the first time) then dual boot should work with systemd-boot. You should not use grub2 in 2024 unless you like waiting minutes for it to unlock your LUKS-encrypted root partition or compromising on security.

The main setup

We have pacman of course, though it took me a while to get used to its somewhat arcane syntax. EOS also ships with yay, which lets you easily install things from the AUR (Arch User Repository) from which you can install a whole lot of things not found in the official Arch repos.

Let's install a whole lot of things:

sudo pacman -Syu alsa-firmware alsa-utils bfs btop clang cmake core/dbus-daemon-units direnv direnv exa fprintd github-cli htop krdp libfprint llvm perl-file-mimeinfo sof-firmware tree ttf-nerd-fonts-symbols-mono zsh
yay -Syu 1password caprine chafa discord fastfetch flatpak fnm gimp google-chrome irccloud lib32-gnutls mpv mullvad-vpn raindrop rbenv-latest ruby-build signal-desktop-beta slack-desktop spotify sublime-text-4 telegram-desktop transmission-qt wine wine-gecko wine-mono winetricks xfconf 

There, much better. yay is a bit annoying because you'll have to press enter a lot and sometimes choose something other than the default but overall, not too bad.

Now for a bunch of miscellaneous things.

Audio (getting sound working)

It wouldn't be desktop Linux without sound issues now, would it. This laptop ships with two set of speakers and a Realtek ALC287 chipset. After a lot of frustration and googling, the magic command you have to run after each reboot is:

sudo hda-verb /dev/snd/hwC0D0 0x1d SET_PIN_WIDGET_CONTROL 0x0

After this, things mostly work, except muting the speakers when plugging in headphones and vice versa.

Drawing the rest of the owl

Rustup

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Oh-my-zsh (and essential plugins)

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

Dotfiles

Make sure the default OMZ config doesn't nuke the history file!

git clone --bare git@github.com:me/dotfiles.git $HOME/.dotfiles
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
rm .ssh/known_hosts && mv ~/.zsh_history ~/.zsh_history_before && dotfiles checkout

Dropbox

Install with flatpak because the AUR version doesn't work well:

flatpak install flathub com.dropbox.Client

Github

Log in, add our SSH key:

gh auth login

wl-copy

To easily copy things to the clipboard from the CLI.

git clone git@github.com:YaLTeR/wl-clipboard-rs.git
cd wl-clipboard-rs/
cargo install --path .

Swap into a file

sudo fallocate -l16G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo "/swapfile swap swap defaults 0 0" | sudo tee /etc/fstab
sudo swapon --show
free -m

Download Cursor

From cursor.com, distributed, sadly, as an AppImage.

Install WezTerm

From source, the AUR version is old and we want it up-to-date.

git clone --recursive git@github.com:wez/wezterm.git
cd wezterm
cargo build --release

Add it (/target/release/wezterm) to the KDE Application Launcher by right clicking on the Start button -> Edit Applications...

Force Spotify to run under Wayland

Which seems to make it faster too.

Add these lines to ~/.config/spotify-flags.conf:

--enable-features=UseOzonePlatform
--ozone-platform=wayland

Firmware updates

sudo fwupdmgr update

ssh-agent

Create a systemd service at ~/.config/systemd/user/ssh-agent.service:

[Unit]
Description=SSH key agent (User service)

[Service]
Type=simple
Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket
ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK

[Install]
WantedBy=default.target

Then

systemctl --user enable --now ssh-agent
systemctl --user status ssh-agent
alice.bsky.sh
alice πŸ”œ berlin (@__justplaying)

@alice.bsky.sh

πŸ“ london

labelers:
πŸͺ„ @sortinghat.bsky.sh
🌌 @zodiacsigns.bsky.sh

other:
πŸ€– @songofsongsbot.bsky.social
🟩 bsky post heatmap generator: https://bluesky-heatmap.fly.dev
πŸ‘©β€πŸ’» bsky dev discord: https://discord.gg/3srmDsHSZJ
πŸ‘·β€β™€οΈ contributor @graysky.app

Post reaction in Bluesky

*To be shown as a reaction, include article link in the post or add link card

Reactions from everyone (0)