fix: Nemo terminal/keymap/vscode — alacritty default, CH+FR lock, code action

- dconf 00-cinnamon: add org.cinnamon+gnome.desktop.default-applications.terminal
  exec='alacritty' exec-arg='-e' so Nemo right-click → Open in Terminal works
- dconf locks/keyboard: lock input-sources/sources and terminal exec keys so
  csd-keyboard doesn't reset them to defaults on first session start
- build-live-iso.sh: add code-open wrapper script (/usr/local/bin/code-open)
  that finds 'code' in the live user's nix profile; add open-in-vscode
  Nemo action to /usr/share/nemo/actions/
- config/install.conf: add nixpkgs#vscode to NIX_USER_PACKAGES
- packages.live-desktop.list: add setxkbmap (needed by csd-keyboard to
  apply XKB keyboard layout)
This commit is contained in:
mozempk
2026-04-23 08:10:10 +02:00
parent c462bd9d31
commit 941f906e29
3 changed files with 60 additions and 0 deletions

View File

@@ -77,6 +77,7 @@ NIX_USER_PACKAGES=(
"nixpkgs#localsend"
"nixpkgs#google-chrome"
"nixpkgs#mission-center"
"nixpkgs#vscode"
)
# ---------- Cinnamon customization ----------

View File

@@ -105,6 +105,7 @@ font-awesome6
# --- terminal ---
alacritty
setxkbmap
# --- gtk theming deps ---
sassc

View File

@@ -397,12 +397,31 @@ picture-options='zoom'
[org/gnome/desktop/input-sources]
sources=[('xkb', 'ch+fr')]
[org/cinnamon/desktop/default-applications/terminal]
exec='alacritty'
exec-arg='-e'
[org/gnome/desktop/default-applications/terminal]
exec='alacritty'
exec-arg='-e'
[org/cinnamon/desktop/keybindings/custom-keybindings/custom0]
name='Open Terminal'
command='${DEFAULT_TERMINAL:-alacritty}'
binding=['<Primary><Alt>t']
EOF
# dconf lock file — prevents the live user's session from overriding the
# keyboard layout with an empty list on first start.
install -d -m 0755 "$INCLUDE_DIR/etc/dconf/db/local.d/locks"
cat > "$INCLUDE_DIR/etc/dconf/db/local.d/locks/keyboard" <<'EOF'
/org/gnome/desktop/input-sources/sources
/org/cinnamon/desktop/default-applications/terminal/exec
/org/cinnamon/desktop/default-applications/terminal/exec-arg
/org/gnome/desktop/default-applications/terminal/exec
/org/gnome/desktop/default-applications/terminal/exec-arg
EOF
# ── 3e) Copy themes/icons/wallpapers directly into usr/share ────────────
# (dconf compile happens inside the Docker container — see _inner-build-live.sh)
install -d -m 0755 "$INCLUDE_DIR/usr/share/backgrounds/void-installer"
@@ -414,6 +433,45 @@ install -d -m 0755 "$INCLUDE_DIR/usr/share/themes"
install -d -m 0755 "$INCLUDE_DIR/usr/share/icons"
[[ -d "$OVERLAY/icons" ]] && cp -a "$OVERLAY/icons"/. "$INCLUDE_DIR/usr/share/icons/" 2>/dev/null || true
# ── 3e-bis) Nemo actions ─────────────────────────────────────────────────
install -d -m 0755 "$INCLUDE_DIR/usr/share/nemo/actions"
install -d -m 0755 "$INCLUDE_DIR/usr/local/bin"
# Wrapper script: finds 'code' in the live user's nix profile.
# Used by the Nemo action so it doesn't need to know the nix profile path.
cat > "$INCLUDE_DIR/usr/local/bin/code-open" <<'EOF'
#!/bin/sh
# Open VS Code for the given file/folder arguments.
# Looks in the live user's nix profile first, then falls back to PATH.
for d in "/home/live/.nix-profile/bin" /nix/var/nix/profiles/per-user/live/profile/bin \
/usr/local/bin /usr/bin; do
if [ -x "$d/code" ]; then
exec "$d/code" "$@"
fi
done
exec code "$@"
EOF
chmod 0755 "$INCLUDE_DIR/usr/local/bin/code-open"
# Nemo action: Open in VS Code
cat > "$INCLUDE_DIR/usr/share/nemo/actions/open-in-vscode.nemo_action" <<'EOF'
[Nemo Action]
Name=Open in VS _Code
Comment=Open in Visual Studio Code
Exec=/usr/local/bin/code-open %F
Icon-Name=code
Selection=Any
Extensions=any;
Dependencies=/usr/local/bin/code-open;
EOF
# ── 3f) first-login autostart + profile.d for the live user ─────────────
install -d -m 0755 "$INCLUDE_DIR/etc/xdg/autostart"
if [[ -r "$OVERLAY/first-login.sh" ]]; then