-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Notes about the buildFHSUserEnv #1
Comments
Broken, nix \
shell \
--impure \
--expr \
'(
with builtins.getFlake "nixpkgs";
with legacyPackages.${builtins.currentSystem};
(
let fhs = pkgs.buildFHSUserEnv {
name = "fenv";
targetPkgs = pkgs: with (builtins.getFlake "nixpkgs");
[
# bashInteractive
# coreutils
hello
];
multiPkgs = pkgs: with (builtins.getFlake "nixpkgs");
[
zlib
];
runScript = "bash";
};
in pkgs.stdenv.mkDerivation {
name = "android-env-shell";
nativeBuildInputs = [ fhs ];
unpackPhase = ":";
installPhase = "mkdir $out";
phases = [ "unpackPhase" "installPhase" ];
shellHook = "exec fenv";
}
)
)' TODO: { buildFHSUserEnv
, writeShellScriptBin
, ... }:
let
fhs = buildFHSUserEnv {
name = "appimage-env";
# Most of the packages were taken from the Steam chroot
targetPkgs = pkgs: with pkgs; [
gtk3
bashInteractive
gnome.zenity
python2
xorg.xrandr
which
perl
xdg-utils
iana-etc
krb5
gsettings-desktop-schemas
hicolor-icon-theme # dont show a gtk warning about hicolor not being installed
];
# list of libraries expected in an appimage environment:
# https://github.com/AppImage/pkg2appimage/blob/master/excludelist
multiPkgs = pkgs: with pkgs; [
# extra
fuse
fuse3
(writeShellScriptBin "sudo" "true") # suid wrappers messing with suff
pulseaudio
desktop-file-utils
xorg.libXcomposite
xorg.libXtst
xorg.libXrandr
xorg.libXext
xorg.libX11
xorg.libXfixes
libGL
gst_all_1.gstreamer
gst_all_1.gst-plugins-ugly
gst_all_1.gst-plugins-base
libdrm
xorg.xkeyboardconfig
xorg.libpciaccess
glib
gtk2
bzip2
zlib
gdk-pixbuf
xorg.libXinerama
xorg.libXdamage
xorg.libXcursor
xorg.libXrender
xorg.libXScrnSaver
xorg.libXxf86vm
xorg.libXi
xorg.libSM
xorg.libICE
gnome2.GConf
freetype
(curl.override { gnutlsSupport = true; opensslSupport = false; })
nspr
nss
fontconfig
cairo
pango
expat
dbus
cups
libcap
SDL2
libusb1
udev
dbus-glib
atk
at-spi2-atk
libudev0-shim
xorg.libXt
xorg.libXmu
xorg.libxcb
xorg.xcbutil
xorg.xcbutilwm
xorg.xcbutilimage
xorg.xcbutilkeysyms
xorg.xcbutilrenderutil
libGLU
libuuid
libogg
libvorbis
SDL
SDL2_image
glew110
openssl
libidn
tbb
wayland
mesa
libxkbcommon
flac
freeglut
libjpeg
libpng12
libsamplerate
libmikmod
libtheora
libtiff
pixman
speex
SDL_image
SDL_ttf
SDL_mixer
SDL2_ttf
SDL2_mixer
libappindicator-gtk2
libcaca
libcanberra
libgcrypt
libvpx
librsvg
xorg.libXft
libvdpau
alsa-lib
harfbuzz
e2fsprogs
libgpg-error
keyutils.lib
libjack2
fribidi
p11-kit
gmp
# libraries not on the upstream include list, but nevertheless expected
# by at least one appimage
libtool.lib # for Synfigstudio
xorg.libxshmfence # for apple-music-electron
at-spi2-core
];
runScript = ''
PATH=$(echo "$PATH" | sed 's;/run/wrappers/bin:;;g')
"$@"
'';
};
in writeShellScriptBin "appimage-wrap" ''
PATH=$PATH:${fhs}/bin
APPIMAGE="$1";shift
ENV_NAME="$(basename "$APPIMAGE")"
ENVDIR="/tmp/appimage-wrap/$ENV_NAME"
mkdir -p "$ENVDIR"
if [ -z "$(ls -A $ENVDIR)" ]; then
echo "Mounting appimage"
sudo mount "$APPIMAGE" "$ENVDIR" -o "offset=$(appimage-env "$APPIMAGE" --appimage-offset | head -n 1)"
fi
appimage-env "$ENVDIR/AppRun" "$@"
'' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Some notes
Here I am summarizing some stuff that I found about
buildFHSUserEnv
and related stuff.TODOs:
https://github.com/NixOS/nix/issues/1569
Cool:
Refs. :
TODO:
https://unix.stackexchange.com/questions/522822/different-methods-to-run-a-non-nixos-executable-on-nixos
Many insteresting results found in https://gist.github.com/search?p=8&q=buildFHSUserEnv, a lot of things to study:
Really cool: fhs-nix-study
https://github.com/NixOS/nixpkgs/blob/87b215d5f72cd51ea2b649e452c107c9e14f4abf/pkgs/applications/editors/android-studio/common.nix#L104-L106
TODO: make a minimal example of this:
TODOs:
podman \ run \ --interactive=true \ --tty=true \ --rm=true \ --name=tmpfs01 \ fedora:34 \ bash \ -c \ 'df -h'
TODO:
/tmp
podman \ run \ --interactive=true \ --tty=true \ --rm=true \ --name=tmpfs01 \ --mount type=tmpfs,tmpfs-size=512M,destination=/tmp \ fedora:34 \ bash \ -c \ 'df -h' Filesystem Size Used Avail Use% Mounted on fuse-overlayfs 64G 5.6G 59G 9% / tmpfs 512M 0 512M 0% /tmp tmpfs 64M 0 64M 0% /dev tmpfs 1.5G 60K 1.5G 1% /etc/hosts shm 63M 0 63M 0% /dev/shm cgroup 1.0M 0 1.0M 0% /sys/fs/cgroup udev 7.4G 0 7.4G 0% /dev/tty
TODO:
The text was updated successfully, but these errors were encountered: