From 6b398c56e4bd3d706c8d8253d823e869929d95b8 Mon Sep 17 00:00:00 2001 From: oluceps Date: Thu, 2 Jan 2025 08:43:16 +0800 Subject: [PATCH] dae: configFile option more strict check (#152) * dae: configFile option strict check * doc: escape branch ref --- README.md | 2 +- dae/module.nix | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 25f7a6d..0d4b1be 100644 --- a/README.md +++ b/README.md @@ -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/ ++ refs/heads/\ + refs/tags/v0.0.0 Workflow for updating release and unstable: diff --git a/dae/module.nix b/dae/module.nix index 8ae6a35..7a8c4f8 100644 --- a/dae/module.nix +++ b/dae/module.nix @@ -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. ''; };