fork/home-manager
git clone https://git.julia.blue/fork/home-manager
4e92ec84
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5let 6cfg = config . programs . ion ; 7 8aliasesStr = concatStringsSep "\n" 9( mapAttrsToList ( k :v :"alias ${ k } = ${ escapeShellArg v } " ) 10cfg . shellAliases ); 11in { 12meta . maintainers = [ maintainers . jo1gi ]; 13 14options . programs . ion = { 15enable = mkEnableOption "the Ion Shell. Compatible with Redox and Linux" ; 16 17package = mkOption { 18type = types . package ; 19default = pkgs . ion ; 20defaultText = literalExpression "pkgs.ion" ; 21description = '' 22The ion package to install. May be used to change the version. 23'' ; 24}; 25 26initExtra = mkOption { 27type = types . lines ; 28default = "" ; 29description = '' 30Ion script which is called during ion initialization. 31'' ; 32}; 33 34shellAliases = mkOption { 35type = with types ; attrsOf str ; 36default = { }; 37example = literalExpression '' 38{ 39g = "git"; 40} 41'' ; 42description = '' 43An attribute set that maps aliases (the top level attribute names 44in this option) to command strings or directly to build outputs. 45'' ; 46}; 47}; 48 49config = mkIf cfg . enable { 50home . packages = [ cfg . package ]; 51 52xdg . configFile . "ion/initrc" . text = '' 53# Aliases 54${ aliasesStr } 55 56${ cfg . initExtra } 57'' ; 58}; 59}