commit f23d3f992e10357efa720ac066dd1d0ddf386df3 Author: mat ess Date: Fri Sep 9 15:44:37 2022 -0400 Initial commit diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dee1460 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.direnv +result \ No newline at end of file diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..7036d5f --- /dev/null +++ b/flake.lock @@ -0,0 +1,48 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1661009076, + "narHash": "sha256-phAE40gctVygRq3G3B6LhvD7u2qdQT21xsz8DdRDYFo=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "850d8a76026127ef02f040fb0dcfdb8b749dd9d9", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1662019588, + "narHash": "sha256-oPEjHKGGVbBXqwwL+UjsveJzghWiWV0n9ogo1X6l4cw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2da64a81275b68fdad38af669afeda43d401e94b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..2ef9ef7 --- /dev/null +++ b/flake.nix @@ -0,0 +1,43 @@ +{ + description = "cellular automata experiments written in lua with löve"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-parts.url = "github:hercules-ci/flake-parts"; + flake-parts.inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = { self, flake-parts, ... }: + flake-parts.lib.mkFlake { inherit self; } { + imports = [ ]; + systems = [ "x86_64-linux" "aarch64-darwin" ]; + perSystem = { config, self', inputs', pkgs, system, ... }: { + devShells.default = pkgs.mkShell { + name = "love"; + packages = + let + love = pkgs.stdenv.mkDerivation { + pname = "love"; + version = "11.4"; + + src = pkgs.fetchzip { + url = "https://github.com/love2d/love/releases/download/11.4/love-11.4-macos.zip"; + sha256 = "sha256-1YZVh0fl1sSpdEk+NR+J2IJ6G0rYXwdEuhBPJjhxx5o="; + }; + + dontBuild = true; + + installPhase = '' + mkdir -p $out/bin + cp -r . $out/love.app + ln -s $out/love.app/Contents/MacOS/love $out/bin/love + ''; + + meta.platforms = pkgs.lib.platforms.darwin; + }; + in + [ love ]; + }; + }; + }; +}