From 22b203645b2030598f0f966cd37aa09bf6936e73 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Fri, 22 Mar 2024 14:00:18 +0100 Subject: [PATCH] Fix flake.parts docs (#533) * Fix flake.parts docs generation * ci: Check flake.parts docs generation * ci: note about future refactor --------- Co-authored-by: Sridhar Ratnakumar --- .github/workflows/ci.yaml | 7 +++++++ nix/flake-module.nix | 9 +++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 40d794863..b04a1b96a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -33,6 +33,13 @@ jobs: - name: Check closure size run: | nix run .#check-closure-size + - name: Docs for flake.parts + run: | + # TODO: Define this in nixci itself. + nix build \ + github:hercules-ci/flake.parts-website#generated-docs-emanote \ + --override-input emanote ../emanote/ \ + --show-trace # TODO: Use self-hosted runner website: diff --git a/nix/flake-module.nix b/nix/flake-module.nix index 14c30bdc5..2fcb0999e 100644 --- a/nix/flake-module.nix +++ b/nix/flake-module.nix @@ -47,6 +47,7 @@ in type = types.str; description = ''Like `path` but local (not in Nix store)''; default = builtins.toString config.path; + defaultText = lib.literalMD "toString path"; }; mountPoint = mkOption { type = types.nullOr types.str; @@ -57,15 +58,19 @@ in type = types.str; description = ''Layer spec''; readOnly = true; - default = if config.mountPoint == null then "${config.path}" else "${config.path}@${config.mountPoint}"; }; outputs.layerString = mkOption { type = types.str; description = ''Layer spec''; readOnly = true; - default = if config.mountPoint == null then config.pathString else "${config.pathString}@${config.mountPoint}"; }; }; + config = { + outputs.layer = + if config.mountPoint == null then "${config.path}" else "${config.path}@${config.mountPoint}"; + outputs.layerString = + if config.mountPoint == null then config.pathString else "${config.pathString}@${config.mountPoint}"; + }; })); }; # TODO: Consolidate all these options below with those of home-manager-module.nix