diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..c5dd6e3ec --- /dev/null +++ b/Makefile @@ -0,0 +1,48 @@ +db ?= -cf + +.PHONY: help +help: + @echo "Nothing to see here, go away" + +.PHONY: backend-% +backend-%: --stack-work-$* --backend-$* --stack-krow-$* + +.PHONY: database +database: --stack-work-build --database --stack-krow-build + +.PHONY: --database +--database: + (in-develop | grep -q 'In develop') || (echo "Not in develop" 1>&2; exit 1) + stack build --fast --flag uniworx:-library-only --flag uniworx:dev + export SERVER_SESSION_ACID_FALLBACK=$${SERVER_SESSION_ACID_FALLBACK:-true} + stack exec uniworxdb -- $(db) + +node_modules: package.json + yarn install + +.PHONY: %.lock +%.lock: + [ -e $@ ] || touch $@ + flock -en $@ : + +.PHONY: --backend-build +--backend-build: + stack build --fast --profile --library-profiling --executable-profiling --flag uniworx:-library-only --flag uniworx:dev + +.PHONY: --stack-work-% +--stack-work-%: .stack-work.lock + [[ -e .stack-work && -e .stack-work-$* ]] && (echo ".stack-work collides with .stack-work-$*, please resolve manually" 1>&2; exit 1) + [[ -e .stack-work && ! -e .stack-work-$* ]] || mv .stack-work-$* .stack-work + +.PHONY: --stack-krow-% +--stack-krow-%: + [[ -e .stack-work-$* && echo ".stack-work-$* already exists, please resolve manually" 1>&2; exit 1 ]] || mv .stack-work .stack-work-$* + flock -u .stack-work.lock + +# TODO: yarn2nix target + +# watch: +# while true; do \ +# +# start: frontend-build frontend-build-watch yesod-start +# run-s frontend:build --parallel "frontend:build:watch" "yesod:start" diff --git a/flake.nix b/flake.nix index 6a7d3e080..164d0a282 100644 --- a/flake.nix +++ b/flake.nix @@ -107,7 +107,7 @@ (final: prev: let pkgs = import nixpkgs { inherit system; }; in { - inherit (pkgs) dockerTools yarn yarn2nix glibcLocalesUtf8 tzdata chromium minio minio-client skopeo; inherit (pkgs.stdenv) fetchurlBoot; + inherit (pkgs) dockerTools yarn glibcLocalesUtf8 tzdata chromium minio minio-client skopeo; inherit (pkgs.stdenv) fetchurlBoot; stack = pkgs.symlinkJoin { inherit (pkgs.stack) name; paths = [pkgs.stack]; diff --git a/shell.nix b/shell.nix index 1147455ea..08d5d469d 100644 --- a/shell.nix +++ b/shell.nix @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2022-2023 Gregor Kleen , Sarah Vaupel , Steffen Jost +# SPDX-FileCopyrightText: 2022-2024 Sarah Vaupel , Gregor Kleen , Steffen Jost # # SPDX-License-Identifier: AGPL-3.0-or-later @@ -180,6 +180,8 @@ let PGHOST=''${pgSockDir} PGLOG=''${pgLogFile} + AVSPASS=''${AVSPASS:-nopasswordset} + WIDGET_MEMCACHED_HOST=localhost WIDGET_MEMCACHED_PORT=$(($PORT_OFFSET + 11211)) @@ -274,7 +276,7 @@ in pkgs.mkShell { nativeBuildInputs = [develop inDevelop killallUni2work diffRunning] ++ (with pkgs; [ stack nodejs_21 yarn postgresql_12 openldap exiftool expat memcached minio minio-client - gup reuse pre-commit + gnumake gup reuse pre-commit yarn2nix # busybox # for print services, but interferes with build commands in develop-shell htop