tinyemu/flake.nix

41 lines
971 B
Nix
Raw Permalink Normal View History

# Template: https://nixos-and-flakes.thiscute.world/development/intro
{
description = "TinyEMU Nix Dev Shell (Flake-Based)";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
};
outputs = {nixpkgs, ...}: let
# system should match the system you are running on
system = "x86_64-linux";
in {
devShells."${system}".default = let
pkgs = import nixpkgs {
inherit system;
};
in
pkgs.mkShell {
packages = with pkgs; [
# Compilation
2025-07-22 03:11:56 +10:00
gnumake
emscripten
# C Libraries
SDL # Simple DirectMedia Layer
curl
openssl
];
shell = "${pkgs.bash}/bin/bash";
shellHook = ''
2025-07-22 04:50:53 +10:00
# Ref: https://github.com/NixOS/nixpkgs/issues/139943
export EM_CACHE=$PWD/.emscripten_cache
cp -r ${pkgs.emscripten}/share/emscripten/cache $EM_CACHE
chmod u+rwX -R $EM_CACHE
'';
};
};
2025-07-22 02:58:29 +10:00
}