Skip to content

declnix/zef

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

███████╗███████╗███████╗
╚══███╔╝██╔════╝██╔════╝
  ███╔╝ █████╗  █████╗  
 ███╔╝  ██╔══╝  ██╔══╝  
███████╗███████╗██║     
╚══════╝╚══════╝╚═╝     

Declarative Nix Configuration Framework for zsh, targeting <50 ms cold start. Inspired by nvf, built around the idea that if the entire shell config is known at build time, the runtime can be a thin shim.

Prototype — the minimal round-trip (declarative config → wrapped zsh package → working interactive shell) works. Plugin self-registration, deferred loading, static bundling, and .zwc precompilation are still on the roadmap.

Get Started

Run a demo shell directly from this repo:

nix develop

For real use, write a tiny adapter module. Example for hjem — the adapter declares one opaque option, forwards it to zef.lib.zshConfiguration, and puts the resulting package on the user's path:

{ config, lib, pkgs, inputs, ... }:
{
  options.flakeAdapters.zef = lib.mkOption {
    type = lib.types.deferredModule;
    default = { };
  };

  config.packages = [
    (inputs.zef.lib.zshConfiguration {
      inherit pkgs;
      modules = [ config.flakeAdapters.zef ];
    }).package
  ];
}

Then any module imported by hjem can contribute config — the same DSL as zshConfiguration.modules:

{
  flakeAdapters.zef = {
    setopt = [ "AUTO_CD" "EXTENDED_GLOB" ];
    history.size = 50000;
    initConfig = ''
      eval "$(${pkgs.starship}/bin/starship init zsh)"
    '';
  };
}

lib.types.deferredModule keeps zef's internal module layout an implementation detail and lets multiple contributions to flakeAdapters.zef merge natively — useful for patterns like "universal config + per-host override".

Disclaimer

Personal hobby project, developed in spare time, primarily for my own use. Built with AI assistance. The API surface is unstable and will change without notice — pin a revision if you depend on it. No warranty, no support commitment, no fitness-for-purpose guarantee.

About

Zsh, but keep it snappy and declarative with Nix ❄️

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors