Skip to content

Instantly share code, notes, and snippets.

@geekodour
Last active July 18, 2023 22:06
Show Gist options
  • Save geekodour/683be9808893e86091e224c9cc7d9f28 to your computer and use it in GitHub Desktop.
Save geekodour/683be9808893e86091e224c9cc7d9f28 to your computer and use it in GitHub Desktop.
let
pkgs = import <nixpkgs> {};
pyPackages = pkgs.python310Packages;
fhs = pkgs.buildFHSUserEnv {
name = "normalfsshell";
runScript = "bash";
};
in
pkgs.mkShell {
name = "py";
venvDir = "./.venv";
nativeBuildInputs = [ fhs ];
buildInputs = with pyPackages; [ pip venvShellHook ];
postShellHook = ''
# allow pip to install wheels
unset SOURCE_DATE_EPOCH
normalfsshell
'';
}
let
pkgs = import <nixpkgs> {};
pyPackages = pkgs.python310Packages;
in
pkgs.mkShell {
name = "zuckpy";
venvDir = "./.venv";
buildInputs = with pyPackages; [ pip venvShellHook ];
# Now we can execute any commands within the virtual environment.
# This is optional and can be left out to run pip manually.
postShellHook = ''
# allow pip to install wheels
unset SOURCE_DATE_EPOCH
'';
# shellHook = ''
# source .venv/bin/activate
# '';
}
let
pkgs = import <nixpkgs> {};
pyPackages = pkgs.python310Packages;
fhs = pkgs.buildFHSUserEnv {
name = "pyshell";
targetPkgs = pkgs: [ pkgs.glibc ];
runScript = "bash";
};
in
pkgs.mkShell {
name = "zuckpy";
venvDir = "./.venv";
nativeBuildInputs = [ fhs ];
# packages = [ fhs ];
buildInputs = with pyPackages; [ pip venvShellHook ] ++ [ ];
# Now we can execute any commands within the virtual environment.
# This is optional and can be left out to run pip manually.
postShellHook = ''
# allow pip to install wheels
unset SOURCE_DATE_EPOCH
pyshell
'';
}
# (pkgs.buildFHSUserEnv {
# name = "pyshell";
# targetPkgs = pkgs: [ pkgs.glibc pyPackages.pip pyPackages.venvShellHook ];
# runScript = "bash";
# # targetPkgs = pkgs: [ pkgs.glibc ];
# }).env
@geekodour
Copy link
Author

patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" --set-rpath /nix/store/dg8mpqqykmw9c7l0bgzzb5znkymlbfjw-glibc-2.37-8/lib <path_to_exec>

@geekodour
Copy link
Author

geekodour commented Jul 17, 2023

readelf -d
libtree -p
patchelf --print-needed

@geekodour
Copy link
Author

@geekodour
Copy link
Author

@geekodour
Copy link
Author

@geekodour
Copy link
Author

  # pkgs.autoPatchelfHook
  # pkgs.autoreconfHook

@geekodour
Copy link
Author

@geekodour
Copy link
Author

@geekodour
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment