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 . texlive ; 8 9texlive = cfg . packageSet ; 10texlivePkgs = cfg . extraPackages texlive ; 11 12in { 13meta . maintainers = [ maintainers . rycee ]; 14 15options = { 16programs . texlive = { 17enable = mkEnableOption "TeX Live" ; 18 19packageSet = mkOption { 20default = pkgs . texlive ; 21defaultText = literalExpression "pkgs.texlive" ; 22description = "TeX Live package set to use." ; 23}; 24 25extraPackages = mkOption { 26default = tpkgs :{ inherit ( tpkgs ) collection-basic ; }; 27defaultText = "tpkgs: { inherit (tpkgs) collection-basic; }" ; 28example = literalExpression '' 29tpkgs: { inherit (tpkgs) collection-fontsrecommended algorithms; } 30'' ; 31description = "Extra packages available to TeX Live." ; 32}; 33 34package = mkOption { 35type = types . package ; 36description = "Resulting customized TeX Live package." ; 37readOnly = true ; 38}; 39}; 40}; 41 42config = mkIf cfg . enable { 43assertions = [{ 44assertion = texlivePkgs != { }; 45message = "Must provide at least one extra package in" 46+ " 'programs.texlive.extraPackages'." ; 47}]; 48 49home . packages = [ cfg . package ]; 50 51programs . texlive . package = texlive . combine texlivePkgs ; 52}; 53}