54 Commits
Author SHA1 Message Date
Ryan Yin 34e984fb92 fix(nixpak): give QQ an X11 connection for its clipboard
QQ copies through the X11 CLIPBOARD even with a Wayland window; without an X server it exited on copy. QQ now shares XWayland's display trust, like WeChat.

Assisted-by: DeepSeek Harness (claude-opus-5-5)
2026-11-06 18:26:17 +08:00
Ryan Yin 8c2f84404c fix(nixpak): let mpv read the musicfox playback cache
Assisted-by: DeepSeek Harness (deepseek-flash)
2026-11-06 16:19:14 +08:00
ryan4yin | 二花 b726c28c14 feat(nixpak): sandbox Steam and Heroic in ~/Gaming (#520)
* feat(nixpak): sandbox Steam and Heroic in ~/Gaming

idols-ai stops preserving ~/.local/share/Steam, ~/.steam, ~/.config/heroic
and their game data, which must be moved into ~/Gaming before deploying.

Assisted-by: DeepSeek Harness (deepseek-flash)

* refactor(nixpak): replace steam-fix.nu with sandboxed protontricks

Assisted-by: DeepSeek Harness (claude-opus-5-5)

* fix(nixpak): hide host documents and GTK config from game sandboxes

Assisted-by: DeepSeek Harness (claude-opus-5-5)

* docs(ai): locate the Steam library under ~/Gaming

Assisted-by: DeepSeek Harness (claude-opus-5-5)

* fix(umu-game): confine writes to ~/Gaming and keep foreign entries

Assisted-by: DeepSeek Harness (claude-opus-5-5)

* fix(nixpak): keep Steam and Heroic in the application launcher

The wrappers only carried bin/, so neither launcher had a desktop entry
after replacing programs.steam.

Assisted-by: DeepSeek Harness (deepseek-flash)

* fix(nixpak): give the game sandboxes a fontconfig that sees CJK fonts

Steam rendered Chinese as tofu: the FHS layers build their own /etc/fonts,
whose config lists only DejaVu and the XDG font directory, so neither the
host fonts nor the FHS /usr/share/fonts were ever scanned. Point
FONTCONFIG_FILE at a small config that includes /usr/share/fonts, and ship
WenQuanYi Zen Hei and Noto Sans CJK in all three FHS layers.

Assisted-by: DeepSeek Harness (deepseek-flash)

* fix(nixpak): grant the game launchers a StatusNotifier tray icon

Steam and Heroic register a tray icon over D-Bus, and the game sandboxes
granted no StatusNotifierWatcher access, so the desktop shell had nothing
to show for them. Enable desktopIntegration.tray for all three launchers
and teach the policy suites to expect it.

Assisted-by: DeepSeek Harness (deepseek-flash)

* fix(nixpak): drop the duplicate host CJK font and tidy the font overrides

Steam reads the fonts inside its own FHS layer, so the system-wide wqy_zenhei
added for it no longer serves any sandbox. Give gaming-policy its own comment
for FONTCONFIG_FILE instead of leaving it under the compat-tool one, make the
desktop-base value a default, and note the SNI tray grant in the README table.

Assisted-by: DeepSeek Harness (deepseek-flash)
2026-11-06 02:18:33 -06:00
ryan4yin | 二花 08d2ff7578 feat(nixpak): sandbox umu-launcher with ~/Gaming as its home (#519)
* feat(nixpak): sandbox umu-launcher with ~/Games as its home

umu-run, winetricks and bbe leave the host PATH, so umu launchers
generated before this stop working until rewritten with
`umu-install.nu <name> - <launcher> <gameid>`.

Assisted-by: Claude Agent SDK (claude-opus-5-5)

* refactor(nixpak): mount ~/Gaming as the game sandbox home

idols-ai now preserves ~/Gaming instead of ~/Games, so existing games
vanish from the host after deploy until the preserved ~/Games is moved
to ~/Gaming/Games.

Assisted-by: Claude Agent SDK (claude-opus-5-5)

* docs(nixpak): record umu runtime validation

Assisted-by: Claude Agent SDK (claude-opus-5-5)
Assisted-by: DeepSeek Harness (deepseek-flash)
2026-11-05 22:39:48 -06:00
Ryan Yin c796643066 fix(nixpak): let mpv use host /tmp for musicfox IPC
Assisted-by: DeepSeek Harness (deepseek-flash)
2026-11-06 10:36:20 +08:00
Ryan Yin c4a00e507c fix(nixpak): pass the session TZ through to sandboxes
ICU takes the zone name from the /etc/localtime symlink target path. A bind
mount turns it into a plain file, which keeps the TZif data but loses the
path, so the only identifier left is the ambiguous "CST" abbreviation that
ICU reads from the file and maps to America/Chicago.

Export TZ from time.timeZone and pass TZ/TZDIR through the nixpak env
allowlist.

Assisted-by: DeepSeek Harness (deepseek-flash)
2026-11-04 21:38:18 +08:00
ryan4yin | 二花 71fa928254 feat(canokey): sudo, SSH, LUKS and OpenPGP setup for daily use (#516)
Use the CanoKey for daily authentication on idols-ai and shoukei, with
the existing passwords, passphrases and per-host SSH keys as fallback.

- sudo: pam_u2f with a shared origin (pam://ryan4yin) and a Nix-store
  authfile built from myvars.canokeyU2fKeys; the primary key is
  registered and touch-to-sudo works on idols-ai.
- SSH: one resident ed25519-sk key (application=ssh:ryan4yin) exported
  to ~/.ssh/id_ed25519_sk; GitHub tries it before the per-host key.
- shoukei LUKS: fido2-device=auto with token-timeout=10s. Update
  nixos-apple-silicon (linux-asahi 7.2.14), whose initrd adds
  thunderbolt_apple and reset_apple_cio so USB-C comes up before unlock.
- GPG: scdaemon disable-ccid so it uses pcscd.
- docs/security-keys.md: setup, PINs, enrollment, backup key and
  recovery; deduplicate the FIDO notes left by #515.

Assisted-by: Claude Code (claude-opus-5-5)
2026-11-04 01:50:21 -06:00
ryan4yin | 二花 2cf3a58028 feat(nixpak): pass FIDO2 keys to Firefox, Chromium and Chrome (#515)
* feat(nixpak): pass FIDO2 keys to Firefox, Chromium and Chrome

Assisted-by: DeepSeek Harness (deepseek-flash)

* feat(nixpak): support FIDO2 hotplug via udev-maintained node directory

Replace launch-time hidraw discovery with host udev rules that hard-link
FIDO-tagged hidraw nodes into /dev/fido-hidraw and remove them on unplug.
The sandbox dev-binds that directory and gets static /dev/hidrawN symlinks
into it, so keys plugged in after launch work and no stale node survives a
reused hidraw minor.

Narrow the extra mounts from whole /sys and /run/udev to /sys/class/hidraw,
/run/udev/data and /run/udev/control; the policy suite now forbids the
broad mounts and checks the wrapper and bind follow the fido2 option.

Assisted-by: Claude Code (claude-opus-5-5)

* refactor(nixpak): rewrite FIDO2 bwrap wrapper in Python

The bash argument loop was hard to follow. Python inserts the /dev/hidrawN
symlinks before "--" with a single list splice, and the header now explains
the whole host-udev -> bind -> symlink chain step by step.

Assisted-by: Claude Code (claude-opus-5-5)

* docs(canokey): document phone-only management policy

PCs only use the CanoKey; CanoKey Console management stays in the phone
app and the Admin PIN is never typed on a PC. Record what the config
enforces (sandboxed browsers get no raw USB/CCID, no vendor WebUSB udev
rule) and what it does not (uaccess on the raw USB node, PC/SC access to
the Admin applet, CTAP management from browsers).

Assisted-by: Claude Code (claude-opus-5-5)

* docs(canokey): separate management from use, link CanoKey docs

Assisted-by: Claude Code (claude-opus-5-5)

* fix(nixpak): create /dev/fido-hidraw from the udev rule

NixOS applies /dev tmpfiles entries only at boot; switch-to-configuration
runs systemd-tmpfiles-resetup with --exclude-prefix=/dev. After a switch
without reboot the directory was missing and every `ln` failed with exit
code 1, so no browser saw the key. The add rule now runs `mkdir -p` first.

Also fix the documented trigger command: `udevadm trigger` defaults to
`change`, which the add-only rule ignores.

Assisted-by: Claude Code (claude-opus-5-5)

* refactor(nixpak): keep tmpfiles as the only creator of /dev/fido-hidraw

The /dev tmpfiles units run before systemd-udevd on every boot, so the
directory always exists before coldplug. The mkdir in the udev rule only
covered the first switch without reboot and duplicated the tmpfiles rule;
drop it and document the one-time `systemd-tmpfiles --prefix` command.

Assisted-by: Claude Code (claude-opus-5-5)

* docs(nixpak): record FIDO2 hardware validation in Firefox and Chrome

After a reboot on ai with the CanoKey present at boot, udev linked only
the FIDO interface and WebAuthn works in Firefox and Chrome. Chromium and
plugging the key in after launch remain pending.

Assisted-by: Claude Code (claude-opus-5-5)
2026-11-04 13:38:32 +08:00
Ryan Yin e4c2548a93 refactor: replace redundant mkForce with plain values and mkDefault
Each of these overrode a value nothing else set at a higher priority:

- qemu-guest: btrbk, hardwareTools and cloud-init have no competing
  definition on the guests.
- mdns: nixpkgs' sunshine module sets avahi.publish.* with mkDefault.
- computer-use: i18n now sets the time zone with mkDefault.
- darwin terminal: the shared ghostty/kitty font sizes are now mkDefault.
- shoukei: sunshine is mkDefault false in remote-desktop.nix, zram's
  memoryPercent is mkDefault 50; supportedFilesystems now merges instead
  of discarding the fsType entries other modules add.
- youko: nothing enables docker.
- nixpak: pasta.enable and sockets.pipewire are mkDefault in the shared
  modules, sockets.pulse already was.

Every NixOS host's toplevel drvPath is unchanged; on fern and frieren the
terminal font sizes and time zone evaluate to the same values.

Assisted-by: Claude Code (claude-opus-5-5)
2026-11-01 10:14:27 -06:00
Ryan Yin 88ff500dfc chore(wechat): use nixpkgs-master now that NixOS/nixpkgs#560225 is merged 2026-11-01 23:34:00 +08:00
ryan4yin | 二花 c277c81cd6 feat(nixpak): sandbox six desktop apps (#497)
* feat(nixpak): sandbox six desktop apps

* chore(nixpak): trim OBS plugin set

* fix(nixpak): enable OBS on aarch64

* fix(nixpak): let imv read the full home directory

* fix(home): drop redundant freerdp package

* fix(nixpak): grant OBS access to V4L2 camera devices

* fix(nixpak): expose V4L2 sysfs to OBS

* fix(nixpak): expose NVIDIA encode library to OBS

* docs(nixpak): record OBS interactive validation

* docs(nixpak): record OBS RTMP validation

* fix(nixpak): run MuseScore via XWayland and PulseAudio

* docs(nixpak): explain app sandboxing rationale

* fix(nixpak): route MuseScore ALSA through PipeWire
2026-11-01 01:24:47 -05:00
Ryan Yin 98d1c2d6e7 fix(nixpak): allow WebKit network portals for slicers 2026-11-01 11:46:58 +08:00
ryan4yin | 二花 c3990cc4be feat(nixpak): sandbox Bambu Studio and OrcaSlicer (#495)
Assisted-by: DeepSeek Harness (deepseek-flash)
2026-11-01 11:43:35 +08:00
ryan4yin | 二花 1a939e2c9a fix(nixpak): use host fontconfig in sandboxes (#496)
Reuse the host fontconfig for Nixpak GUI apps so host and sandboxed apps resolve fonts consistently.

Assisted-by: DeepSeek Harness (deepseek-flash)
2026-11-01 11:26:25 +08:00
ryan4yin | 二花 3e6d89b3c4 feat(nixpak): sandbox Foliate and Krita (#494)
Assisted-by: DeepSeek Harness (deepseek-flash)
2026-11-01 10:34:47 +08:00
ryan4yin | 二花 ccffddc864 feat(wechat): native nixpkgs package with app-scoped data (#492)
Switch to the native deb package from nixpkgs-patched (#560225), remove the AppImage/FHS bwrap layer, and enable native Wayland while keeping the X11 fallback.

Keep only WeChat state under one app-scoped HOME and bind the host Documents and Downloads directories like the other desktop apps. User-selected files also go through the XDG FileChooser portal. Remove the launcher, activation script, and compatibility symlinks.

Assisted-by: DeepSeek Harness (deepseek-flash)
2026-11-01 00:09:27 +08:00
ryan4yin | 二花 818965a11f feat(nixpak): unify desktop app sandboxes (#491)
* refactor(nixpak): unify desktop app sandboxes

Move common GUI, portal, and network policy into reusable modules and migrate browsers plus Zoom/WeChat/QQ/Telegram to the same boundary.

Assisted-by: DeepSeek Harness (deepseek-flash)
2026-10-31 22:27:58 +08:00
ryan4yin | 二花 707da35996 feat(nixpak): clear env, drop system bus, isolate network (#490)
* fix(nixpak): stop exposing the system D-Bus to apps
* fix(nixpak): bind only the PulseAudio socket
* feat(nixpak): run apps in a new session tied to the launcher
* feat(nixpak): start apps from an allowlisted environment
* feat(nixpak): isolate app networking with pasta
* fix(nixpak): keep Firefox on the host network

Assisted-by: Claude Code (claude-opus-5-5)
2026-10-31 16:39:25 +08:00
ryan4yin | 二花 9c38819517 docs: review and correct comments and documentation (#436) 2026-10-12 10:02:38 +08:00
ryan4yin | 二花 8b37fc0a7d chore: remove dead configuration (#352)
Drop declarations that nothing references, including the incorrect
`attrs.listToAttrs = lib.genAttrs` alias.
2026-10-03 10:09:38 +08:00
ryan4yin | 二花 efb5c08696 Merge pull request #274 from ryan4yin/fix/nixpak-pulse-audio
fix(nixpak): repair sandboxed audio and deduplicate mounts
2026-09-20 09:43:21 +08:00
Ryan Yin 7bd873e414 fix(firefox): share MPRIS artwork, trash and host config paths
The sandbox remaps XDG_DATA_HOME/XDG_CONFIG_HOME, so paths Firefox exposes to
or shares with the host ended up isolated. Bind the MPRIS artwork dir and the
real trash rw, and mimeapps.list, user-dirs.dirs and the shared NSS cert store
ro.

recently-used.xbel stays isolated: GTK writes it atomically, which a
single-file rw bind would break.
2026-09-20 02:11:58 +08:00
Ryan Yin d06543819d fix(nixpak): expose Asahi GPU metadata and quiet D-Bus logs 2026-09-11 14:29:59 +08:00
Ryan Yin 95088c4ff8 fix(nixpaks): route qq via pkgs-master for 3.2.32-2026-08-12 2026-08-18 09:59:45 +08:00
Ryan Yin bb13a43ff9 fix(nixpaks): route qq via pkgs-patched for 3.2.32-2026-07-30 2026-08-16 15:40:11 +08:00
Ryan Yin 21c76cf9cc fix(nixpaks): route qq via nixpkgs-master for 3.2.32-2026-07-30 2026-08-15 20:53:50 +08:00
Ryan Yin 7826934b23 fix(nixpak): allow document portal saves 2026-08-01 09:37:43 +08:00
Ryan Yin 3aadd65a36 fix(telegram): preserve Wayland app ID in nixpak 2026-07-31 17:35:31 +08:00
Ryan Yin af0ef6d154 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs-patched':
    'github:ryan4yin/nixpkgs/d373b16187b32770d99f6ff54a133d9543e68702?narHash=sha256-75W3YfzkkKvpE3/wtHMihlT9kOnQZxWpLoshw1xu0T8%3D' (2026-03-20)
  → 'github:ryan4yin/nixpkgs/4425024452e93ce3d10e11bcd9b47f1dfa78593b?narHash=sha256-pu3loLm4gvcbh8iibeYDGgPHOVFXb8sAKEzJ9AxX5L4%3D' (2026-06-03)

fix: qq
2026-06-03 11:56:48 +08:00
Ryan Yin 6a8e4c24d9 fix: qq 2026-02-20 13:35:57 +08:00
Ryan Yin 94e431abfc fix: error - only one wireless daemon is allowed at the time, speed up wechat download 2026-01-02 22:37:38 +08:00
Ryan Yin 60d1909055 fix: package rename 2025-11-11 11:06:20 +08:00
Ryan Yin de05214ec5 chore: nixpaks - update dbus policies
Signed-off-by: Ryan Yin <xiaoyin_c@qq.com>
2025-11-01 21:26:01 +08:00
Ryan Yin 34fdd92351 feat: comment out nixpkgs-unstable, we use unstable by default (#232)
* feat: comment out nixpkgs-unstable, we use unstable by default

Signed-off-by: Ryan Yin <xiaoyin_c@qq.com>

* fix: typo...

---------

Signed-off-by: Ryan Yin <xiaoyin_c@qq.com>
2025-11-01 07:21:57 -06:00
Ryan Yin 0c2dcc0734 feat: update nixpkgs-patched & nixpaks-common 2025-11-01 20:01:22 +08:00
Ryan Yin 1436c6c069 chore: nixpaks 2025-11-01 16:34:00 +08:00
Ryan Yin 3ac0cea3cc fix: time zone in nixpak 2025-09-26 14:12:42 +08:00
Ryan Yin 9509c15ac3 fix: telegram - for niri to recognize the app ID(WIP) 2025-09-19 23:04:05 +08:00
Ryan Yin 205b1466de feat: nixpak telegram-desktop, move data to flatpak's appDataDir ~/.var 2025-09-19 00:32:10 +08:00
Ryan Yin 8b2b43d28a feat: optimize nixpaks 2025-09-19 00:04:31 +08:00
Ryan Yin e14c197e8f fix: qq with inputmethod 2025-09-01 14:45:32 +08:00
Ryan Yin a1d51ffe0c fix: qq with input method https://patch-diff.githubusercontent.com/raw/NixOS/nixpkgs/pull/439070.patch 2025-09-01 14:28:06 +08:00
Ryan Yin 13bb77108c feat: format via 'ls **/*.nix | each { |it| nixfmt $it.name }' 2025-07-30 12:17:24 +08:00
Ryan Yin 0c7e43a21b feat: add sandboxed wechat (#196) 2025-07-12 16:49:45 +08:00
Ryan Yin 8584c3c98b fix: nixpaks - access gtk/hyprland portals 2025-06-19 00:14:19 +08:00
Ryan Yin 9849923180 refactor: nixpak apps 2025-06-19 00:13:49 +08:00
Ryan Yin 20194262f2 feat: nixpaks - add music/video dirs for firefox & qq 2025-06-19 00:04:58 +08:00
Ryan Yin 8ba75c5128 fix: nixpaks.firefox - browserpass extension 2025-06-19 00:03:39 +08:00
Ryan Yin f5f8b1ecc3 feat(hardening/nixpaks): adjust app's direcotry permission 2025-05-29 12:06:18 +08:00
Ryan Yin ab8fd424d8 feat: add WeChat(UOS) sandboxed
fix: mkdir - persist qq's config
feat: update kernel params for nvidia
2024-11-14 00:00:22 +08:00