1
0
Fork 0
mirror of https://github.com/Mic92/sops-nix.git synced 2025-03-31 04:14:37 +00:00

modules/sops: fix manual

* Since 0d957142b6 the manual doesn't
  build since `<name>` is interpreted by docbook as (unmatched) XML-tag.
  I decided to use `<xref linkend` as this provides proper linking to
  the referenced option.

* Also, if the module is included on a machine where `sops` isn't used,
  but `documentation.nixos.includeAllModules = true;` is set, the module
  wouldn't evaluate because `config.sopsFile` is referenced in a
  `default`-tag. This is generally an issue since every change to this
  option would trigger a rebuild of the manual anyways.

  See also 94fd200305 for that.
This commit is contained in:
Maximilian Bosch 2021-07-10 16:11:31 +02:00
parent 87a27217b2
commit df2d4bbbfc
No known key found for this signature in database
GPG key ID: 091DBF4D1FC46B8E

View file

@ -8,6 +8,7 @@ let
secretType = types.submodule ({ config, ... }: {
config = {
sopsFile = lib.mkOptionDefault cfg.defaultSopsFile;
sopsFileHash = mkOptionDefault (optionalString cfg.validateSopsFiles "${builtins.hashFile "sha256" config.sopsFile}");
};
options = {
name = mkOption {
@ -73,9 +74,8 @@ let
sopsFileHash = mkOption {
type = types.str;
readOnly = true;
default = if cfg.validateSopsFiles then "${builtins.hashFile "sha256" config.sopsFile}" else "";
description = ''
Hash of the sops file, useful in systemd.services.<name>.restartTriggers.
Hash of the sops file, useful in <xref linkend="opt-systemd.services._name_.restartTriggers" />.
'';
};
};