feat(nix): add FHS devShell for running Electron on NixOS (#1245)

This commit is contained in:
Liet Blue
2026-03-10 19:32:19 +08:00
committed by GitHub
parent 9c88f83e2b
commit 2b9f5092d8
2 changed files with 60 additions and 1 deletions
+9
View File
@@ -255,6 +255,15 @@ A Nix package for Tamagotchi is included. To run airi with Nix, first make sure
nix run github:moeru-ai/airi
```
#### NixOS
Electron requires shared libraries that aren't in standard paths on NixOS. Use the FHS shell defined in `flake.nix`:
```shell
nix develop .#fhs
pnpm dev:tamagotchi
```
### Stage Pocket (Mobile Version)
Start the development server for the capacitor:
+51 -1
View File
@@ -34,7 +34,12 @@
};
devShells = forAllSystems (
system: with (pkgsForSystem system); {
system:
let
pkgs = pkgsForSystem system;
in
with pkgs;
{
default = mkShell {
inputsFrom = [ self.packages.${system}.airi ];
packages = [
@@ -45,6 +50,51 @@
python314
];
};
# FHS environment for running Electron on NixOS
# Usage: nix develop .#fhs
fhs = (
buildFHSEnv {
name = "airi-electron-fhs";
targetPkgs =
p: with p; [
nodejs_24
pnpm
# Electron system library dependencies
# Note: some packages need explicit output refs because the
# default attribute doesn't point to the output with .so files
glib.out # default 'glib' points to 'bin' output
nss
nspr
dbus.lib # libdbus-1.so.3 is in 'lib' output, not 'out'
atk
at-spi2-atk
at-spi2-core
cups.lib # libcups.so.2 is in 'lib' output, not 'out'
libdrm
xorg.libX11
xorg.libXcomposite
xorg.libXdamage
xorg.libXext
xorg.libXfixes
xorg.libXrandr
xorg.libxcb
xorg.libXcursor
xorg.libXi
xorg.libXtst
expat
libxkbcommon
libgbm # libgbm.so.1 is now a separate package from mesa
alsa-lib
pango.out # default 'pango' points to 'bin' output
cairo
libGL
gtk3
systemd
];
runScript = "bash";
}
).env;
}
);
};