mirror of
https://github.com/nix-community/home-manager
synced 2024-11-30 06:59:45 +01:00
parent
b3d73e0aff
commit
e150dd4a66
3 changed files with 28 additions and 3 deletions
|
@ -6,6 +6,8 @@ let
|
||||||
|
|
||||||
cfg = config.programs.texlive;
|
cfg = config.programs.texlive;
|
||||||
|
|
||||||
|
texlivePkgs = cfg.extraPackages pkgs.texlive;
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -16,7 +18,8 @@ in
|
||||||
enable = mkEnableOption "Texlive";
|
enable = mkEnableOption "Texlive";
|
||||||
|
|
||||||
extraPackages = mkOption {
|
extraPackages = mkOption {
|
||||||
default = self: {};
|
default = tpkgs: { inherit (tpkgs) collection-basic; };
|
||||||
|
defaultText = "tpkgs: { inherit (tpkgs) collection-basic; }";
|
||||||
example = literalExample ''
|
example = literalExample ''
|
||||||
tpkgs: { inherit (tpkgs) collection-fontsrecommended algorithms; }
|
tpkgs: { inherit (tpkgs) collection-fontsrecommended algorithms; }
|
||||||
'';
|
'';
|
||||||
|
@ -32,8 +35,16 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
{
|
||||||
|
assertion = texlivePkgs != {};
|
||||||
|
message = "Must provide at least one extra package in"
|
||||||
|
+ " 'programs.texlive.extraPackages'.";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
home.packages = [ cfg.package ];
|
home.packages = [ cfg.package ];
|
||||||
programs.texlive.package =
|
|
||||||
pkgs.texlive.combine (cfg.extraPackages pkgs.texlive);
|
programs.texlive.package = pkgs.texlive.combine texlivePkgs;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ import nmt {
|
||||||
tests = {
|
tests = {
|
||||||
"git/with-most-options" = ./modules/programs/git.nix;
|
"git/with-most-options" = ./modules/programs/git.nix;
|
||||||
"git/with-str-extra-config" = ./modules/programs/git-with-str-extra-config.nix;
|
"git/with-str-extra-config" = ./modules/programs/git-with-str-extra-config.nix;
|
||||||
|
texlive-minimal = ./modules/programs/texlive-minimal.nix;
|
||||||
xresources = ./modules/xresources.nix;
|
xresources = ./modules/xresources.nix;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
13
tests/modules/programs/texlive-minimal.nix
Normal file
13
tests/modules/programs/texlive-minimal.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
programs.texlive.enable = true;
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertFileExists home-path/bin/tex
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue