Skip to content

Commit

Permalink
dae: configFile option more strict check (#152)
Browse files Browse the repository at this point in the history
* dae: configFile option strict check

* doc: escape branch ref
  • Loading branch information
oluceps authored Jan 2, 2025
1 parent 6e2e7bd commit 6b398c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ About **adding a new version**, if the `VERSION` you provided doesn't match any
The `--rev` args could pass in with any sha1 or references:

+ revision sha1 hash
+ refs/heads/<branch>
+ refs/heads/\<branch>
+ refs/tags/v0.0.0

Workflow for updating release and unstable:
Expand Down
10 changes: 6 additions & 4 deletions dae/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,18 @@ in
let
inherit (types) nullOr addCheck str;
isAbsolutePathString = x: lib.substring 0 1 x == "/";
isNotInStore = x: !lib.hasPrefix builtins.storeDir x;
combineTopic = x: isAbsolutePathString x && isNotInStore x;
in
(nullOr (addCheck str isAbsolutePathString))
(nullOr (addCheck str combineTopic))
// {
description = "${types.str.description} (with check: is absolute path string)";
description = "${types.str.description} (with check: should be absolute path **string** which not a store path)";
};
default = null;
example = ''"/path/to/your/config.dae"'';
description = ''
The absolute path string of dae config file, end with `.dae`.
Will fallback to `"/etc/dae/config.dae"` if this is not set.
The absolute path string of dae config file which not in nix store,
end with `.dae`. Will fallback to `"/etc/dae/config.dae"` if this is not set.
'';
};

Expand Down

0 comments on commit 6b398c5

Please sign in to comment.