diff --git a/.github/workflows/ci-docs.yml b/.github/workflows/ci-docs.yml index 2ae985e7..15de027f 100644 --- a/.github/workflows/ci-docs.yml +++ b/.github/workflows/ci-docs.yml @@ -17,9 +17,5 @@ jobs: with: elm-version: 0.19.1 - uses: cachix/install-nix-action@v26 - with: - nix_path: nixpkgs=channel:nixos-23.05 - - name: Print nixpkgs version - run: nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version' - name: Build website (${{ env.DOCSPELL_VERSION }}) - run: nix-shell website/shell.nix --run "sbt make-website" + run: nix develop .#dev-cnt --command sbt make-website diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index 585b7ff7..375d7f67 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -16,13 +16,9 @@ jobs: with: elm-version: 0.19.1 - uses: cachix/install-nix-action@v26 - with: - nix_path: nixpkgs=channel:nixos-23.05 - - name: Print nixpkgs version - run: nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version' - name: Build website (${{ env.DOCSPELL_VERSION }}) - run: nix-shell website/shell.nix --run "sbt make-website" + run: nix develop .#dev-cnt --command sbt make-website - name: Publish website (${{ env.DOCSPELL_VERSION }}) env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: sbt publish-website + run: nix develop .#dev-cnt --command sbt publish-website diff --git a/flake.nix b/flake.nix index b8a8cdc0..4acb2d17 100644 --- a/flake.nix +++ b/flake.nix @@ -30,6 +30,7 @@ fakeroot zola yarn + inotifyTools ]; docspellPkgs = pkgs.callPackage (import ./nix/pkg.nix) {}; dockerAmd64 = pkgs.pkgsCross.gnu64.callPackage (import ./nix/docker.nix) { diff --git a/project/build.nix b/project/build.nix deleted file mode 100644 index 73f21840..00000000 --- a/project/build.nix +++ /dev/null @@ -1,35 +0,0 @@ -let - nixpkgs = builtins.fetchTarball { - #url = "https://github.com/NixOS/nixpkgs/archive/92e990a8d6bc35f1089c76dd8ba68b78da90da59.tar.gz"; - url = "channel:nixos-23.05"; - }; - pkgs = import nixpkgs {}; - initScript = pkgs.writeScript "docspell-build-init" '' - export LD_LIBRARY_PATH= - ${pkgs.bash}/bin/bash -c "sbt -mem 4096 -java-home ${pkgs.openjdk17}/lib/openjdk" - ''; -in - with pkgs; - buildFHSUserEnv { - name = "docspell-sbt"; - targetPkgs = pkgs: - with pkgs; [ - netcat - jdk17 - wget - which - dpkg - sbt - git - elmPackages.elm - ncurses - fakeroot - mc - zola - yarn - - # haskells http client needs this (to download elm packages) - iana-etc - ]; - runScript = initScript; - } diff --git a/website/README.md b/website/README.md index 66c63ed6..a3d2df97 100644 --- a/website/README.md +++ b/website/README.md @@ -15,19 +15,20 @@ Sbt is used to build the site. Install things by running `yarn install`. -Open terminal for each script below: +Use a dev [environment](https://docspell.org/docs/dev/development/) +and open terminal for each script below: 1. Starting the server ``` shell - nix-shell --run "cd site && zola serve" + cd site && zola serve ``` 2. Building the stylesheet ``` shell - nix-shell --run ./scripts/run-styles.sh + ./scripts/run-styles.sh ``` 3. Building some javascript files ``` shell - nix-shell --run ./scripts/run-elm.sh + ./scripts/run-elm.sh ``` Open browser at `localhost:1111`. @@ -40,7 +41,7 @@ be finally deployed. To see this, start sbt and change into the website project. ``` shell -nix-shell website/shell.nix --run sbt +$ sbt sbt> project website ``` diff --git a/website/push-docs.sh b/website/push-docs.sh index bc017433..d2c090a6 100755 --- a/website/push-docs.sh +++ b/website/push-docs.sh @@ -37,7 +37,7 @@ git clone git@github.com:eikek/docspell.git "$temp" cd "$temp" && git checkout --track origin/gh-pages && rm -rf "$temp"/* echo "Create new website from current working directory" -cd $cdir && nix-shell website/shell.nix --run 'sbt make-website' +cd $cdir && sbt make-website echo "Copying new site to target" cp -R "$cdir"/website/target/zola-site/* "$temp/" diff --git a/website/shell.nix b/website/shell.nix deleted file mode 100644 index 3811e5bc..00000000 --- a/website/shell.nix +++ /dev/null @@ -1,19 +0,0 @@ -let - nixpkgs = builtins.fetchTarball { - url = "channel:nixos-23.05"; - #url = "https://github.com/NixOS/nixpkgs/archive/e6badb26fc0d238fda2432c45b7dd4e782eb8200.tar.gz"; - #url = "https://github.com/NixOs/nixpkgs/archive/0f316e4d72daed659233817ffe52bf08e081b5de.tar.gz"; #21.11 - }; - pkgs = import nixpkgs {}; -in - with pkgs; - mkShell { - buildInputs = [ - zola - yarn - sbt - elmPackages.elm - nodejs - inotifyTools - ]; - } diff --git a/website/site/content/blog/2022-01-31_create_post.md b/website/site/content/blog/2022-01-31_create_post.md index 69bd8ab2..e330694c 100644 --- a/website/site/content/blog/2022-01-31_create_post.md +++ b/website/site/content/blog/2022-01-31_create_post.md @@ -63,11 +63,11 @@ you can look at the results while writing. If you want to see a live view of the page while editing, some tools are required. The easiest way to get these is to install -[nix](https://nixos.org/) and run `nix-shell website/shell.nix` to get -an environment with all these tools installed. Otherwise install the -programs mentioned in `website/shell.nix`, which are: -[yarn](https://yarnpkg.com/), [zola](https://www.getzola.org/), -[elm](https://elm-lang.org) and [sbt](https://scala-sbt.org). +[nix](https://nixos.org/) and run `nix develop .#dev-vm` to get an +environment with all these tools installed. Otherwise install the +programs: [yarn](https://yarnpkg.com/), +[zola](https://www.getzola.org/), [elm](https://elm-lang.org) and +[sbt](https://scala-sbt.org). Then clone the sources to your machine and build the complete site once, so that all assets and required stuff is present: