fork/home-manager
git clone https://git.julia.blue/fork/home-manager
4fa1ba72
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5let 6 7cfg = config . programs . octant ; 8 9mkPluginEnv = packages : 10let 11pluginDirs = map ( pkg :" ${ pkg } /bin" ) packages ; 12plugins = concatMapStringsSep " " ( p :" ${ p } /*" ) pluginDirs ; 13in pkgs . runCommandLocal "octant-plugins" { } '' 14mkdir $ out 15[[ ' ${ plugins } ' ]] || exit 0 16for plugin in ${ plugins } ; do 17ln -s " $ plugin " $ out / 18done 19'' ; 20 21in { 22meta . maintainers = with maintainers ; [ jk ]; 23 24options = { 25programs . octant = { 26enable = mkEnableOption "octant" ; 27 28package = mkOption { 29type = types . package ; 30default = pkgs . octant ; 31defaultText = literalExpression "pkgs.octant" ; 32example = literalExpression "pkgs.octant-other" ; 33description = "The Octant package to use." ; 34}; 35 36plugins = mkOption { 37default = [ ]; 38example = literalExpression "[ pkgs.starboard-octant-plugin ]" ; 39description = "Optional Octant plugins." ; 40type = types . listOf types . package ; 41}; 42}; 43}; 44 45config = mkIf cfg . enable { 46home . packages = [ cfg . package ]; 47 48xdg . configFile . "octant/plugins" = 49mkIf ( cfg . plugins != [ ]) { source = mkPluginEnv cfg . plugins ; }; 50}; 51}