first failing test

This commit is contained in:
Daniel Barlow 2023-01-22 14:59:29 +00:00
commit 459b1088c1
3 changed files with 68 additions and 0 deletions

49
default.nix Normal file
View File

@ -0,0 +1,49 @@
{ stdenv
, callPackage
, fennel
, fetchFromGitHub
, fetchurl
, lib
, lua53Packages
, lua5_3
}:
let pname = "rover";
lume = let lua = lua5_3; in lua53Packages.buildLuaPackage rec {
pname = "lume";
version = "1";
src = fetchFromGitHub {
repo = "lume"; owner = "rxi";
rev = "98847e7812cf28d3d64b289b03fad71dc704547d";
hash = "sha256-/u23EqgjjkU8FV9oXvMNXBkY8JAOJUhJAzXTSibJthU=";
};
buildPhase = ":";
installPhase = ''
mkdir -p "$out/share/lua/${lua.luaversion}"
cp lume.lua "$out/share/lua/${lua.luaversion}"
'';
};
lua = lua5_3.withPackages (ps: with ps; [
lgi
luafilesystem
luaposix
readline
lume
]);
fennel_ = lua.pkgs.fennel;
in stdenv.mkDerivation rec {
inherit pname;
fennel = fennel_;
version = "0.1";
src = lib.sources.cleanSource ./.;
buildInputs = [
lua
fennel
];
nativeBuildInputs = [
lua
];
}

9
rover.fnl Normal file
View File

@ -0,0 +1,9 @@
(local { : view } (require :fennel))
(fn rover [x y direction]
{})
(let [r (rover 0 0 :n)]
(match r
{:x 0 :y 0 :direction :n} true
_ (assert false (view r))))

10
shell.nix Normal file
View File

@ -0,0 +1,10 @@
with import <nixpkgs> {} ;
let p = callPackage ./. {};
in p.overrideAttrs(o: {
nativeBuildInputs = o.nativeBuildInputs ++ (with pkgs; [
socat
overmind
entr
]);
JUST_HACKING = 1;
})