feat(nix): add FHS devShell for running Electron on NixOS (#1245)
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user