Skip to content

Commit

Permalink
chore(dae): refine configFile type (#106) (#107)
Browse files Browse the repository at this point in the history
Co-authored-by: oluceps <i@oluceps.uk>
  • Loading branch information
github-actions[bot] and oluceps authored Sep 23, 2024
1 parent 8f581ef commit ece55b2
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions dae/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,20 @@ in
};

configFile = mkOption {
type = with types; (nullOr path);
type =
let
inherit (types) nullOr addCheck str;
isAbsolutePathString = x: lib.substring 0 1 x == "/";
in
(nullOr (addCheck str isAbsolutePathString))
// {
description = "${types.str.description} (with check: is absolute path string)";
};
default = null;
example = "/path/to/your/config.dae";
example = ''"/path/to/your/config.dae"'';
description = ''
The path 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, end with `.dae`.
Will fallback to `"/etc/dae/config.dae"` if this is not set.
'';
};

Expand Down

0 comments on commit ece55b2

Please sign in to comment.