Skip to content

Commit

Permalink
Define tree for pitti's workstation
Browse files Browse the repository at this point in the history
Also add helper script for running the ostree build.
  • Loading branch information
martinpitt committed Nov 11, 2023
1 parent e7fc3db commit 0aae4e3
Show file tree
Hide file tree
Showing 10 changed files with 365 additions and 2 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: build
on:
schedule:
- cron: 0 2 * * 6
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
timeout-minutes: 40
container:
image: docker.io/fedora:latest
# Fix SELinux for the built OSTree: https://github.com/coreos/rpm-ostree/issues/1943
options: --privileged --security-opt label:disable
steps:
- name: Install dependencies
run: dnf install -y rpm-ostree selinux-policy selinux-policy-targeted policycoreutils podman

- name: Clone repository
uses: actions/checkout@v3

- name: Log into container registry
run: podman login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io

- name: Build OSTree and push it to registry
run: ./compose.sh registry
25 changes: 25 additions & 0 deletions 2015-RH-IT-Root-CA.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
-----BEGIN CERTIFICATE-----
MIIENDCCAxygAwIBAgIJANunI0D662cnMA0GCSqGSIb3DQEBCwUAMIGlMQswCQYD
VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2Fyb2xpbmExEDAOBgNVBAcMB1JhbGVp
Z2gxFjAUBgNVBAoMDVJlZCBIYXQsIEluYy4xEzARBgNVBAsMClJlZCBIYXQgSVQx
GzAZBgNVBAMMElJlZCBIYXQgSVQgUm9vdCBDQTEhMB8GCSqGSIb3DQEJARYSaW5m
b3NlY0ByZWRoYXQuY29tMCAXDTE1MDcwNjE3MzgxMVoYDzIwNTUwNjI2MTczODEx
WjCBpTELMAkGA1UEBhMCVVMxFzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRAwDgYD
VQQHDAdSYWxlaWdoMRYwFAYDVQQKDA1SZWQgSGF0LCBJ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DRppYp3taLtiNi
qChV/dbSdc7HqYQOnDglUF5mRiu78uZ9+fl5OgE4PjHVG/exyqi6OQZeujPzBXL7
gZ1WEVt+fV8FWaH/NaEvVu5EFhISI/2dM+y/nuRQ4n2IwauEAWCQ+o6Qdq8TXytp
70A=
-----END CERTIFICATE-----
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
Martin Pitt's desktop
=====================

