diff --git a/CHANGELOG.md b/CHANGELOG.md index ec0d8f76..48fd22e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ A preview of the next release can be installed from - Compile distributed uberjar using GraalVM, fixes `babashka.process/exec` for Nix - [#1414](https://github.com/babashka/babashka/issues/1414): preserve metadata on exec task function argument map - [#1269](https://github.com/babashka/babashka/issues/1269): add lib tests for sluj ([@bobisageek](https://github.com/bobisageek)) - +- Update nix app example in docs ## 1.0.165 (2022-11-01) - Fix [#1401](https://github.com/babashka/babashka/issues/1401): mutation of `deftype` field should be visible in protocol method diff --git a/doc/nix.md b/doc/nix.md index 68b26178..25dcb3ec 100644 --- a/doc/nix.md +++ b/doc/nix.md @@ -81,39 +81,7 @@ After running `direnv allow`, babashka should be available on the `$PATH`, when You can write babashka scripts with native dependencies using [WriteBabashkaApplication](https://github.com/sohalt/write-babashka-application). -Here is an example `flake.nix` using `cowsay` as an external dependency: +The WriteBabashkaApplication repository has an [example](https://github.com/Sohalt/write-babashka-application/tree/main/example) `flake.nix` using `cowsay` as an external dependency. -```nix -{ - inputs.wbba.url = "github:sohalt/write-babashka-application"; - inputs.flake-utils.url = "github:numtide/flake-utils"; - outputs = { nixpkgs, flake-utils, wbba, ... }: - flake-utils.lib.eachDefaultSystem (system: - let - pkgs = import nixpkgs { - inherit system; - overlays = [ wbba.overlay ]; - }; - hello-babashka = pkgs.writeBabashkaApplication { - name = "hello"; - runtimeInputs = with pkgs;[ - cowsay # add your dependencies here - ]; - text = '' - (ns hello - (:require [babashka.process :refer [sh]])) - (-> (sh ["cowsay" "hello from babashka"]) - :out - print) - ''; - }; - in - { - defaultApp = hello-babashka; - defaultPackage = hello-babashka; - }); -} -``` - -You can then build the application using `nix build` or run it using `nix run`. +You can download that example, and then build the application using `nix build` or run it using `nix run`.