Failed attempt (keeping in the git history incase I want to try again at some point) at adding cross compilation using cross (and thus podman which needed allot of stuff)
parent
9022bd5007
commit
502e0c6185
33
flake.nix
33
flake.nix
|
@ -39,7 +39,31 @@
|
||||||
{
|
{
|
||||||
# Development environment output
|
# Development environment output
|
||||||
devShells = forAllSystems ({ pkgs }: {
|
devShells = forAllSystems ({ pkgs }: {
|
||||||
default = pkgs.mkShell {
|
default = let
|
||||||
|
podmanSetupScript = let
|
||||||
|
registriesConf = pkgs.writeText "registries.conf" ''
|
||||||
|
[registries.search]
|
||||||
|
registries = ['docker.io']
|
||||||
|
[registries.block]
|
||||||
|
registries = []
|
||||||
|
'';
|
||||||
|
in pkgs.writeScript "podman-setup" ''
|
||||||
|
#!${pkgs.runtimeShell}
|
||||||
|
# Dont overwrite customised configuration
|
||||||
|
if ! test -f ~/.config/containers/policy.json; then
|
||||||
|
install -Dm555 ${pkgs.skopeo.src}/default-policy.json ~/.config/containers/policy.json
|
||||||
|
fi
|
||||||
|
if ! test -f ~/.config/containers/registries.conf; then
|
||||||
|
install -Dm555 ${registriesConf} ~/.config/containers/registries.conf
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
|
# Provides a fake "docker" binary mapping to podman
|
||||||
|
dockerCompat = pkgs.runCommandNoCC "docker-podman-compat" {} ''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
ln -s ${pkgs.podman}/bin/podman $out/bin/docker
|
||||||
|
'';
|
||||||
|
in pkgs.mkShell {
|
||||||
# The Nix packages provided in the environment
|
# The Nix packages provided in the environment
|
||||||
packages = (with pkgs; [
|
packages = (with pkgs; [
|
||||||
# Fluff
|
# Fluff
|
||||||
|
@ -66,15 +90,22 @@
|
||||||
# If on wayland
|
# If on wayland
|
||||||
libxkbcommon
|
libxkbcommon
|
||||||
wayland
|
wayland
|
||||||
|
# Cross compilation
|
||||||
|
cargo-cross
|
||||||
|
podman # needed by cargo-cross
|
||||||
# Rust
|
# Rust
|
||||||
|
rustup
|
||||||
rustToolchain
|
rustToolchain
|
||||||
]) ++ pkgs.lib.optionals pkgs.stdenv.isDarwin (with pkgs; [ libiconv ]);
|
]) ++ pkgs.lib.optionals pkgs.stdenv.isDarwin (with pkgs; [ libiconv ]);
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
|
# Required
|
||||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${pkgs.lib.makeLibraryPath [
|
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${pkgs.lib.makeLibraryPath [
|
||||||
pkgs.alsaLib
|
pkgs.alsaLib
|
||||||
pkgs.udev
|
pkgs.udev
|
||||||
pkgs.vulkan-loader
|
pkgs.vulkan-loader
|
||||||
]}"
|
]}"
|
||||||
|
${podmanSetupScript}
|
||||||
|
# Aliases and other fluff/ease of use
|
||||||
alias runIntel="nixVulkanIntel cargo run"
|
alias runIntel="nixVulkanIntel cargo run"
|
||||||
alias runMommyIntel="nixVulkanIntel cargo mommy run"
|
alias runMommyIntel="nixVulkanIntel cargo mommy run"
|
||||||
onefetch
|
onefetch
|
||||||
|
|
Loading…
Reference in New Issue