This is an [rpm-ostree](https://coreos.github.io/rpm-ostree/) based minimal
[Fedora](https://getfedora.org/) developer desktop with the [sway window manager](https://swaywm.org/) and [podman](https://podman.io/)/[toolbox](https://docs.fedoraproject.org/en-US/fedora-silverblue/toolbox/) for doing development and running less common graphical applications.

It gets [automatically built](.github/workflows/build.yml) every week and [published as container image](https://github.com/martinpitt/ostree-pitti-workstation/pkgs/container/workstation-ostree-config), for using with [ostree native containers](https://coreos.github.io/rpm-ostree/container/).

To use it from an existing OSTree based system like [Fedora CoreOS](https://getfedora.org/coreos) or [Fedora Silverblue](https://docs.fedoraproject.org/en-US/fedora-silverblue/), rebase your tree to it:

```sh
sudo rpm-ostree rebase ostree-unverified-registry:ghcr.io/martinpitt/workstation-ostree-config
```

After that, you can install weekly updates with

```
sudo rpm-ostree upgrade
```

If anything goes wrong, you can go back to the previous version with `sudo rpm-ostree rollback`.

Login
-----

There is no graphical login manager. I log in on VT1, and my `.bashrc`
automatically starts the GNOME SSH agent and sway:

```sh
if [ "$(tty)" = "/dev/tty1" ]; then
export `gnome-keyring-daemon --start --components=ssh`
export BROWSER=firefox-wayland
export XDG_CURRENT_DESKTOP=sway
exec sway > $XDG_RUNTIME_DIR/sway.log 2>&1
fi
```

Original README for [workstation-ostree-config](https://pagure.io/workstation-ostree-config)
=============================================
# Manifests for rpm-ostree based Fedora variants

This is the configuration needed to create
Expand Down
21 changes: 21 additions & 0 deletions compose.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh
set -eu
CACHE=/var/cache/ostree
REPO=/var/tmp/repo
# default to storing locally; can also be "registry:" to directly push
SKOPEO_TARGET="${1:-containers-storage}"

mkdir -p $CACHE

if [ ! -d $REPO/objects ]; then
ostree --repo=$REPO init --mode=archive-z2
fi

rpm-ostree compose tree --unified-core --cachedir=$CACHE --repo=$REPO pitti-desktop.yaml
# HACK: networking in GitHub is a bit flaky, retry a few times
for retry in $(seq 3); do
rpm-ostree compose container-encapsulate --repo=$REPO pitti-desktop ${SKOPEO_TARGET}:ghcr.io/martinpitt/workstation-ostree-config:latest && exit 0
[ "$SKOPEO_TARGET" = registry ] || break
sleep 30
done
exit 1
7 changes: 7 additions & 0 deletions fedora-39-updates.repo
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,10 @@ mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f39&
enabled=1
gpgcheck=1
metadata_expire=1d

[fedora-39-updates-testing]
name=Fedora 39 $basearch Updates
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=updates-testing-f39&arch=$basearch
enabled=1
gpgcheck=1
metadata_expire=1d
2 changes: 0 additions & 2 deletions fedora-common-ostree.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ mutate-os-release: "39"
container-cmd:
- /usr/bin/bash

include: fedora-common-ostree-pkgs.yaml

# See https://github.com/coreos/bootupd
# TODO: Disabled until we use use unified-core or native container flow
# for the main build
Expand Down
139 changes: 139 additions & 0 deletions pitti-desktop.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
include: fedora-common-ostree.yaml

ref: pitti-desktop
rojig:
name: pitti-desktop
summary: "Pitti Desktop"
license: MIT

repos:
- fedora-39
- fedora-39-updates
- fedora-39-updates-testing
- rpmfusion-free
- rpmfusion-free-updates

packages:
# hardware/drivers
- kernel
- kernel-modules-extra
- iwl6000g2a-firmware
- iwl7260-firmware
- alsa-sof-firmware
- NetworkManager-wifi
- NetworkManager-openvpn-gnome
- powertop
- wpa_supplicant
# basic system
- acl
- attr
- basesystem
- cryptsetup
- dnsmasq
- fedora-workstation-backgrounds
- filesystem
- glibc-langpack-de
- glibc-langpack-en
- hostname
- iproute
- kbd
- nss-altfiles
- pciutils
# don't care, but rpm-ostree build fails otherwise
- selinux-policy-targeted
- sudo
- usbutils
# shell tools and development
- bash-completion
- bc
- bzip2
- cockpit-system
- cockpit-ws
# authenticate to gmail
- cyrus-sasl-plain
- fpaste
- git
- gnupg2
- isync
- krb5-workstation
- lsof
- man-db
- mtr
- mutt
- neovim
- nmap-ncat
- openssh-server
- openvpn
- restic
- rsync
- strace
- syncthing
- systemd-container
- tree
- w3m
- weechat
- wget

# desktop plumbing/apps
- dejavu-sans-fonts
- dejavu-serif-fonts
- dejavu-sans-mono-fonts
- fontawesome-fonts
- google-noto-emoji-color-fonts

- gvfs-mtp
- pulseaudio-utils
- alsa-plugins-pulseaudio
- gstreamer1-plugins-good
- gstreamer1-plugins-ugly
- gstreamer1-libav
# for wf-recorder
- libavdevice
- xdg-desktop-portal-gtk

- pavucontrol
- pcmanfm
- nm-connection-editor
- eog
- evince
- rhythmbox
- gnome-keyring
- pinentry-gnome3
- mate-polkit
- lxterminal
- gnome-disk-utility
- rofimoji

# sway/wayland desktop
- sway
- swayidle
- swaylock
- kanshi
- mako
- waybar
- slurp
- grim
- xorg-x11-server-Xwayland
- firefox-wayland
- wofi
- brightnessctl
- wl-clipboard

exclude-packages:
# recommended by sway
- alacritty
- brltty
- glibc-all-langpacks
# recommended by gtk3
- tracker
- tracker-miners
# does not work
- xdg-desktop-portal-wlr
# recommended by containers-common-extra
- qemu-user-static

add-files:
- ["2015-RH-IT-Root-CA.pem", "/etc/pki/ca-trust/source/anchors/2015-RH-IT-Root-CA.pem"]
- ["2022-RH-IT-Root-CA.pem", "/etc/pki/ca-trust/source/anchors/2022-RH-IT-Root-CA.pem"]

postprocess-script: pitti-post.sh
51 changes: 51 additions & 0 deletions pitti-post.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/env bash
set -xeuo pipefail

# Enable SysRQ
echo 'kernel.sysrq = 1' > /usr/lib/sysctl.d/90-sysrq.conf

# power saving
echo 'blacklist e1000e' > /usr/lib/modprobe.d/blacklist-local.conf

# NetworkManager config
cat <<EOF > /usr/lib/NetworkManager/conf.d/local.conf
[main]
plugins=
[device]
#wifi.backend=iwd
EOF
#ln -sfn ../iwd.service /usr/lib/systemd/system/multi-user.target.wants/iwd.service

ln -sfn /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf

# set up PAM for systemd-homed
authselect enable-feature with-systemd-homed

# homed is missing a lot of SELinux policy (https://bugzilla.redhat.com/show_bug.cgi?id=1809878)
# "disabled" breaks rpm-ostree (https://bugzilla.redhat.com/show_bug.cgi?id=1882933), so just use permissive
sed -i 's/SELINUX=enforcing/SELINUX=permissive/' /etc/selinux/config

# enable other units
mkdir -p /usr/lib/systemd/system/getty.target.wants
ln -s ../[email protected] /usr/lib/systemd/system/getty.target.wants/[email protected]
ln -s ../systemd-timesyncd.service /usr/lib/systemd/system/sysinit.target.wants/systemd-timesyncd.service
ln -s ../systemd-resolved.service /usr/lib/systemd/system/multi-user.target.wants/systemd-resolved.service
ln -s ../systemd-homed.service /usr/lib/systemd/system/multi-user.target.wants/systemd-homed.service
ln -s ../cockpit.socket /usr/lib/systemd/system/sockets.target.wants/cockpit.socket
ln -s ../sshd.socket /usr/lib/systemd/system/sockets.target.wants/sshd.socket

# disable unwanted services
ln -sfn /dev/null /usr/lib/systemd/user/at-spi-dbus-bus.service

# move OS systemd unit defaults to /usr
cp -a --verbose /etc/systemd/system /etc/systemd/user /usr/lib/systemd/
rm -r /etc/systemd/system /etc/systemd/user

# scanner permissions without scanner packages
echo 'ACTION=="add|change", ENV{DEVTYPE}=="usb_device", ENV{ID_MODEL}=="CanoScan", MODE="666"' > /usr/lib/udev/rules.d/canoscan.rules

# update for Red Hat certificate
ln -s /etc/pki/ca-trust/source/anchors/2015-RH-IT-Root-CA.pem /etc/pki/tls/certs/2015-RH-IT-Root-CA.pem
ln -s /etc/pki/ca-trust/source/anchors/2022-RH-IT-Root-CA.pem /etc/pki/tls/certs/2022-RH-IT-Root-CA.pem
update-ca-trust
18 changes: 18 additions & 0 deletions rpmfusion.repo
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[rpmfusion-free]
name=RPM Fusion for Fedora $releasever - Free
#baseurl=http://download1.rpmfusion.org/free/fedora/releases/$releasever/Everything/$basearch/os/
metalink=https://mirrors.rpmfusion.org/metalink?repo=free-fedora-39&arch=$basearch
enabled=1
metadata_expire=14d
type=rpm-md
gpgcheck=0

[rpmfusion-free-updates]
name=RPM Fusion for Fedora $releasever - Free - Updates
#baseurl=http://download1.rpmfusion.org/free/fedora/updates/$releasever/$basearch/
metalink=https://mirrors.rpmfusion.org/metalink?repo=free-fedora-updates-released-39&arch=$basearch
enabled=1
enabled_metadata=1
type=rpm-md
gpgcheck=0
repo_gpgcheck=0

0 comments on commit 0aae4e3

Please sign in to comment.