From ad12ca0bffd1e55ae9db7253148a4e6cb069b8e1 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Wed, 8 Feb 2023 16:20:24 +0100 Subject: [PATCH] purescript(switcheroo): Initialized repo Signed-off-by: prescientmoon --- purescript/switcheroo/.gitignore | 10 ++++++ purescript/switcheroo/flake.nix | 49 +++++++++++++++++++++++++++++ purescript/switcheroo/src/Main.purs | 9 ++++++ 3 files changed, 68 insertions(+) create mode 100644 purescript/switcheroo/.gitignore create mode 100644 purescript/switcheroo/flake.nix create mode 100644 purescript/switcheroo/src/Main.purs diff --git a/purescript/switcheroo/.gitignore b/purescript/switcheroo/.gitignore new file mode 100644 index 0000000..30efe19 --- /dev/null +++ b/purescript/switcheroo/.gitignore @@ -0,0 +1,10 @@ +/bower_components/ +/node_modules/ +/.pulp-cache/ +/output/ +/generated-docs/ +/.psc-package/ +/.psc* +/.purs* +/.psa* +/.spago diff --git a/purescript/switcheroo/flake.nix b/purescript/switcheroo/flake.nix new file mode 100644 index 0000000..a9ec6f4 --- /dev/null +++ b/purescript/switcheroo/flake.nix @@ -0,0 +1,49 @@ +{ inputs = + { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + ps-tools.follows = "purs-nix/ps-tools"; + purs-nix.url = "github:purs-nix/purs-nix/ps-0.15"; + utils.url = "github:numtide/flake-utils"; + }; + + outputs = { nixpkgs, utils, ... }@inputs: + utils.lib.eachSystem [ "x86_64-linux" "x86_64-darwin" ] + (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + ps-tools = inputs.ps-tools.legacyPackages.${system}; + purs-nix = inputs.purs-nix { inherit system; }; + + ps = + purs-nix.purs + { dependencies = + with purs-nix.ps-pkgs; + [ console + effect + prelude + ]; + + dir = ./.; + }; + in + { packages.default = ps.bundle {}; + + devShells.default = + pkgs.mkShell + { packages = + with pkgs; + [ entr + nodejs + (ps.command {}) + ps-tools.for-0_15.purescript-language-server + purs-nix.esbuild + purs-nix.purescript + ]; + + shellHook = + '' + alias watch="find src | entr -s 'echo bundling; purs-nix bundle'" + ''; + }; + } + ); +} diff --git a/purescript/switcheroo/src/Main.purs b/purescript/switcheroo/src/Main.purs new file mode 100644 index 0000000..12e5609 --- /dev/null +++ b/purescript/switcheroo/src/Main.purs @@ -0,0 +1,9 @@ +module Main where + +import Prelude + +import Effect (Effect) +import Effect.Console (log) + +main :: Effect Unit +main = log "❄"