mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 11:39:46 +01:00
lsd: add support for config file
lsd 0.19.0 added support for a configuration file
This commit is contained in:
parent
42bb553544
commit
1ee1835a3e
1 changed files with 21 additions and 0 deletions
|
@ -6,6 +6,8 @@ let
|
||||||
|
|
||||||
cfg = config.programs.lsd;
|
cfg = config.programs.lsd;
|
||||||
|
|
||||||
|
yamlFormat = pkgs.formats.yaml { };
|
||||||
|
|
||||||
aliases = {
|
aliases = {
|
||||||
ls = "${pkgs.lsd}/bin/lsd";
|
ls = "${pkgs.lsd}/bin/lsd";
|
||||||
ll = "ls -l";
|
ll = "ls -l";
|
||||||
|
@ -27,6 +29,21 @@ in {
|
||||||
Whether to enable recommended lsd aliases.
|
Whether to enable recommended lsd aliases.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
settings = mkOption {
|
||||||
|
type = yamlFormat.type;
|
||||||
|
default = { };
|
||||||
|
example = {
|
||||||
|
date = "relative";
|
||||||
|
ignore-globs = [ ".git" ".hg" ];
|
||||||
|
};
|
||||||
|
description = ''
|
||||||
|
Configuration written to
|
||||||
|
<filename>~/.config/lsd/config.yaml</filename>. See
|
||||||
|
<link xlink:href="https://github.com/Peltoche/lsd#config-file-content"/>
|
||||||
|
for supported values.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
@ -37,5 +54,9 @@ in {
|
||||||
programs.zsh.shellAliases = mkIf cfg.enableAliases aliases;
|
programs.zsh.shellAliases = mkIf cfg.enableAliases aliases;
|
||||||
|
|
||||||
programs.fish.shellAliases = mkIf cfg.enableAliases aliases;
|
programs.fish.shellAliases = mkIf cfg.enableAliases aliases;
|
||||||
|
|
||||||
|
xdg.configFile."lsd/config.yaml" = mkIf (cfg.settings != { }) {
|
||||||
|
source = yamlFormat.generate "lsd-config" cfg.settings;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue