Compare commits
No commits in common. "205d5ee584a9df597de13becf35ddff8d8313faa" and "ccb558b5978d46c3b8bcbe45f77a972f0d77259d" have entirely different histories.
205d5ee584
...
ccb558b597
13 changed files with 66 additions and 91 deletions
15
README.md
15
README.md
|
|
@ -1,13 +1,20 @@
|
||||||
> **Migrated to [code.randogoth.com/randogoth/deinonyxus](https://code.randogoth.com/randogoth/deinonyxus)**
|
|
||||||
|
|
||||||
# Deinonyxus [](https://github.com/randogoth/deinonyxus/actions/workflows/build.yml)
|
# Deinonyxus [](https://github.com/randogoth/deinonyxus/actions/workflows/build.yml)
|
||||||
|
|
||||||
*Deinonyxus* is a personal spin of the UBlue Bluefin DX image with the 🍦[Lix](https://lix.systems/) flavored Nix package manager baked in.
|
*Deinonyxus* is a personal spin of the UBlue Bluefin DX image with the 🍦[Lix](https://lix.systems/) flavored Nix package manager baked in and a first-login bootstrap for simple declarative package management using [curator](https://codeberg.org/randogoth/curator).
|
||||||
|
|
||||||
|
The overlay mount approach was directly borrowed from the [Daemonix](https://github.com/DXC-0/daemonix/) Silverblue/Nix image.
|
||||||
|
|
||||||
## What’s inside
|
## What’s inside
|
||||||
- Base: `ghcr.io/ublue-os/bluefin-dx:latest` without Cockpit, Docker, Firefox, VS Code
|
- Base: `ghcr.io/ublue-os/bluefin-dx:latest` without Cockpit, Docker, Firefox, VS Code
|
||||||
|
- Lix: multi-user install baked in with persistence at `/var/home/nix`; `nix-daemon.service` enabled.
|
||||||
|
(D) - First-login bootstrap: installs Lix/nix packages `devbox`, `mc`, and `micro` via `curator`
|
||||||
- System packages added: `syncthing`, `uv`, `vscodium`, `waydroid`;
|
- System packages added: `syncthing`, `uv`, `vscodium`, `waydroid`;
|
||||||
- System flatpaks added: Telegram Desktop, Waterfox browser
|
- System flatpaks added: Telegram Desktop, Zen Browser
|
||||||
|
|
||||||
|
## First login
|
||||||
|
- Triggers for each non-root user on their first session.
|
||||||
|
- Writes state to `~/.local/state/deinonyxus/curator-init.done`; delete it to rerun.
|
||||||
|
- Bootstraps `~/.config/curator/inventory.toml` and runs `curator switch` with the packages set above.
|
||||||
|
|
||||||
## Just Recipes
|
## Just Recipes
|
||||||
- `upgrade-nix`: upgrades to the latest version of Lix via the user profile. Replaces `nix upgrade-nix` which does not work with an immutable lowerdir `/nix/store` folder
|
- `upgrade-nix`: upgrades to the latest version of Lix via the user profile. Replaces `nix upgrade-nix` which does not work with an immutable lowerdir `/nix/store` folder
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ set -euo pipefail
|
||||||
|
|
||||||
rpm_url="https://nix-community.github.io/nix-installers/lix/x86_64/lix-multi-user-2.91.1.rpm"
|
rpm_url="https://nix-community.github.io/nix-installers/lix/x86_64/lix-multi-user-2.91.1.rpm"
|
||||||
|
|
||||||
install -d /usr/share/nix-store /var/lib/nix-store /nix /etc/nix
|
install -d /usr/share/nix-store /var/lib/nix-store /var/cache/nix-store /nix /etc/nix
|
||||||
|
|
||||||
# Avoid systemd calls during RPM %post in the image build environment.
|
# Avoid systemd calls during RPM %post in the image build environment.
|
||||||
export SYSTEMD_OFFLINE=1
|
export SYSTEMD_OFFLINE=1
|
||||||
|
|
@ -40,9 +40,8 @@ ensure_list_value() {
|
||||||
ensure_list_value "substituters" "$lix_cache_url"
|
ensure_list_value "substituters" "$lix_cache_url"
|
||||||
ensure_list_value "trusted-public-keys" "$lix_cache_key"
|
ensure_list_value "trusted-public-keys" "$lix_cache_key"
|
||||||
|
|
||||||
# === SEED STORE FOR FIRST BOOT (copied into /var on boot) ===
|
# === MOVE INITIAL NIX STORE TO LOWERDIR ===
|
||||||
|
|
||||||
if compgen -G "/nix/*" >/dev/null; then
|
if compgen -G "/nix/*" >/dev/null; then
|
||||||
rsync -aH --delete /nix/ /usr/share/nix-store/
|
mv /nix/* /usr/share/nix-store/
|
||||||
rm -rf /nix/*
|
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
1
files/system/etc/modules-load.d/overlay.conf
Normal file
1
files/system/etc/modules-load.d/overlay.conf
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
overlay
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
/nix(/.*)? system_u:object_r:bin_t:s0
|
|
||||||
/var/lib/nix-store(/.*)? system_u:object_r:bin_t:s0
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
[Service]
|
|
||||||
# Run the daemon unconfined to avoid SELinux denials on the Nix store binaries.
|
|
||||||
SELinuxContext=system_u:system_r:unconfined_service_t:s0
|
|
||||||
ExecStart=
|
|
||||||
ExecStart=/usr/bin/nix-daemon-wrapper.sh --daemon
|
|
||||||
13
files/system/usr/bin/mount-nix-overlay.sh
Executable file
13
files/system/usr/bin/mount-nix-overlay.sh
Executable file
|
|
@ -0,0 +1,13 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
mkdir -p /usr/share/nix-store /var/lib/nix-store /var/cache/nix-store /nix
|
||||||
|
|
||||||
|
# Skip if already mounted to avoid errors on reload.
|
||||||
|
if mountpoint -q /nix; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
mount -t overlay overlay \
|
||||||
|
-o lowerdir=/usr/share/nix-store,upperdir=/var/lib/nix-store,workdir=/var/cache/nix-store \
|
||||||
|
/nix
|
||||||
|
|
@ -1,58 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
# Bind-mount /var/lib/nix-store to /nix.
|
|
||||||
# If /var/lib/nix-store is empty, seed it from the baked store in /usr/share/nix-store.
|
|
||||||
|
|
||||||
mkdir -p /usr/share/nix-store /var/lib/nix-store /nix
|
|
||||||
|
|
||||||
copy_seed_store() {
|
|
||||||
if command -v rsync >/dev/null 2>&1; then
|
|
||||||
rsync -aH --delete /usr/share/nix-store/ /var/lib/nix-store/
|
|
||||||
else
|
|
||||||
cp -a /usr/share/nix-store/. /var/lib/nix-store/
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
sync_missing_store() {
|
|
||||||
# Ensure any baked store paths exist in /var without clobbering user additions.
|
|
||||||
if command -v rsync >/dev/null 2>&1; then
|
|
||||||
rsync -aH --ignore-existing /usr/share/nix-store/store/ /var/lib/nix-store/store/
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
ensure_system_profile() {
|
|
||||||
local seed_profile="/usr/share/nix-store/var/nix/profiles/system"
|
|
||||||
local target_profile="/var/lib/nix-store/var/nix/profiles/system"
|
|
||||||
|
|
||||||
mkdir -p /var/lib/nix-store/var/nix/profiles
|
|
||||||
|
|
||||||
if { [ ! -e "$target_profile" ] || [ -L "$target_profile" ] && [ ! -e "$(readlink -f "$target_profile")" ]; } \
|
|
||||||
&& { [ -e "$seed_profile" ] || [ -L "$seed_profile" ]; }; then
|
|
||||||
cp -a "$seed_profile" "$target_profile"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
if ! mountpoint -q /nix; then
|
|
||||||
if [ -z "$(ls -A /var/lib/nix-store 2>/dev/null)" ] && compgen -G "/usr/share/nix-store/*" >/dev/null; then
|
|
||||||
copy_seed_store
|
|
||||||
fi
|
|
||||||
|
|
||||||
ensure_system_profile
|
|
||||||
sync_missing_store
|
|
||||||
|
|
||||||
mount --bind /var/lib/nix-store /nix
|
|
||||||
# Force an executable SELinux context on the bind mount so systemd can exec nix-daemon.
|
|
||||||
# Use a permissive fallback if the label option is rejected.
|
|
||||||
if ! mount -o remount,bind,exec,context=system_u:object_r:bin_t:s0 /nix 2>/dev/null; then
|
|
||||||
mount -o remount,bind,exec /nix
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Ensure daemon paths exist and labels are sane.
|
|
||||||
if command -v systemd-tmpfiles >/dev/null 2>&1; then
|
|
||||||
systemd-tmpfiles --create /usr/lib/tmpfiles.d/nix-daemon.conf
|
|
||||||
fi
|
|
||||||
if command -v restorecon >/dev/null 2>&1; then
|
|
||||||
restorecon -RF /var/lib/nix-store /nix || true
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
exec /nix/var/nix/profiles/system/bin/nix-daemon "$@"
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Bind-mount /var/lib/nix-store to /nix
|
Description=Mount OverlayFS for /nix
|
||||||
DefaultDependencies=no
|
DefaultDependencies=no
|
||||||
After=local-fs.target
|
After=local-fs.target
|
||||||
RequiresMountsFor=/var /var/lib/nix-store
|
Before=systemd-tmpfiles-setup.service nix-daemon.service nix-daemon.socket
|
||||||
Before=nix-daemon.service nix-daemon.socket
|
ConditionPathExists=/usr/bin/mount-nix-overlay.sh
|
||||||
ConditionPathExists=/usr/bin/mount-nix.sh
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=/usr/bin/mount-nix.sh
|
ExecStart=/usr/bin/mount-nix-overlay.sh
|
||||||
|
ExecStartPost=/usr/bin/systemd-tmpfiles --create /usr/lib/tmpfiles.d/nix-daemon.conf
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
/var/home/randogoth/Projects/code/randofin-os/files/system/usr/lib/systemd/user/deinonyxus-curator-init.service
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Install Nix Home Manager and packages on first login
|
||||||
|
ConditionUser=!root
|
||||||
|
ConditionPathExists=!%h/.local/state/deinonyxus/curator-init.done
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/usr/libexec/deinonyxus/curator.sh
|
||||||
|
ExecStartPost=/usr/bin/mkdir -p %h/.local/state/deinonyxus
|
||||||
|
ExecStartPost=/usr/bin/touch %h/.local/state/deinonyxus/curator-init.done
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=default.target
|
||||||
9
files/system/usr/libexec/deinonyxus/curator.sh
Executable file
9
files/system/usr/libexec/deinonyxus/curator.sh
Executable file
|
|
@ -0,0 +1,9 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -oue pipefail
|
||||||
|
|
||||||
|
curator_git="--from git+https://codeberg.org/randogoth/curator/"
|
||||||
|
|
||||||
|
uvx $curator_git curator init
|
||||||
|
uvx $curator_git curator add nix:mc nix:micro nix:devbox
|
||||||
|
uvx $curator_git curator switch
|
||||||
|
uv tool install $curator_git curator
|
||||||
|
|
@ -13,16 +13,6 @@ image-version: latest # latest is also supported if you want new updates ASAP
|
||||||
# you can include multiple instances of the same module
|
# you can include multiple instances of the same module
|
||||||
modules:
|
modules:
|
||||||
|
|
||||||
- type: os-release
|
|
||||||
properties:
|
|
||||||
ID: deinonyxus
|
|
||||||
NAME: Deinonyxus
|
|
||||||
PRETTY_NAME: Deinonyxus (Bluefin DX)
|
|
||||||
DEFAULT_HOSTNAME: deinonyxus
|
|
||||||
HOME_URL: https://codeberg.org/randogoth/deinonyxus
|
|
||||||
SUPPORT_URL: https://codeberg.org/randogoth/deinonyxus/issues
|
|
||||||
BUG_REPORT_URL: https://codeberg.org/randogoth/deinonyxus/issues
|
|
||||||
|
|
||||||
- type: files
|
- type: files
|
||||||
files:
|
files:
|
||||||
- source: system
|
- source: system
|
||||||
|
|
@ -44,14 +34,23 @@ modules:
|
||||||
files:
|
files:
|
||||||
add:
|
add:
|
||||||
- https://repo.vscodium.dev/vscodium.repo
|
- https://repo.vscodium.dev/vscodium.repo
|
||||||
|
- https://openrazer.github.io/hardware:razer.repo
|
||||||
install:
|
install:
|
||||||
packages:
|
packages:
|
||||||
- repo: vscodium
|
- repo: vscodium
|
||||||
packages:
|
packages:
|
||||||
- codium
|
- codium
|
||||||
|
- repo: hardware_razer
|
||||||
|
packages:
|
||||||
|
- openrazer-daemon
|
||||||
|
- python3-openrazer
|
||||||
|
- python3-numpy
|
||||||
|
- python3-setproctitle
|
||||||
|
- python3-daemonize
|
||||||
- syncthing
|
- syncthing
|
||||||
- uv
|
- uv
|
||||||
- waydroid
|
- waydroid
|
||||||
|
- xautomation
|
||||||
remove:
|
remove:
|
||||||
packages:
|
packages:
|
||||||
- android-tools
|
- android-tools
|
||||||
|
|
@ -80,7 +79,7 @@ modules:
|
||||||
scope: system
|
scope: system
|
||||||
# If no repo information is specified, Flathub will be used by default
|
# If no repo information is specified, Flathub will be used by default
|
||||||
install: # system flatpaks we want all users to have and not remove
|
install: # system flatpaks we want all users to have and not remove
|
||||||
- net.waterfox.waterfox
|
- app.zen_browser.zen
|
||||||
- org.telegram.desktop
|
- org.telegram.desktop
|
||||||
remove: # replace default Firefox with Waterfox
|
remove: # replace default Firefox with Waterfox
|
||||||
- org.mozilla.firefox
|
- org.mozilla.firefox
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue