Created
June 24, 2023 21:53
-
-
Save idrisr/36575395f263c1e062185d4d2e5879ae to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
inputs.nixpkgs.url = "nixpkgs"; | |
description = "qemu rust game of life"; | |
outputs = { self, nixpkgs, ... }: | |
let | |
system = "x86_64-linux"; | |
pkgs = import nixpkgs { inherit system; }; | |
thing = with pkgs; | |
stdenv.mkDerivation rec { | |
name = "gameoflife"; | |
src = fetchFromGitHub { | |
owner = "glitzflitz"; | |
repo = "gameoflife"; | |
rev = "ac17b5987f845f242bc7c9f8f4aea38e8a98f92f"; | |
hash = "sha256-LVYlVwwAWPuKpNcYDmyStlctS/OUa6wIhPXrPzBlp6A="; | |
}; | |
cargoHash = "sha256-yBoaLqynvYC9ebC0zjd2FmSSd53xzn4ralihtCFubAw="; | |
nativeBuildInputs = [ makeWrapper qemu ]; | |
PATH = lib.makeBinPath nativeBuildInputs; | |
installPhase = '' | |
mkdir -p $out/bin | |
mv ./gameoflife.bin $out/bin | |
mv ./README.md $out/bin | |
mv ./run.sh $out/bin | |
wrapProgram $out/bin/run.sh \ | |
--prefix PATH : ${lib.makeBinPath nativeBuildInputs} | |
''; | |
}; | |
in { | |
apps.${system}.default = { | |
program = "${thing}/bin/run.sh"; | |
type = "app"; | |
}; | |
packages.${system}.default = thing; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment