mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 14:19:08 +01:00
lib: Add existingPath type to validate path existence at eval time
This commit is contained in:
parent
bcf3650d2e
commit
d83843e5e1
5 changed files with 10 additions and 6 deletions
|
|
@ -15,5 +15,9 @@
|
|||
name: "${name} should only be exposed on private networks; access control isn't yet configured";
|
||||
|
||||
relativePath = path: path |> toString |> lib.removePrefix "${self}/";
|
||||
|
||||
types.existingPath = (lib.types.addCheck lib.types.path lib.pathExists) // {
|
||||
description = "path that exists";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue