From bcc10f561b1f13e16ee418b65302e3fc65a91f31 Mon Sep 17 00:00:00 2001 From: Emily Martins Date: Mon, 29 May 2023 16:35:41 +0200 Subject: [PATCH] expose 'doc-modules' package that generates module documentation --- flake.nix | 17 ++++++++++++++++- nix/offchain.nix | 10 ++-------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/flake.nix b/flake.nix index ead8a67..33c4a3f 100644 --- a/flake.nix +++ b/flake.nix @@ -40,10 +40,23 @@ inputs.pre-commit-hooks.flakeModule ]; systems = [ "x86_64-linux" "aarch64-darwin" "x86_64-darwin" "aarch64-linux" ]; - perSystem = { config, self', inputs', pkgs, lib, system, ... }: + perSystem = { options, config, self', inputs', pkgs, lib, system, ... }: let pkgs = import inputs.nixpkgs { inherit system; }; utils = import ./nix/utils.nix { inherit pkgs lib; }; + doc-modules = (inputs.flake-parts.lib.evalFlakeModule + { + inherit inputs; + } + { + imports = [ + ./nix/onchain.nix + ./nix/run.nix + ./nix/offchain.nix + # FIXME: This module doesn't seem to work yet. + # ./nix/ci-config.nix + ]; + }); in { pre-commit = { @@ -62,6 +75,7 @@ shellHook = config.pre-commit.installationScript; }; formatter = pkgs.nixpkgs-fmt; + packages.options-doc = (pkgs.nixosOptionsDoc { inherit (doc-modules) options; }).optionsCommonMark; # This check is for `liqwid-nix` itself. checks.nixFormat = @@ -69,6 +83,7 @@ find -name '*.nix' -not -path './dist*/*' -not -path './haddock/*' | xargs nixpkgs-fmt ''; }; + herculesCI = { ciSystems = [ "x86_64-linux" ]; onPush.default.outputs = self.checks.x86_64-linux; diff --git a/nix/offchain.nix b/nix/offchain.nix index 65d89b9..3d7e66d 100644 --- a/nix/offchain.nix +++ b/nix/offchain.nix @@ -348,14 +348,8 @@ in default = false; }; - nodejsPackage = lib.mkOption { - description = '' - The nodejs package to use. - - Added in: 2.1.1. - ''; - type = types.package; - default = pkgs.nodejs-14_x; + nodejsPackage = lib.mkPackageOption pkgs "nodejs" { + default = [ "nodejs-14_x" ]; }; }; };