diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dff0666..8c9456b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,8 +18,11 @@ jobs: extra-substituters = https://cache.iog.io https://purescript-lua.cachix.org extra-trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= purescript-lua.cachix.org-1:yLs4ei2HtnuPtzLekOrW3xdfm95+Etw15gwgyIGTayA= + - name: Build + run: nix develop -c ./scripts/build + - name: Test - run: nix develop -c ./scripts/test + run: if [ -f scripts/test ]; then nix develop -c ./scripts/test; fi - name: Luacheck run: nix develop -c luacheck --quiet --std min src/ diff --git a/flake.lock b/flake.lock index b1b25c5..b86363e 100644 --- a/flake.lock +++ b/flake.lock @@ -84,35 +84,35 @@ "type": "github" } }, - "easyps": { + "flake-compat": { "flake": false, "locked": { - "lastModified": 1763814099, - "narHash": "sha256-YazeA9u0JdxykexV6HHG5DMtsnwqXoiAcWPjncO1XHM=", - "owner": "justinwoo", - "repo": "easy-purescript-nix", - "rev": "8fcd84f54d75d9007b2f1c7c9da5af843105a55f", + "lastModified": 1672831974, + "narHash": "sha256-z9k3MfslLjWQfnjBtEtJZdq3H7kyi2kQtUThfTgdRk0=", + "owner": "input-output-hk", + "repo": "flake-compat", + "rev": "45f2638735f8cdc40fe302742b79f248d23eb368", "type": "github" }, "original": { - "owner": "justinwoo", - "repo": "easy-purescript-nix", + "owner": "input-output-hk", + "ref": "hkm/gitlab-fix", + "repo": "flake-compat", "type": "github" } }, - "flake-compat": { + "flake-compat_2": { "flake": false, "locked": { - "lastModified": 1672831974, - "narHash": "sha256-z9k3MfslLjWQfnjBtEtJZdq3H7kyi2kQtUThfTgdRk0=", - "owner": "input-output-hk", + "lastModified": 1765121682, + "narHash": "sha256-4VBOP18BFeiPkyhy9o4ssBNQEvfvv1kXkasAYd0+rrA=", + "owner": "edolstra", "repo": "flake-compat", - "rev": "45f2638735f8cdc40fe302742b79f248d23eb368", + "rev": "65f23138d8d09a92e30f1e5c87611b23ef451bf3", "type": "github" }, "original": { - "owner": "input-output-hk", - "ref": "hkm/gitlab-fix", + "owner": "edolstra", "repo": "flake-compat", "type": "github" } @@ -547,11 +547,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1775888245, - "narHash": "sha256-nwASzrRDD1JBEu/o8ekKYEXm/oJW6EMCzCRdrwcLe90=", + "lastModified": 1781074563, + "narHash": "sha256-md8WlXOlfnIeHeOScMTTHFyf2d6iaTwPl2apR5EQ3P4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "13043924aaa7375ce482ebe2494338e058282925", + "rev": "9ae611a455b90cf061d8f332b977e387bda8e1ca", "type": "github" }, "original": { @@ -701,11 +701,11 @@ ] }, "locked": { - "lastModified": 1781335909, - "narHash": "sha256-gg1K5vcNPYJWWyQz8f/fOxf/8UJG6rJnj2ofQ18tZqQ=", + "lastModified": 1781384923, + "narHash": "sha256-kuIl9DhbuynGMAQzATU2KnL0Pa5OUVIlYCR1xKOtoP0=", "owner": "Unisay", "repo": "purescript-lua", - "rev": "be5956742c67a6a35ab59dbbacafc3eaf5d2fc8c", + "rev": "6fdc70c6e16c5e1f9fc3a6bdbd2838f2cff0122c", "type": "github" }, "original": { @@ -714,12 +714,33 @@ "type": "github" } }, + "purescript-overlay": { + "inputs": { + "flake-compat": "flake-compat_2", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1780972251, + "narHash": "sha256-PwHYPpfLP+WjSwj765zJ1N0Xp4ET3+8vRqxJ031ua3M=", + "owner": "thomashoneyman", + "repo": "purescript-overlay", + "rev": "1cf88ab9d83596db0e0c0d304a16809c410e2917", + "type": "github" + }, + "original": { + "owner": "thomashoneyman", + "repo": "purescript-overlay", + "type": "github" + } + }, "root": { "inputs": { - "easyps": "easyps", "flake-utils": "flake-utils", "nixpkgs": "nixpkgs", - "pslua": "pslua" + "pslua": "pslua", + "purescript-overlay": "purescript-overlay" } }, "stackage": { diff --git a/flake.nix b/flake.nix index f813607..e76ce41 100644 --- a/flake.nix +++ b/flake.nix @@ -4,33 +4,45 @@ inputs = { flake-utils.url = "github:numtide/flake-utils"; nixpkgs.url = "nixpkgs/nixos-unstable"; - easyps = { - url = "github:justinwoo/easy-purescript-nix"; - flake = false; + purescript-overlay = { + url = "github:thomashoneyman/purescript-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; }; pslua.url = "github:Unisay/purescript-lua"; }; - outputs = { self, nixpkgs, flake-utils, easyps, pslua }: + outputs = { self, nixpkgs, flake-utils, purescript-overlay, pslua }: flake-utils.lib.eachDefaultSystem (system: let - p = nixpkgs.legacyPackages.${system}; - e = import easyps { pkgs = p; }; - l = p.lua51Packages; + pkgs = import nixpkgs { + inherit system; + overlays = [ purescript-overlay.overlays.default ]; + }; in { - devShell = p.mkShell { - buildInputs = [ - p.dhall - l.lua - l.luacheck - p.luaformatter - p.nixfmt - pslua.packages.${system}.default - e.purs-0_15_15 - e.spago - p.treefmt - ]; + devShell = pkgs.mkShell { + buildInputs = with pkgs; [ + dhall + lua51Packages.lua + lua51Packages.luacheck + luaformatter + nixfmt-rfc-style + pslua.packages.${system}.default + purs-bin.purs-0_15_16 + spago-bin.spago-0_21_0 + treefmt + ]; }; }); -} + # --- Flake Local Nix Configuration ---------------------------- + nixConfig = { + extra-substituters = [ + "https://cache.iog.io" + "https://purescript-lua.cachix.org" + ]; + extra-trusted-public-keys = [ + "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" + "purescript-lua.cachix.org-1:yLs4ei2HtnuPtzLekOrW3xdfm95+Etw15gwgyIGTayA=" + ]; + }; +} diff --git a/scripts/build b/scripts/build index 2520d0d..1f80243 100755 --- a/scripts/build +++ b/scripts/build @@ -1,4 +1,5 @@ #!/usr/bin/env bash +set -euo pipefail echo "Building..."