bat: add module
This commit is contained in:
parent
989e636d98
commit
24b5f62090
|
@ -998,6 +998,13 @@ in
|
|||
A new service is available: 'services.mpdris2'.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2019-03-19T22:56:20+00:00";
|
||||
message = ''
|
||||
A new module is available: 'programs.bat'.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ let
|
|||
(loadModule ./programs/astroid.nix { })
|
||||
(loadModule ./programs/autorandr.nix { })
|
||||
(loadModule ./programs/bash.nix { })
|
||||
(loadModule ./programs/bat.nix { })
|
||||
(loadModule ./programs/beets.nix { })
|
||||
(loadModule ./programs/browserpass.nix { })
|
||||
(loadModule ./programs/chromium.nix { condition = hostPlatform.isLinux; })
|
||||
|
|
40
modules/programs/bat.nix
Normal file
40
modules/programs/bat.nix
Normal file
|
@ -0,0 +1,40 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.programs.bat;
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
meta.maintainers = [ maintainers.marsam ];
|
||||
|
||||
options.programs.bat = {
|
||||
enable = mkEnableOption "bat, a cat clone with wings";
|
||||
|
||||
config = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
default = {};
|
||||
example = {
|
||||
theme = "TwoDark";
|
||||
pager = "less -FR";
|
||||
};
|
||||
description = ''
|
||||
Bat configuration.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ pkgs.bat ];
|
||||
|
||||
xdg.configFile."bat/config" = mkIf (cfg.config != {}) {
|
||||
text = concatStringsSep "\n" (
|
||||
mapAttrsToList (n: v: ''--${n}="${v}"'') cfg.config
|
||||
);
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue