From 01903f24c802d32a23b0c13892b0b8a374b63e70 Mon Sep 17 00:00:00 2001 From: Grey Jones Date: Sun, 30 Aug 2026 20:46:00 +0100 Subject: [PATCH] mkEnumFromDirContents --- flake.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flake.nix b/flake.nix index cb2dff9..5dc53bb 100644 --- a/flake.nix +++ b/flake.nix @@ -36,5 +36,7 @@ }; mergeListsToAttrs = names: values: nixpkgs.lib.listToAttrs (nixpkgs.lib.zipListsWith (name: value: { inherit name value; }) names values); + + mkEnumFromDirContents = dir: nixpkgs.lib.types.enum (map (name: nixpkgs.lib.removeSuffix ".nix" name) (builtins.attrNames (builtins.readDir dir))); }; }