From f02ff6b9a988db111e0384640876f20ecd0e8293 Mon Sep 17 00:00:00 2001 From: Joris Date: Tue, 5 Jul 2022 15:05:22 +0200 Subject: Simplify tooling --- .envrc | 1 - .gitignore | 4 +--- .tmuxinator.yml | 8 -------- Makefile | 35 ----------------------------------- README.md | 18 ++++-------------- package.json | 7 ------- shell.nix | 27 ++++++++++++++++----------- stack.yaml | 11 ----------- 8 files changed, 21 insertions(+), 90 deletions(-) delete mode 100644 .envrc delete mode 100644 .tmuxinator.yml delete mode 100644 Makefile delete mode 100644 package.json delete mode 100644 stack.yaml diff --git a/.envrc b/.envrc deleted file mode 100644 index 051d09d..0000000 --- a/.envrc +++ /dev/null @@ -1 +0,0 @@ -eval "$(lorri direnv)" diff --git a/.gitignore b/.gitignore index da83f62..ebb916c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,2 @@ -ad-listener.nix local.conf -.ghc.environment.* -.stack-work/ +dist-newstyle diff --git a/.tmuxinator.yml b/.tmuxinator.yml deleted file mode 100644 index 0d7363f..0000000 --- a/.tmuxinator.yml +++ /dev/null @@ -1,8 +0,0 @@ -name: ad-listener -startup_window: app - -windows: - - console: - - # Empty - - app: - - make clean install watch diff --git a/Makefile b/Makefile deleted file mode 100644 index 339ea3e..0000000 --- a/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -all: build - -# Dev commands - -start: - @nix-shell --command "tmuxinator local" - -stop: - @nix-shell --command "tmuxinator stop ad-listener" - -# Other commands - -clean: - @stack clean > /dev/null - -install: - @stack setup - -watch: build - @nodemon --watch src --delay 0.2 -e hs,conf --exec 'clear && make build-and-launch' - -build-and-launch: - @(pkill ad-listener || true) && (stack build && make run || true) - -run: - @stack exec ad-listener - -build: - @stack build - -repl: - @stack repl - -test: - @stack test diff --git a/README.md b/README.md index ca0390d..97520ce 100644 --- a/README.md +++ b/README.md @@ -6,25 +6,15 @@ Ad-listener listen for changes at given URLs on: - [ouestFrance](https://www.ouestfrance-immo.com/), - [seLoger](https://www.seloger.com/). -Then, it send a mail whenever a new ad come up. +Then, it send a mail whenever a new ad comes up. ## Getting started -1. Install [nix](https://nixos.org/nix/), -2. launch `make start`, -3. later, stop the project with `make stop`. +In `nix-shell`, run `cabal run ad-listener`. -## Build executable +## Tests -```bash -make build -``` - -## Run tests - -```bash -make test -``` +In a `nix-shell`, run `cabal test` ## Configuration diff --git a/package.json b/package.json deleted file mode 100644 index e591786..0000000 --- a/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "dependencies": { - "nodemon": "1.9.2" - }, - "repository": "guyonvarch/ad-listener", - "license": "GPL-3.0" -} diff --git a/shell.nix b/shell.nix index afe339f..997bd76 100644 --- a/shell.nix +++ b/shell.nix @@ -1,12 +1,17 @@ -with import {}; { - env = stdenv.mkDerivation { - name = "env"; - buildInputs = with nodePackages; with haskellPackages; [ - stack - nodemon - stylish-haskell - tmux - tmuxinator - ]; - }; +with (import (builtins.fetchGit { + name = "nixos-21.05-2021-08-02"; + url = "https://github.com/nixos/nixpkgs/"; + ref = "refs/heads/nixos-21.05"; + rev = "d4590d21006387dcb190c516724cb1e41c0f8fdf"; +}){}); + +mkShell { + + buildInputs = with haskellPackages; [ + cabal-install + stylish-haskell + tmux + (ghc.withPackages (hp: [ hp.zlib ])) + ]; + } diff --git a/stack.yaml b/stack.yaml deleted file mode 100644 index b953365..0000000 --- a/stack.yaml +++ /dev/null @@ -1,11 +0,0 @@ -resolver: lts-14.4 - -packages: -- . -- location: - git: https://gitlab.com/guyonvarch/config-manager - commit: c0f5e9c5ad8ac88b05ecff9b035c59480829aff1 - extra-dep: true - -extra-deps: -- logging-3.0.5@sha256:88096d3124fce9a19af3720f751e1a354d866ed5030d2e5197238d2277cdb2f2 -- cgit v1.2.3