Skip to content

Instantly share code, notes, and snippets.

@idrisr
Created June 24, 2023 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save idrisr/3afaa4aed05bbb9ba8d0490d19e30f0f to your computer and use it in GitHub Desktop.
Save idrisr/3afaa4aed05bbb9ba8d0490d19e30f0f to your computer and use it in GitHub Desktop.
{
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 {
name = "gameoflife";
src = fetchFromGitHub {
owner = "glitzflitz";
repo = "gameoflife";
rev = "ac17b5987f845f242bc7c9f8f4aea38e8a98f92f";
hash = "sha256-LVYlVwwAWPuKpNcYDmyStlctS/OUa6wIhPXrPzBlp6A=";
};
cargoHash = "sha256-yBoaLqynvYC9ebC0zjd2FmSSd53xzn4ralihtCFubAw=";
installPhase = ''
mkdir -p $out
mv ./gameoflife.bin $out
mv ./run.sh $out
mv ./README.md $out
'';
};
in {
apps.${system}.default = {
program = "${thing}/bin/thing";
type = "app";
};
packages.${system}.default = thing;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment