aboutsummaryrefslogtreecommitdiffstats
path: root/lib/types.nix
diff options
context:
space:
mode:
Diffstat (limited to 'lib/types.nix')
-rw-r--r--lib/types.nix13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/types.nix b/lib/types.nix
index 572964a..09d403a 100644
--- a/lib/types.nix
+++ b/lib/types.nix
@@ -1,6 +1,19 @@
{ lib, ... }:
with lib;
rec {
+
+ haskell.conid = mkOptionType {
+ name = "Haskell constructor identifier";
+ check = test "[[:upper:]][[:lower:]_[:upper:]0-9']*";
+ merge = mergeOneOption;
+ };
+
+ haskell.modid = mkOptionType {
+ name = "Haskell module identifier";
+ check = x: isString x && all haskell.conid.check (splitString "." x);
+ merge = mergeOneOption;
+ };
+
# POSIX.1‐2013, 3.2 Absolute Pathname
absolute-pathname = mkOptionType {
name = "POSIX absolute pathname";