mirror of
				https://github.com/nmasur/dotfiles
				synced 2025-11-04 00:03:16 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			19 lines
		
	
	
		
			510 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			510 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
# Return a list of all templates
 | 
						|
 | 
						|
{ lib, ... }:
 | 
						|
 | 
						|
lib.pipe (lib.filesystem.listFilesRecursive ./.) [
 | 
						|
  # Get only files ending in flake.nix
 | 
						|
  (builtins.filter (name: lib.hasSuffix "flake.nix" name))
 | 
						|
  # Import each template function
 | 
						|
  (map (file: rec {
 | 
						|
    name = builtins.baseNameOf (builtins.dirOf file);
 | 
						|
    value = {
 | 
						|
      path = builtins.dirOf file;
 | 
						|
      description = "${name} template";
 | 
						|
    };
 | 
						|
  }))
 | 
						|
  # Convert to an attrset of template name -> template path and description
 | 
						|
  (builtins.listToAttrs)
 | 
						|
]
 |