From 36b5f5e5f70d13ce8ba2eb8e73c6b31c19a227bb Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sat, 26 Nov 2022 06:02:19 +0100 Subject: [PATCH] hms: make `defaultManualPath` into callPackage arg --- flake.nix | 3 +++ searchers/home-manager-search.nix | 6 +----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index c8c968c..7b76b64 100644 --- a/flake.nix +++ b/flake.nix @@ -39,6 +39,9 @@ pkgs.callPackage ./searchers/home-manager-search.nix { inherit home-manager; inherit (self.packages.${system}) json2nix; + defaultManualPath = + let pkg = self.packages.${system}.home-manager-json; + in "${pkg}/share/doc/home-manager/options.json"; }; nix-option-search = pkgs.callPackage ./searchers/nix-option-search.nix { inherit nixpkgs; diff --git a/searchers/home-manager-search.nix b/searchers/home-manager-search.nix index 6c1998d..7105f8d 100644 --- a/searchers/home-manager-search.nix +++ b/searchers/home-manager-search.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, home-manager, system, json2nix, ... }: +{ pkgs, lib, home-manager, defaultManualPath, system, json2nix, ... }: let usage = pkgs.writeText "home-manager-search-usage" '' Usage: @@ -106,10 +106,6 @@ let echo $JSON_DATA | ${gomplate} --datasource opt=stdin:?type=application/json --file ${template} ''; - defaultManualPath = "${ - home-manager.packages.${system}.docs-json - }/share/doc/home-manager/options.json"; - in pkgs.writers.writeBash "search-home-manager-attrs" '' JSON_MANUAL_PATH="${defaultManualPath}"