From d74df64826dd59b1c85eacb53994a23859dc6565 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Sat, 1 Jan 2022 16:41:35 -0800 Subject: [PATCH] Update nixpkgs, fix manual build --- flake.lock | 6 +++--- flake.nix | 4 ++-- manual/default.nix | 21 +++++++++++++-------- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/flake.lock b/flake.lock index abf024d..d067cc3 100644 --- a/flake.lock +++ b/flake.lock @@ -18,11 +18,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1638397275, - "narHash": "sha256-2Jos1CJFTMO9IbulbM4PTKn24nISIDQCAG/AqYQ8rmg=", + "lastModified": 1640418986, + "narHash": "sha256-a8GGtxn2iL3WAkY5H+4E0s3Q7XJt6bTOvos9qqxT5OQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "391f93a83c3a486475d60eb4a569bb6afbf306ad", + "rev": "5c37ad87222cfc1ec36d6cd1364514a9efc2f7f2", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 574296d..7f90fe7 100644 --- a/flake.nix +++ b/flake.nix @@ -29,10 +29,10 @@ }; deploymentOptionsMd = (pkgs.nixosOptionsDoc { options = evalNix.docs.deploymentOptions pkgs; - }).optionsMDDoc; + }).optionsCommonMark; metaOptionsMd = (pkgs.nixosOptionsDoc { options = evalNix.docs.metaOptions pkgs; - }).optionsMDDoc; + }).optionsCommonMark; in pkgs.callPackage ./manual { inherit colmena deploymentOptionsMd metaOptionsMd; }; diff --git a/manual/default.nix b/manual/default.nix index a6e0319..90f4959 100644 --- a/manual/default.nix +++ b/manual/default.nix @@ -1,10 +1,6 @@ -let - notFound = typ: "Error: No ${typ} passed to the builder"; -in - { lib, stdenv, nix-gitignore, mdbook, python3, writeScript -, deploymentOptionsMd ? notFound "deployment options text" -, metaOptionsMd ? notFound "meta options text" +, deploymentOptionsMd ? null +, metaOptionsMd ? null , colmena ? null # Full version @@ -59,8 +55,17 @@ in stdenv.mkDerivation { echo "Error: No colmena executable passed to the builder" >> src/reference/cli.md fi - echo "$deploymentOptionsMd" >> src/reference/deployment.md - echo "$metaOptionsMd" >> src/reference/meta.md + if [[ -n "$deploymentOptionsMd" ]]; then + cat "$deploymentOptionsMd" >> src/reference/deployment.md + else + echo "No deployment options text passed the the builder" >> src/reference/deployment.md + fi + + if [[ -n "$metaOptionsMd" ]]; then + cat "$metaOptionsMd" >> src/reference/meta.md + else + echo "No meta options text passed the the builder" >> src/reference/meta.md + fi mdbook build -d $out