Skip to content

Commit

Permalink
chore(dae): refine configFile type (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
oluceps authored and web-flow committed Sep 23, 2024
1 parent bfdc4b1 commit cc895d7
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 cc895d7

Please sign in to comment.